# Ordinary Differential Equations

Ordinary differential equations are able to be solved numerically to find their corresponding function value at a certain point.

## Contents |

## Euler's Method

Euler's method approximates the function value using the ordinary differential equation at x + h. An initial value for the function is given, x_{0} and y_{0}. Applying Euler's method once gives the value of the function at the next point, which h from the last point. It may be required that multiple steps are required given the step size, h, to get to the require function value.

To solve a ODE, rearrange the differential as follows:

Then substitute the initial conditions into the following formula:

where y_{1} = y(x+h).

To find y(x+h+h), use the new values, where x_{0} = x+h and y_{0} = y(x+h). This can be repeated to find the require y(x) value at the required x.

Euler's method is a first order method, therefore its error is O(h).

## Huen's Method

Huen's method is an improvement to the Euler's method. It calculates the slope at two different points and averages them to get a more accurate result.

It is recommended that you calculate parts of this formula separately to avoid making mistakes during substitution.

Huen's method is a second order method, therefore its error is O(h^{2}).

## Runge-Kutta Method

Runge-Kutta method is a more accurate method of solving ODEs. The error of a Runge-Kutta is dependent on the order of the Runge-Kutta chosen. The second order Runge Kutta is equal to Huen's method.

The following is the formula for the fourth order Runge-Kutta method, with error O(h^{4}):

where:

## End

This is the end of this topic. Click here to go back to the main subject page for Numerical Methods & Statistics.