next up previous
Next: Adams Methods Up: Higher Order Methods Previous: Higher Order Methods

Runge-Kutta Methods

In the forward Euler method, we used the information on the slope or the derivative of y at the given time step to extrapolate the solution to the next time-step. The LTE for the method is O(h2), resulting in a first order numerical technique. Runge-Kutta methods are a class of methods which judiciously uses the information on the 'slope' at more than one point to extrapolate the solution to the future time step. Let's discuss first the derivation of the second order RK method where the LTE is O(h3).

Given the IVP of Eq. 6, and a time step h, and the solution yn at the nth time step, let's say that we wish to compute yn+1 in the following fashion:

    k1 = hf(yn,tn)  
    $\displaystyle k_2 = hf(y_n+\beta k_1, t_n + \alpha h)$  
    yn+1 = yn + ak1 + bk2, (12)

where the constants $\alpha$, $\beta$, a and b have to be evaluated so that the resulting method has a LTE O(h3). Note that if k2=0 and a=1, then Eq. 13 reduces to the forward Euler method.

Now, let's write down the Taylor series expansion of y in the neighborhood of tn correct to the h2 term i.e.,

\begin{displaymath}y(t_{n+1}) = y(t_n) + h \frac{dy}{dt}\vert _{t_n} + \frac {h^2}{2} \frac{d^2y}{dt^2}\vert _{t_n} + {\mbox{O}}(h^3).
\end{displaymath} (13)

However, we know from the IVP (Eq. 6) that dy/dt = f(y,t) so that

\begin{displaymath}\frac{d^2y}{dt^2} = \frac{df(y,t)}{dt} = \frac{\partial f}{\p...
...rac{\partial f}{\partial t} + f \frac{\partial f}{\partial y}.
\end{displaymath} (14)

So from the above analysis, i.e., Eqs. 14 and 15, we get

\begin{displaymath}y_{n+1} = y_n + h f(y_n,t_n) + \frac{h^2}{2} \left[ \frac{\pa...
...ac{\partial f}{\partial y}\right](y_n,t_n)
+ {\mbox{O}}(h^3).
\end{displaymath} (15)

However, the term k2 in the proposed RK method of Eq. 13 can be expanded correct to O(h3) as
    $\displaystyle k_2 = hf(y_n+\beta k_1, t_n + \alpha h)$  
    $\displaystyle = h\left( f(y_n,t_n) + \alpha h\frac{\partial f}{\partial t} (y_n...
... + \beta k_1 \frac{\partial f}{\partial t} (y_n, t_n)\right)
+ {\mbox{O}}(h^3).$ (16)

Now, substituting for k2 from Eq. 17 in Eq. 13, we get

\begin{displaymath}y_{n+1} = y_n + (a+b) h f(y_n,t_n) + bh^2(\alpha \frac {\part...
...f
\frac {\partial f}{\partial y})(y_n,t_n) + {\mbox{O}}(h^3).
\end{displaymath} (17)

Comparing the terms with identical coefficients in Eqs. 16 and 18 gives us the following system of equations to determine the constants:

    a+b=1  
    $\displaystyle \alpha b = \frac{1}{2}$  
    $\displaystyle \beta b = \frac{1}{2}.$ (18)

There are infinitely many choices of a, b, $\alpha$ and $\beta$ which satisfy Eq. 19, we can choose for instance $\alpha = \beta = 1$ and a=b=1/2. With this choice, we have the classical second order accurate Runge-Kutta method (RK2) which is summarized as follows.
    k1 = hf(yn,tn)  
    k2 = hf(yn+k1, tn + h)  
    $\displaystyle y_{n+1} = y_n + (k_1 + k_2)/2, \:\:\: {\mbox{Second Order Runge-Kutta Method (RK2).}}$ (19)

In a similar fashion Runge-Kutta methods of higher order can be developed. One of the most widely used methods for the solution of IVPs is the fourth order Runge-Kutta (RK4) technique. The LTE of this method is order h5. The method is given below.

    k1 = hf(yn,tn)  
    k2 = hf(yn+k1/2, tn + h/2)  
    $\displaystyle k_3 = hf(y_n+k_2/2, t_n + h/2) \:\: \: {\mbox{Fourth Order Runge-Kutta Method (RK4).}}$  
    k4 = h(yn+k3, tn + h)  
    yn+1 = yn + (k1 + 2k2 + 2k3 + k4)/6. (20)

Note that the RK methods are explicit techniques, hence they are only conditionally stable.


next up previous
Next: Adams Methods Up: Higher Order Methods Previous: Higher Order Methods
Michael Zeltkevic
1998-04-15