Runge–Kutta methods

From HandWiki
Short description: Family of implicit and explicit iterative methods
Comparison of the Runge-Kutta methods for the differential equation [math]\displaystyle{ y'=\sin(t)^2 \cdot y }[/math] (red is the exact solution)

In numerical analysis, the Runge–Kutta methods (English: /ˈrʊŋəˈkʊtɑː/ (About this soundlisten) RUUNG-ə-KUUT-tah[1]) are a family of implicit and explicit iterative methods, which include the Euler method, used in temporal discretization for the approximate solutions of simultaneous nonlinear equations.[2] 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:

[math]\displaystyle{ \frac{dy}{dt} = f(t, y), \quad y(t_0) = y_0. }[/math]

Here [math]\displaystyle{ y }[/math] is an unknown function (scalar or vector) of time [math]\displaystyle{ t }[/math], which we would like to approximate; we are told that [math]\displaystyle{ \frac{dy}{dt} }[/math], the rate at which [math]\displaystyle{ y }[/math] changes, is a function of [math]\displaystyle{ t }[/math] and of [math]\displaystyle{ y }[/math] itself. At the initial time [math]\displaystyle{ t_0 }[/math] the corresponding [math]\displaystyle{ y }[/math] value is [math]\displaystyle{ y_0 }[/math]. The function [math]\displaystyle{ f }[/math] and the initial conditions [math]\displaystyle{ t_0 }[/math], [math]\displaystyle{ y_0 }[/math] are given.

Now we pick a step-size h > 0 and define:

[math]\displaystyle{ \begin{align} y_{n+1} &= y_n + \frac{h}{6}\left(k_1 + 2k_2 + 2k_3 + k_4 \right),\\ t_{n+1} &= t_n + h \\ \end{align} }[/math]

for n = 0, 1, 2, 3, ..., using[3]

[math]\displaystyle{ \begin{align} k_1 &= \ f(t_n, y_n), \\ k_2 &= \ f\!\left(t_n + \frac{h}{2}, y_n + h \frac{k_1}{2}\right), \\ k_3 &= \ f\!\left(t_n + \frac{h}{2}, y_n + h \frac{k_2}{2}\right), \\ k_4 &= \ f\!\left(t_n + h, y_n + h k_3\right). \end{align} }[/math]

(Note: the above equations have different but equivalent definitions in different texts.[4])

Here [math]\displaystyle{ y_{n+1} }[/math] is the RK4 approximation of [math]\displaystyle{ y(t_{n+1}) }[/math], and the next value ([math]\displaystyle{ y_{n+1} }[/math]) is determined by the present value ([math]\displaystyle{ y_n }[/math]) plus the weighted average of four increments, where each increment is the product of the size of the interval, h, and an estimated slope specified by function f on the right-hand side of the differential equation.

  • [math]\displaystyle{ k_1 }[/math] is the slope at the beginning of the interval, using [math]\displaystyle{ y }[/math] (Euler's method);
  • [math]\displaystyle{ k_2 }[/math] is the slope at the midpoint of the interval, using [math]\displaystyle{ y }[/math] and [math]\displaystyle{ k_1 }[/math];
  • [math]\displaystyle{ k_3 }[/math] is again the slope at the midpoint, but now using [math]\displaystyle{ y }[/math] and [math]\displaystyle{ k_2 }[/math];
  • [math]\displaystyle{ k_4 }[/math] is the slope at the end of the interval, using [math]\displaystyle{ y }[/math] and [math]\displaystyle{ k_3 }[/math].

In averaging the four slopes, greater weight is given to the slopes at the midpoint. If [math]\displaystyle{ f }[/math] is independent of [math]\displaystyle{ y }[/math], so that the differential equation is equivalent to a simple integral, then RK4 is Simpson's rule.[5]

The RK4 method is a fourth-order method, meaning that the local truncation error is on the order of [math]\displaystyle{ O(h^5) }[/math], while the total accumulated error is on the order of [math]\displaystyle{ O(h^4) }[/math].

In many practical applications the function [math]\displaystyle{ f }[/math] is independent of [math]\displaystyle{ t }[/math] (so called autonomous system, or time-invariant system, especially in physics), and their increments are not computed at all and not passed to function [math]\displaystyle{ f }[/math], with only the final formula for [math]\displaystyle{ t_{n+1} }[/math] used.

Explicit Runge–Kutta methods

The family of explicit Runge–Kutta methods is a generalization of the RK4 method mentioned above. It is given by

[math]\displaystyle{ y_{n+1} = y_n + h \sum_{i=1}^s b_i k_i, }[/math]

where[6]

[math]\displaystyle{ \begin{align} k_1 & = f(t_n, y_n), \\ k_2 & = f(t_n+c_2h, y_n+(a_{21}k_1)h), \\ k_3 & = f(t_n+c_3h, y_n+(a_{31}k_1+a_{32}k_2)h), \\ & \ \ \vdots \\ k_s & = f(t_n+c_sh, y_n+(a_{s1}k_1+a_{s2}k_2+\cdots+a_{s,s-1}k_{s-1})h). \end{align} }[/math]
(Note: the above equations may have different but equivalent definitions in some texts.[4])

To specify a particular method, one needs to provide the integer s (the number of stages), and the coefficients aij (for 1 ≤ j < is), 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.[7] These data are usually arranged in a mnemonic device, known as a Butcher tableau (after John C. Butcher):

[math]\displaystyle{ 0 }[/math]
[math]\displaystyle{ c_2 }[/math] [math]\displaystyle{ a_{21} }[/math]
[math]\displaystyle{ c_3 }[/math] [math]\displaystyle{ a_{31} }[/math] [math]\displaystyle{ a_{32} }[/math]
[math]\displaystyle{ \vdots }[/math] [math]\displaystyle{ \vdots }[/math] [math]\displaystyle{ \ddots }[/math]
[math]\displaystyle{ c_s }[/math] [math]\displaystyle{ a_{s1} }[/math] [math]\displaystyle{ a_{s2} }[/math] [math]\displaystyle{ \cdots }[/math] [math]\displaystyle{ a_{s,s-1} }[/math]
[math]\displaystyle{ b_1 }[/math] [math]\displaystyle{ b_2 }[/math] [math]\displaystyle{ \cdots }[/math] [math]\displaystyle{ b_{s-1} }[/math] [math]\displaystyle{ b_s }[/math]

A Taylor series expansion shows that the Runge–Kutta method is consistent if and only if

[math]\displaystyle{ \sum_{i=1}^{s} b_{i} = 1. }[/math]

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 b2a21 = 1/2.[8] Note that a popular condition for determining coefficients is [9]

[math]\displaystyle{ \sum_{j=1}^{i-1} a_{ij} = c_i \text{ for } i=2, \ldots, s. }[/math]

This condition alone, however, is neither sufficient, nor necessary for consistency. [10]

In general, if an explicit [math]\displaystyle{ s }[/math]-stage Runge–Kutta method has order [math]\displaystyle{ p }[/math], then it can be proven that the number of stages must satisfy [math]\displaystyle{ s \ge p }[/math], and if [math]\displaystyle{ p \ge 5 }[/math], then [math]\displaystyle{ s \ge p+1 }[/math].[11] However, it is not known whether these bounds are sharp in all cases. In some cases, it is proven that the bound cannot be achieved. For instance, Butcher proved that for [math]\displaystyle{ p\gt 6 }[/math], there is no explicit method with [math]\displaystyle{ s=p+1 }[/math] stages.[12] Butcher also proved that for [math]\displaystyle{ p\gt 7 }[/math], there is no explicit Runge-Kutta method with [math]\displaystyle{ p+2 }[/math] stages.[13] In general, however, it remains an open problem what the precise minimum number of stages [math]\displaystyle{ s }[/math] is for an explicit Runge–Kutta method to have order [math]\displaystyle{ p }[/math]. Some values which are known are:[14]

[math]\displaystyle{ \begin{array}{c|cccccccc} p & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline \min s & 1 & 2 & 3 & 4 & 6 & 7 & 9 & 11 \end{array} }[/math]

The provable bound above then imply that we can not find methods of orders [math]\displaystyle{ p=1, 2, \ldots, 6 }[/math] that require fewer stages than the methods we already know for these orders. The work of Butcher also proves that 7th and 8th order methods have a minimum of 9 and 11 stages, respectively.[15][16] An example of an explicit method of order 6 with 7 stages can be found in.[17] Explicit methods of order 7 with 9 stages[18] and explicit methods of order 8 with 11 stages[19] are also known. See Refs.[20][21] for a summary.

Examples

The RK4 method falls in this framework. Its tableau is[22]

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.[23] 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

However, the simplest Runge–Kutta method is the (forward) Euler method, given by the formula [math]\displaystyle{ y_{n+1} = y_n + hf(t_n, y_n) }[/math]. This is the only consistent explicit Runge–Kutta method with one stage. The corresponding tableau is

0
1

Second-order methods with two stages

An example of a second-order method with two stages is provided by the explicit midpoint method:

[math]\displaystyle{ y_{n+1} = y_n + hf\left(t_n+\frac{1}{2}h, y_n+\frac{1}{2}hf(t_n,\ y_n)\right). }[/math]

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[24]

[math]\displaystyle{ y_{n+1} = y_n + h\bigl( (1-\tfrac1{2\alpha}) f(t_n, y_n) + \tfrac1{2\alpha} f(t_n + \alpha h, y_n + \alpha h f(t_n, y_n)) \bigr). }[/math]

Its Butcher tableau is

0
[math]\displaystyle{ \alpha }[/math] [math]\displaystyle{ \alpha }[/math]
[math]\displaystyle{ (1-\tfrac1{2\alpha}) }[/math] [math]\displaystyle{ \tfrac1{2\alpha} }[/math]

In this family, [math]\displaystyle{ \alpha=\tfrac12 }[/math] gives the midpoint method, [math]\displaystyle{ \alpha=1 }[/math] is Heun's method,[5] and [math]\displaystyle{ \alpha=\tfrac23 }[/math] is Ralston's method.

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

[math]\displaystyle{ \begin{align} k_1 &= f(t_n,\ y_n), \\ k_2 &= f(t_n + \tfrac{2}{3}h,\ y_n + \tfrac{2}{3}h k_1), \\ y_{n+1} &= y_n + h\left(\tfrac{1}{4}k_1+\tfrac{3}{4}k_2\right). \end{align} }[/math]

This method is used to solve the initial-value problem

[math]\displaystyle{ \frac{dy}{dt} = \tan(y)+1,\quad y_0=1,\ t\in [1, 1.1] }[/math]

with step size h = 0.025, so the method needs to take four steps.

The method proceeds as follows:

[math]\displaystyle{ t_0=1 \colon }[/math]
[math]\displaystyle{ y_0=1 }[/math]
[math]\displaystyle{ t_1=1.025 \colon }[/math]
[math]\displaystyle{ y_0 = 1 }[/math] [math]\displaystyle{ k_1=2.557407725 }[/math] [math]\displaystyle{ k_2 = f(t_0 + \tfrac23h ,\ y_0 + \tfrac23hk_1) = 2.7138981400 }[/math]
[math]\displaystyle{ y_1=y_0+h(\tfrac14k_1 + \tfrac34k_2)=\underline{1.066869388} }[/math]
[math]\displaystyle{ t_2=1.05 \colon }[/math]
[math]\displaystyle{ y_1 = 1.066869388 }[/math] [math]\displaystyle{ k_1=2.813524695 }[/math] [math]\displaystyle{ k_2 = f(t_1 + \tfrac23h ,\ y_1 + \tfrac23hk_1) }[/math]
[math]\displaystyle{ y_2=y_1+h(\tfrac14k_1 + \tfrac34k_2)=\underline{1.141332181} }[/math]
[math]\displaystyle{ t_3=1.075 \colon }[/math]
[math]\displaystyle{ y_2 = 1.141332181 }[/math] [math]\displaystyle{ k_1=3.183536647 }[/math] [math]\displaystyle{ k_2 = f(t_2 + \tfrac23h ,\ y_2 + \tfrac23hk_1) }[/math]
[math]\displaystyle{ y_3=y_2+h(\tfrac14k_1 + \tfrac34k_2)=\underline{1.227417567} }[/math]
[math]\displaystyle{ t_4=1.1 \colon }[/math]
[math]\displaystyle{ y_3 = 1.227417567 }[/math] [math]\displaystyle{ k_1=3.796866512 }[/math] [math]\displaystyle{ k_2 = f(t_3 + \tfrac23h ,\ y_3 + \tfrac23hk_1) }[/math]
[math]\displaystyle{ y_4=y_3+h(\tfrac14k_1 + \tfrac34k_2)=\underline{1.335079087}. }[/math]

The numerical solutions correspond to the underlined values.

Adaptive Runge–Kutta methods

Adaptive methods are designed to produce an estimate of the local truncation error of a single Runge–Kutta step. This is done by having two methods, one with order [math]\displaystyle{ p }[/math] and one with order [math]\displaystyle{ p - 1 }[/math]. These methods are interwoven, i.e., they have common intermediate steps. Thanks to this, estimating the error has little or negligible computational cost compared to a step with the higher-order method.

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

[math]\displaystyle{ y^*_{n+1} = y_n + h\sum_{i=1}^s b^*_i k_i, }[/math]

where [math]\displaystyle{ k_i }[/math] are the same as for the higher-order method. Then the error is

[math]\displaystyle{ e_{n+1} = y_{n+1} - y^*_{n+1} = h\sum_{i=1}^s (b_i - b^*_i) k_i, }[/math]

which is [math]\displaystyle{ O(h^p) }[/math]. The Butcher tableau for this kind of method is extended to give the values of [math]\displaystyle{ b^*_i }[/math]:

0
[math]\displaystyle{ c_2 }[/math] [math]\displaystyle{ a_{21} }[/math]
[math]\displaystyle{ c_3 }[/math] [math]\displaystyle{ a_{31} }[/math] [math]\displaystyle{ a_{32} }[/math]
[math]\displaystyle{ \vdots }[/math] [math]\displaystyle{ \vdots }[/math] [math]\displaystyle{ \ddots }[/math]
[math]\displaystyle{ c_s }[/math] [math]\displaystyle{ a_{s1} }[/math] [math]\displaystyle{ a_{s2} }[/math] [math]\displaystyle{ \cdots }[/math] [math]\displaystyle{ a_{s,s-1} }[/math]
[math]\displaystyle{ b_1 }[/math] [math]\displaystyle{ b_2 }[/math] [math]\displaystyle{ \cdots }[/math] [math]\displaystyle{ b_{s-1} }[/math] [math]\displaystyle{ b_s }[/math]
[math]\displaystyle{ b^*_1 }[/math] [math]\displaystyle{ b^*_2 }[/math] [math]\displaystyle{ \cdots }[/math] [math]\displaystyle{ b^*_{s-1} }[/math] [math]\displaystyle{ b^*_s }[/math]

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

A Runge–Kutta method is said to be nonconfluent [25] if all the [math]\displaystyle{ c_i,\,i=1,2,\ldots,s }[/math] are distinct.

Runge–Kutta–Nyström methods

Runge–Kutta–Nyström methods are specialized Runge-Kutta methods that are optimized for second-order differential equations. [26][27]

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.[28] 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

[math]\displaystyle{ y_{n+1} = y_n + h \sum_{i=1}^s b_i k_i, }[/math]

where

[math]\displaystyle{ k_i = f\left( t_n + c_i h,\ y_{n} + h \sum_{j=1}^s a_{ij} k_j \right), \quad i = 1, \ldots, s. }[/math] [29]

The difference with an explicit method is that in an explicit method, the sum over j only goes up to i − 1. This also shows up in the Butcher tableau: the coefficient matrix [math]\displaystyle{ a_{ij} }[/math] of an explicit method is lower triangular. In an implicit method, the sum over j goes up to s and the coefficient matrix is not triangular, yielding a Butcher tableau of the form[22]

[math]\displaystyle{ \begin{array}{c|cccc} c_1 & a_{11} & a_{12}& \dots & a_{1s}\\ c_2 & a_{21} & a_{22}& \dots & a_{2s}\\ \vdots & \vdots & \vdots& \ddots& \vdots\\ c_s & a_{s1} & a_{s2}& \dots & a_{ss} \\ \hline & b_1 & b_2 & \dots & b_s\\ & b^*_1 & b^*_2 & \dots & b^*_s\\ \end{array} = \begin{array}{c|c} \mathbf{c}& A\\ \hline & \mathbf{b^T} \\ \end{array} }[/math]

See Adaptive Runge-Kutta methods above for the explanation of the [math]\displaystyle{ b^* }[/math] row.

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.[30]

Examples

The simplest example of an implicit Runge–Kutta method is the backward Euler method:

[math]\displaystyle{ y_{n + 1} = y_n + h f(t_n + h,\ y_{n + 1}). \, }[/math]

The Butcher tableau for this is simply:

[math]\displaystyle{ \begin{array}{c|c} 1 & 1 \\ \hline & 1 \\ \end{array} }[/math]

This Butcher tableau corresponds to the formulae

[math]\displaystyle{ k_1 = f(t_n + h,\ y_n + h k_1) \quad\text{and}\quad y_{n+1} = y_n + h k_1, }[/math]

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:

[math]\displaystyle{ \begin{array}{c|cc} 0 & 0& 0\\ 1 & \frac{1}{2}& \frac{1}{2}\\ \hline & \frac{1}{2}&\frac{1}{2}\\ & 1 & 0 \\ \end{array} }[/math]

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.[31]

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).[32] The method with two stages (and thus order four) has Butcher tableau:

[math]\displaystyle{ \begin{array}{c|cc} \frac12 - \frac16 \sqrt3 & \frac14 & \frac14 - \frac16 \sqrt3 \\ \frac12 + \frac16 \sqrt3 & \frac14 + \frac16 \sqrt3 & \frac14 \\ \hline & \frac12 & \frac12 \\ & \frac12+\frac12 \sqrt3 & \frac12-\frac12 \sqrt3 \end{array} }[/math] [30]

Stability

The advantage of implicit Runge–Kutta methods over explicit ones is their greater stability, especially when applied to stiff equations. Consider the linear test equation [math]\displaystyle{ y' = \lambda y }[/math]. A Runge–Kutta method applied to this equation reduces to the iteration [math]\displaystyle{ y_{n+1} = r(h\lambda) \, y_n }[/math], with r given by

[math]\displaystyle{ r(z) = 1 + z b^T (I-zA)^{-1} e = \frac{\det(I-zA+zeb^T)}{\det(I-zA)}, }[/math] [33]

where e stands for the vector of ones. The function r is called the stability function.[34] 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(IzA) = 1 and that the stability function is a polynomial.[35]

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.[35]

If the method has order p, then the stability function satisfies [math]\displaystyle{ r(z) = \textrm{e}^z + O(z^{p+1}) }[/math] as [math]\displaystyle{ z \to 0 }[/math]. Thus, it is of interest to study quotients of polynomials of given degrees that approximate the exponential function the best. These are known as Padé approximants. A Padé approximant with numerator of degree m and denominator of degree n is A-stable if and only if mnm + 2.[36]

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.[37] 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.[38]

B-stability

The A-stability concept for the solution of differential equations is related to the linear autonomous equation [math]\displaystyle{ y'=\lambda y }[/math]. Dahlquist proposed the investigation of stability of numerical schemes when applied to nonlinear systems that satisfy a monotonicity condition. The corresponding concepts were defined as G-stability for multistep methods (and the related one-leg methods) and B-stability (Butcher, 1975) for Runge–Kutta methods. A Runge–Kutta method applied to the non-linear system [math]\displaystyle{ y'=f(y) }[/math], which verifies [math]\displaystyle{ \langle f(y)-f(z),\ y-z \rangle\leq 0 }[/math], is called B-stable, if this condition implies [math]\displaystyle{ \|y_{n+1}-z_{n+1}\|\leq\|y_{n}-z_{n}\| }[/math] for two numerical solutions.

Let [math]\displaystyle{ B }[/math], [math]\displaystyle{ M }[/math] and [math]\displaystyle{ Q }[/math] be three [math]\displaystyle{ s\times s }[/math] matrices defined by [math]\displaystyle{ B=\operatorname{diag}(b_1,b_2,\ldots,b_s),\, M=BA+A^TB-bb^T,\, Q=BA^{-1}+A^{-T}B-A^{-T}bb^TA^{-1}. }[/math]A Runge–Kutta method is said to be algebraically stable[39] if the matrices [math]\displaystyle{ B }[/math] and [math]\displaystyle{ M }[/math] are both non-negative definite. A sufficient condition for B-stability[40] is: [math]\displaystyle{ B }[/math] and [math]\displaystyle{ Q }[/math] are non-negative definite.

Derivation of the Runge–Kutta fourth-order method

In general a Runge–Kutta method of order [math]\displaystyle{ s }[/math] can be written as:

[math]\displaystyle{ y_{t + h} = y_t + h \cdot \sum_{i=1}^s a_i k_i +\mathcal{O}(h^{s+1}), }[/math]

where:

[math]\displaystyle{ k_i =h \cdot \sum_{j = 1}^s \beta_{ij} f\left(k_j,\ t_n + \alpha_i h \right) }[/math]

are increments obtained evaluating the derivatives of [math]\displaystyle{ y_t }[/math] at the [math]\displaystyle{ i }[/math]-th order.

We develop the derivation[41] for the Runge–Kutta fourth-order method using the general formula with [math]\displaystyle{ s=4 }[/math] evaluated, as explained above, at the starting point, the midpoint and the end point of any interval [math]\displaystyle{ (t,\ t +h) }[/math]; thus, we choose:

[math]\displaystyle{ \begin{align} &\alpha_i & &\beta_{ij} \\ \alpha_1 &= 0 & \beta_{21} &= \frac{1}{2} \\ \alpha_2 &= \frac{1}{2} & \beta_{32} &= \frac{1}{2} \\ \alpha_3 &= \frac{1}{2} & \beta_{43} &= 1 \\ \alpha_4 &= 1 & &\\ \end{align} }[/math]

and [math]\displaystyle{ \beta_{ij} = 0 }[/math] otherwise. We begin by defining the following quantities:

[math]\displaystyle{ \begin{align} y^1_{t+h} &= y_t + hf\left(y_t,\ t\right) \\ y^2_{t+h} &= y_t + hf\left(y^1_{t+h/2},\ t+\frac{h}{2}\right) \\ y^3_{t+h} &= y_t + hf\left(y^2_{t+h/2},\ t+\frac{h}{2}\right) \end{align} }[/math]

where [math]\displaystyle{ y^1_{t+h/2} = \dfrac{y_t + y^1_{t+h}}{2} }[/math] and [math]\displaystyle{ y^2_{t+h/2} = \dfrac{y_t + y^2_{t+h}}{2} }[/math]. If we define:

[math]\displaystyle{ \begin{align} k_1 &= f(y_t,\ t) \\ k_2 &= f\left(y^1_{t+h/2},\ t + \frac{h}{2}\right) = f\left(y_t + \frac{h}{2} k_1,\ t + \frac{h}{2}\right) \\ k_3 &= f\left(y^2_{t+h/2},\ t + \frac{h}{2}\right) = f\left(y_t + \frac{h}{2} k_2,\ t + \frac{h}{2}\right) \\ k_4 &= f\left(y^3_{t+h},\ t + h\right) = f\left(y_t + h k_3,\ t + h\right) \end{align} }[/math]

and for the previous relations we can show that the following equalities hold up to [math]\displaystyle{ \mathcal{O}(h^2) }[/math]:[math]\displaystyle{ \begin{align} k_2 &= f\left(y^1_{t+h/2},\ t + \frac{h}{2}\right) = f\left(y_t + \frac{h}{2} k_1,\ t + \frac{h}{2}\right) \\ &= f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt}f\left(y_t,\ t\right) \\ k_3 &= f\left(y^2_{t+h/2},\ t + \frac{h}{2}\right) = f\left(y_t + \frac{h}{2} f\left(y_t + \frac{h}{2} k_1,\ t + \frac{h}{2}\right),\ t + \frac{h}{2}\right) \\ &= f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt} \left[ f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt}f\left(y_t,\ t\right) \right] \\ k_4 &= f\left(y^3_{t+h},\ t + h\right) = f\left(y_t + h f\left(y_t + \frac{h}{2} k_2,\ t + \frac{h}{2}\right),\ t + h\right) \\ &= f\left(y_t + h f\left(y_t + \frac{h}{2} f\left(y_t + \frac{h}{2} f\left(y_t,\ t\right),\ t + \frac{h}{2}\right),\ t + \frac{h}{2}\right),\ t + h\right) \\ &= f\left(y_t,\ t\right) + h \frac{d}{dt} \left[ f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt}\left[ f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt}f\left(y_t,\ t\right) \right]\right] \end{align} }[/math] where:[math]\displaystyle{ \frac{d}{dt} f(y_t,\ t) = \frac{\partial}{\partial y} f(y_t,\ t) \dot y_t + \frac{\partial}{\partial t} f(y_t,\ t) = f_y(y_t,\ t) \dot y_t + f_t(y_t,\ t) := \ddot y_t }[/math] is the total derivative of [math]\displaystyle{ f }[/math] with respect to time.

If we now express the general formula using what we just derived we obtain:[math]\displaystyle{ \begin{align} y_{t+h} = {} & y_t + h \left\lbrace a \cdot f(y_t,\ t) + b \cdot \left[ f(y_t,\ t) + \frac{h}{2} \frac{d}{dt}f(y_t,\ t) \right] \right.+ \\ & {}+ c \cdot \left[ f(y_t,\ t) + \frac{h}{2} \frac{d}{dt} \left[ f\left(y_t,\ t\right) + \frac{h}{2} \frac{d}{dt}f(y_t,\ t) \right] \right] + \\ &{}+ d \cdot \left[f(y_t,\ t) + h \frac{d}{dt} \left[ f(y_t,\ t) + \frac{h}{2} \frac{d}{dt}\left[ f(y_t,\ t) + \left. \frac{h}{2} \frac{d}{dt}f(y_t,\ t) \right]\right]\right]\right\rbrace + \mathcal{O}(h^5) \\ = {} & y_t + a \cdot h f_t + b \cdot h f_t + b \cdot \frac{h^2}{2} \frac{df_t}{dt} + c \cdot h f_t+ c \cdot \frac{h^2}{2} \frac{df_t}{dt} + \\ &{}+ c \cdot \frac{h^3}{4} \frac{d^2f_t}{dt^2} + d \cdot h f_t + d \cdot h^2 \frac{df_t}{dt} + d \cdot \frac{h^3}{2} \frac{d^2f_t}{dt^2} + d \cdot \frac{h^4}{4} \frac{d^3f_t}{dt^3} + \mathcal{O}(h^5) \end{align} }[/math]

and comparing this with the Taylor series of [math]\displaystyle{ y_{t+h} }[/math] around [math]\displaystyle{ t }[/math]:[math]\displaystyle{ \begin{align} y_{t+h} &= y_t + h \dot y_t + \frac{h^2}{2} \ddot y_t + \frac{h^3}{6} y^{(3)}_t + \frac{h^4}{24} y^{(4)}_t + \mathcal{O}(h^5) = \\ &= y_t + h f(y_t,\ t) + \frac{h^2}{2} \frac{d}{dt}f(y_t,\ t) + \frac{h^3}{6} \frac{d^2}{dt^2}f(y_t,\ t) + \frac{h^4}{24} \frac{d^3}{dt^3}f(y_t,\ t) \end{align} }[/math]

we obtain a system of constraints on the coefficients:

[math]\displaystyle{ \begin{cases} & a + b + c + d = 1 \\[6pt] & \frac{1}{2} b + \frac{1}{2} c + d = \frac{1}{2} \\[6pt] & \frac{1}{4} c + \frac{1}{2} d = \frac{1}{6} \\[6pt] & \frac{1}{4} d = \frac{1}{24} \end{cases} }[/math]

which when solved gives [math]\displaystyle{ a = \frac{1}{6}, b = \frac{1}{3}, c = \frac{1}{3}, d = \frac{1}{6} }[/math] as stated above.

See also

Notes

  1. "Runge-Kutta method" (in en). https://www.dictionary.com/browse/runge-kutta-method. 
  2. DEVRIES, Paul L. ; HASBUN, Javier E. A first course in computational physics. Second edition. Jones and Bartlett Publishers: 2011. p. 215.
  3. Press et al. 2007, p. 908; Süli & Mayers 2003, p. 328
  4. 4.0 4.1 (Atkinson 1989), (Hairer Nørsett), (Kaw Kalu) and (Stoer Bulirsch) leave out the factor h in the definition of the stages. (Ascher Petzold), (Butcher 2008) and (Iserles 1996) use the y values as stages.
  5. 5.0 5.1 Süli & Mayers 2003, p. 328
  6. Press et al. 2007, p. 907
  7. Iserles 1996, p. 38
  8. Iserles 1996, p. 39
  9. Iserles 1996, p. 39
  10. As a counterexample, consider any explicit 2-stage Runge-Kutta scheme with [math]\displaystyle{ b_{1}=b_{2}=1/2 }[/math] and [math]\displaystyle{ c_1 }[/math] and [math]\displaystyle{ a_{21} }[/math] randomly chosen. This method is consistent and (in general) first-order convergent. On the other hand, the 1-stage method with [math]\displaystyle{ b_1=1/2 }[/math] is inconsistent and fails to converge, even though it trivially holds that [math]\displaystyle{ \sum_{j=1}^{i-1} a_{ij} = c_i \text{ for } i=2, \ldots, s. }[/math].
  11. Butcher 2008, p. 187
  12. Butcher 1965, p. 408
  13. Butcher 1985
  14. Butcher 2008, pp. 187–196
  15. Butcher 1965, p. 408
  16. Butcher 1985
  17. Butcher 1964
  18. Butcher 1965, p. 408
  19. Curtis 1970, p. 268
  20. Hairer, Nørsett & Wanner 1993, p. 179
  21. Butcher 1996, p. 247
  22. 22.0 22.1 Süli & Mayers 2003, p. 352
  23. (Hairer Nørsett) refer to (Kutta 1901).
  24. Süli & Mayers 2003, p. 327
  25. Lambert 1991, p. 278
  26. Dormand, J. R.; Prince, P. J. (October 1978). "New Runge–Kutta Algorithms for Numerical Simulation in Dynamical Astronomy". Celestial Mechanics 18 (3): 223–232. doi:10.1007/BF01230162. Bibcode1978CeMec..18..223D. 
  27. Fehlberg, E. (October 1974). Classical seventh-, sixth-, and fifth-order Runge–Kutta–Nyström formulas with stepsize control for general second-order differential equations (Report) (NASA TR R-432 ed.). Marshall Space Flight Center, AL: National Aeronautics and Space Administration. 
  28. Süli & Mayers 2003, pp. 349–351
  29. Iserles 1996, p. 41; Süli & Mayers 2003, pp. 351–352
  30. 30.0 30.1 Süli & Mayers 2003, p. 353
  31. Iserles 1996, pp. 43–44
  32. Iserles 1996, p. 47
  33. Hairer & Wanner 1996, pp. 40–41
  34. Hairer & Wanner 1996, p. 40
  35. 35.0 35.1 Iserles 1996, p. 60
  36. Iserles 1996, pp. 62–63
  37. Iserles 1996, p. 63
  38. This result is due to (Dahlquist 1963).
  39. Lambert 1991, p. 275
  40. Lambert 1991, p. 274
  41. Lyu, Ling-Hsiao (August 2016). "Appendix C. Derivation of the Numerical Integration Formulae". Institute of Space Science, National Central University. http://www.ss.ncu.edu.tw/~lyu/lecture_files_en/lyu_NSSP_Notes/Lyu_NSSP_AppendixC.pdf. 

References

External links