Problem
Given the vector u(t) = (u1(t), ..., un(t))T, where, for each function uk(t), we have a first-order ODE deined by:
then we may define
where
Given this, together with the initial value u(t0) = u0 = (u0,1, ..., u0,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 tk = t0 + kh. We now examine how each method may be implemented.
Euler
Given uk, let:
Heun
Given uk, let:
K1 = f(tk + h, uk + hK0)
Then we define:
4th-order Runge Kutta
Given uk, let:
K1 = f(tk + ½h, uk + ½hK0)
K2 = f(tk + ½h, uk + ½hK1)
K3 = f(tk + h, uk + hK2)
Then we define:
Copyright ©2006 by Douglas Wilhelm Harder. All rights reserved.