# Problem

Given the vector **u**(*t*) = (*u*_{1}(*t*), ..., *u*_{n}(*t*))^{T}, where, for
each function *u*_{k}(*t*), we
have a first-order ODE deined by:

*u*

^{(1)}

_{k}(

*t*) =

*f*

_{k}(

*t*,

**u**(

*t*))

then we may define

**u**

^{(1)}(

*t*) =

**f**(

*t*,

**u**(

*t*))

where

Given this, together with the initial value **u**(*t*_{0}) = **u**_{0} =
(*u*_{0,1}, ..., *u*_{0,n})^{T},
we would like to approximate the solution to this IVP.

# Assumptions

The function **f**(*t*, **u**) is continous.

# Tools

We will use Euler, Heun, and 4th-order Runge Kutta, though the extension to RKF45 is straight-forward.

# Process

Given a step size *h*, then *t*_{k} = *t*_{0} + *kh*. We now examine how each method may be implemented.

### Euler

Given **u**_{k}, let:

**u**

_{k + 1}=

**u**

_{k}+

*h*

**f**(

*t*

_{k},

**u**

_{k})

### Heun

Given **u**_{k}, let:

**K**

_{0}=

**f**(

*t*

_{k},

**u**

_{k})

**K**

_{1}=

**f**(

*t*

_{k}+

*h*,

**u**

_{k}+

*h*

**K**

_{0})

Then we define:

### 4th-order Runge Kutta

Given **u**_{k}, let:

**K**

_{0}=

**f**(

*t*

_{k},

**u**

_{k})

**K**

_{1}=

**f**(

*t*

_{k}+ ½

*h*,

**u**

_{k}+ ½

*h*

**K**

_{0})

**K**

_{2}=

**f**(

*t*

_{k}+ ½

*h*,

**u**

_{k}+ ½

*h*

**K**

_{1})

**K**

_{3}=

**f**(

*t*

_{k}+

*h*,

**u**

_{k}+

*h*

**K**

_{2})

Then we define:

Copyright ©2006 by Douglas Wilhelm Harder. All rights reserved.