7.3 Runge–Kutta Method

Although Euler’s method works in principle, it is neither fast nor stable. There are several ways to improve Euler’s method, and similar to numerical integration, these ways differ in the amount of additional sampling points used and in the way the additional information gained from these points is treated. Using fixed step sizes leads to the family of Runge–Kutta methods.

Consider the use of Euler’s method not for the full interval but only to take an intermediate step to the midpoint and to determine the slope also there, in order to use the increment determined from this midpoint slope to perform the full step:

 \begin{equation*} \begin{split} k_1 &= hf(x_n,y_n),\\ k_2 &= hf(x_n+\frac{1}{2}h,y_n+\frac{1}{2}k_1),\\ y_{n+1} &= y_n+k_2 \end{split} \end{equation*}(7.7)
(cf. Fig. 7.2). This method has second-order accuracy, i.e. the error in this method is of order \(O(h^3)\). It is called the second-order Runge–Kutta or the midpoint method.

PIC

Figure 7.2: Midpoint method (two steps). Second-order accuracy is obtained by using the initial derivative at each step to find a point halfway across the interval, then using the midpoint derivative across the full width of the interval. In the figure, filled dots represent final function values, while open dots represent function values that are discarded once their derivatives have been used.


As an example for a method of even higher order, consider the frequently used fourth-order Runge–Kutta method, where the derivative is computed four times in each step to determine increments: first at the starting point (stored in \(k_1\)), then twice at the midpoint (stored in \(k_2\) and \(k_3\)), and also at a trial endpoint (stored in \(k_4\)). The final endpoint is obtained by using a weighted average of these slopes:

 \begin{equation*} \begin{split} k_1 &= hf(x_n,y_n)\\ k_2 &= hf(x_n+\frac{1}{2}h,y_n+\frac{1}{2}k_1)\\ k_3 &= hf(x_n+\frac{1}{2}h,y_n+\frac{1}{2}k_2)\\ k_4 &= hf(x_n+h,y_n+k_3)\\ y_{n+1} &= y_n+\frac{k_1}{6}+\frac{k_2}{3}+\frac{k_3}{3}+\frac{k_4}{6}. \end{split} \end{equation*}(7.8)
The error in this method is or order \(O(h^5)\).


With frame Back Forward as PDF

© J. Carstensen (Comp. Math.)