next up previous
Next: 4.2 Initial Value Problems Up: 4.1 Initial Value Problems Previous: 4.1.5 Predictor-Corrector Method

4.1.6 Runge-Kutta Method

Figure 4.1: a) EC formula (= RK of first order); b) RK of second order

$\textstyle \parbox{450pt}{
{\bf Runge-Kutta of order 2:}
...nonumber \\
y_{n+1}&=&y_{n}+k_{2}+O[(\Delta t)^{3}]
\nonumber \end{eqnarray}}$

(Also called half-step method, or Euler-Richardson algorithm.)

A much more powerful method that has found wide application is the RK algorithm of order 4, as described in the table.

{\bf Runge-Kutta of order 4 for first-order ODE:}
...c{1}{6}[k_{1}+2k_{2}+2k_{3}+k_{4}]+O[(\Delta t)^{5}]
\nonumber \end{eqnarray}}}

Advantages of RK:

- Self-starting (no preceding $y_{n-1} \dots$ needed)
- Adjustable $\Delta t$


- Several evaluations of $f(y)$ per step; may be too expensive

Stability of RK:

Half-step + relaxation equation: $\Delta t \leq 2/\lambda$.

EXERCISE: Test various algorithms by applying them to an analytically solvable problem, as the harmonic oscillator or the 2-body Kepler problem. Include in your code tests that do not rely on the existence of an analytical solution (energy conservation or such.) Finally, apply the code to more complex problems such as the anharmonic oscillator or the many-body Kepler problem.

Franz J. Vesely Oct 2005
See also:
"Computational Physics - An Introduction," Kluwer-Plenum 2001