Wednesday, April 23, 2014

Higher Order Integration Methods

The Euler’s methods (both forward and backward) are single step methods, as is evident from the formulation. An improved solution for ODE’s can be obtained from higher order methods. A series of formulations known as the Runge-Kutta (RK) techniques fall under the higher order methods. The RK methods involve multiple steps at each time instant to move from t(n) to t(n+1).

The simplest of RK methods is the 2-step RK solver. At each time step t(n), given y(n), the solution to advance to y(n+1) is:

 New Picture 

New Picture (1)

The RK2 method from the above equations can be quite easily implemented for fixed step size integration. The algorithm can be summarized as:

1)    % Define step size (h), initial function y(0), initial time t0, final time tf
2)    nosteps = (tf – t0)/h
3)    for i ← 1 to nosteps

-       Calculate derivative function f[t0,y[i-1]]
-       q1 ← y[i-1] + 0.5*h* f[t0,y[i-1]]
-       t0 ← t0 + 0.5*h
-       Calculate f[t0,q1]
-       y[i] ← y[i-1] + h*f[t0,q1]
-       t0 ← t0 + h

4)    Display results

1 comment:

  1. […] 2-step RK method is pretty much the same as the Euler’s method performed with two time steps. The 2-step RK method […]

    ReplyDelete