Runge–Kutta methods
Runge–Kutta methods
In numerical analysis, the Runge–Kutta methods are a family of implicit and explicit iterative methods, which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations.[1] These methods were developed around 1900 by the German mathematicians Carl Runge and Wilhelm Kutta.
The Runge–Kutta method
Slopes used by the classical Runge-Kutta method
The most widely known member of the Runge–Kutta family is generally referred to as "RK4", the "classic Runge–Kutta method" or simply as "the Runge–Kutta method".
Let an initial value problem be specified as follows:
Now pick a step-size h > 0 and define
for n = 0, 1, 2, 3, ..., using[2]
is the increment based on the slope at the beginning of the interval, using (Euler's method);
is the increment based on the slope at the midpoint of the interval, using and ;
is again the increment based on the slope at the midpoint, but now using and ;
is the increment based on the slope at the end of the interval, using and .
Explicit Runge–Kutta methods
The family of explicit Runge–Kutta methods is a generalization of the RK4 method mentioned above. It is given by
where[5]
To specify a particular method, one needs to provide the integer s (the number of stages), and the coefficients aij (for 1 ≤ j < i ≤ s), bi (for i = 1, 2, ..., s) and ci (for i = 2, 3, ..., s). The matrix [aij] is called the Runge–Kutta matrix, while the bi and ci are known as the weights and the nodes.[6] These data are usually arranged in a mnemonic device, known as a Butcher tableau (after John C. Butcher):
The Runge–Kutta method is consistent if
There are also accompanying requirements if one requires the method to have a certain order p, meaning that the local truncation error is O(hp+1). These can be derived from the definition of the truncation error itself. For example, a two-stage method has order 2 if b1 + b2 = 1, b2c2 = 1/2, and a21 = c2.[7]
Examples
The RK4 method falls in this framework. Its tableau is[10]
0 | ||||
1/2 | 1/2 | |||
1/2 | 0 | 1/2 | ||
1 | 0 | 0 | 1 | |
1/6 | 1/3 | 1/3 | 1/6 |
A slight variation of "the" Runge–Kutta method is also due to Kutta in 1901 and is called the 3/8-rule.[11] The primary advantage this method has is that almost all of the error coefficients are smaller than in the popular method, but it requires slightly more FLOPs (floating-point operations) per time step. Its Butcher tableau is
0 | ||||
1/3 | 1/3 | |||
2/3 | -1/3 | 1 | ||
1 | 1 | −1 | 1 | |
1/8 | 3/8 | 3/8 | 1/8 |
0 | |
1 |
Second-order methods with two stages
An example of a second-order method with two stages is provided by the midpoint method:
The corresponding tableau is
0 | ||
1/2 | 1/2 | |
0 | 1 |
The midpoint method is not the only second-order Runge–Kutta method with two stages; there is a family of such methods, parameterized by α and given by the formula[12]
Its Butcher tableau is
0 | ||
Use
As an example, consider the two-stage second-order Runge–Kutta method with α = 2/3, also known as Ralston method. It is given by the tableau
0 | |||
2/3 | 2/3 | ||
1/4 | 3/4 |
with the corresponding equations
This method is used to solve the initial-value problem
with step size h = 0.025, so the method needs to take four steps.
The method proceeds as follows:
The numerical solutions correspond to the underlined values.
Adaptive Runge–Kutta methods
During the integration, the step size is adapted such that the estimated error stays below a user-defined threshold: If the error is too high, a step is repeated with a lower step size; if the error is much smaller, the step size is increased to save time. This results in an (almost) optimal step size, which saves computation time. Moreover, the user does not have to spend time on finding an appropriate step size.
The lower-order step is given by
0 | ||||||
The Runge–Kutta–Fehlberg method has two methods of orders 5 and 4. Its extended Butcher tableau is:
0 | |||||||
1/4 | 1/4 | ||||||
3/8 | 3/32 | 9/32 | |||||
12/13 | 1932/2197 | −7200/2197 | 7296/2197 | ||||
1 | 439/216 | −8 | 3680/513 | -845/4104 | |||
1/2 | −8/27 | 2 | −3544/2565 | 1859/4104 | −11/40 | ||
16/135 | 0 | 6656/12825 | 28561/56430 | −9/50 | 2/55 | ||
25/216 | 0 | 1408/2565 | 2197/4104 | −1/5 | 0 |
However, the simplest adaptive Runge–Kutta method involves combining Heun's method, which is order 2, with the Euler method, which is order 1. Its extended Butcher tableau is:
0 | |||
1 | 1 | ||
1/2 | 1/2 | ||
1 | 0 |
Other adaptive Runge–Kutta methods are the Bogacki–Shampine method (orders 3 and 2), the Cash–Karp method and the Dormand–Prince method (both with orders 5 and 4).
Nonconfluent Runge–Kutta methods
Runge–Kutta-Nyström methods
Runge-Kutta Nyström methods are specialized Runge-Kutta methods that are optimized for second-order differential equations of the form:[14]
On the other hand, a general Runge-Kutta Nyström method is optimized for second-order differential equations of the form:[15]
Implicit Runge–Kutta methods
All Runge–Kutta methods mentioned up to now are explicit methods. Explicit Runge–Kutta methods are generally unsuitable for the solution of stiff equations because their region of absolute stability is small; in particular, it is bounded.[16] This issue is especially important in the solution of partial differential equations.
The instability of explicit Runge–Kutta methods motivates the development of implicit methods. An implicit Runge–Kutta method has the form
where
The consequence of this difference is that at every step, a system of algebraic equations has to be solved. This increases the computational cost considerably. If a method with s stages is used to solve a differential equation with m components, then the system of algebraic equations has ms components. This can be contrasted with implicit linear multistep methods (the other big family of methods for ODEs): an implicit s-step linear multistep method needs to solve a system of algebraic equations with only m components, so the size of the system does not increase as the number of steps increases.[18]
Examples
The simplest example of an implicit Runge–Kutta method is the backward Euler method:
The Butcher tableau for this is simply:
This Butcher tableau corresponds to the formulae
which can be re-arranged to get the formula for the backward Euler method listed above.
Another example for an implicit Runge–Kutta method is the trapezoidal rule. Its Butcher tableau is:
The trapezoidal rule is a collocation method (as discussed in that article). All collocation methods are implicit Runge–Kutta methods, but not all implicit Runge–Kutta methods are collocation methods.[19]
The Gauss–Legendre methods form a family of collocation methods based on Gauss quadrature. A Gauss–Legendre method with s stages has order 2s (thus, methods with arbitrarily high order can be constructed).[20] The method with two stages (and thus order four) has Butcher tableau:
Stability
where e stands for the vector of ones. The function r is called the stability function.[22] It follows from the formula that r is the quotient of two polynomials of degree s if the method has s stages. Explicit methods have a strictly lower triangular matrix A, which implies that det(I − zA) = 1 and that the stability function is a polynomial.[23]
The numerical solution to the linear test equation decays to zero if | r(z) | < 1 with z = hλ. The set of such z is called the domain of absolute stability. In particular, the method is said to be absolute stable if all z with Re(z) < 0 are in the domain of absolute stability. The stability function of an explicit Runge–Kutta method is a polynomial, so explicit Runge–Kutta methods can never be A-stable.[23]
The Gauss–Legendre method with s stages has order 2s, so its stability function is the Padé approximant with m = n = s. It follows that the method is A-stable.[25] This shows that A-stable Runge–Kutta can have arbitrarily high order. In contrast, the order of A-stable linear multistep methods cannot exceed two.[26]
B-stability
Derivation of the Runge–Kutta fourth-order method
where:
where:
If we now express the general formula using what we just derived we obtain:
we obtain a system of constraints on the coefficients:
See also
Euler's method
Numerical methods for ordinary differential equations
Runge–Kutta method (SDE)
General linear methods
Lie group integrator