Runge–Kutta–Fehlberg method explained

In mathematics, the Runge–Kutta–Fehlberg method (or Fehlberg method) is an algorithm in numerical analysis for the numerical solution of ordinary differential equations. It was developed by the German mathematician Erwin Fehlberg and is based on the large class of Runge–Kutta methods.

The novelty of Fehlberg's method is that it is an embedded method from the Runge–Kutta family, meaning that identical function evaluations are used in conjunction with each other to create methods of varying order and similar error constants. The method presented in Fehlberg's 1969 paper has been dubbed the RKF45 method, and is a method of order O(h4) with an error estimator of order O(h5).[1] By performing one extra calculation, the error in the solution can be estimated and controlled by using the higher-order embedded method that allows for an adaptive stepsize to be determined automatically.

Butcher tableau for Fehlberg's 4(5) method

Any Runge–Kutta method is uniquely identified by its Butcher tableau. The embedded pair proposed by Fehlberg[2]

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

The first row of coefficients at the bottom of the table gives the fifth-order accurate method, and the second row gives the fourth-order accurate method.

Implementing an RK4(5) Algorithm

The coefficients found by Fehlberg for Formula 1 (derivation with his parameter α2=1/3) are given in the table below, using array indexing of base 1 instead of base 0 to be compatible with most computer languages:

The coefficients in the below table do not work.

K! rowspan="2"
A(K)B(K,L)C(K)CH(K)CT(K)
L=1L=2L=3L=4L=5
101/947/4501/150
22/92/9000
31/31/121/49/2012/25-3/100
43/469/128-243/128135/6416/4532/22516/75
51-17/1227/4-27/516/151/121/301/20
65/665/432-5/1613/164/275/1446/25-6/25
Fehlberg outlines a solution to solving a system of n differential equations of the form:\frac = f_i(x,y_1,y_2, \ldots, y_n), i=1,2,\ldots,nto iterative solve fory_i(x+h), i=1,2,\ldots,nwhere h is an adaptive stepsize to be determined algorithmically:

The solution is the weighted average of six 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.

\begin{align} k1&=hf(x+A(1)h,y)\\ k2&=hf(x+A(2)h,y+B(2,1)k1)\\ k3&=hf(x+A(3)h,y+B(3,1)k1+B(3,2)k2)\\ k4&=hf(x+A(4)h,y+B(4,1)k1+B(4,2)k2+B(4,3)k3)\\ k5&=hf(x+A(5)h,y+B(5,1)k1+B(5,2)k2+B(5,3)k3+B(5,4)k4)\\ k6&=hf(x+A(6)h,y+B(6,1)k1+B(6,2)k2+B(6,3)k3+B(6,4)k4+B(6,5)k5) \end{align}

Then the weighted average is:

y(x+h)=y(x) + CH(1) \cdot k_1 + CH(2) \cdot k_2 + CH(3) \cdot k_3 + CH(4) \cdot k_4 + CH(5) \cdot k_5 + CH(6) \cdot k_6

The estimate of the truncation error is:\mathrm = \left|\mathrm(1) \cdot k_1 + \mathrm(2) \cdot k_2 + \mathrm(3) \cdot k_3 + \mathrm(4) \cdot k_4 + \mathrm(5) \cdot k_5 + \mathrm(6) \cdot k_6\right|

At the completion of the step, a new stepsize is calculated:[3]

h_ = 0.9 \cdot h \cdot \left (\frac \right)^

If \mathrm > \varepsilon, then replace h with h_ and repeat the step. If TE\leqslant\varepsilon, then the step is completed. Replace h with h_ for the next step.

The coefficients found by Fehlberg for Formula 2 (derivation with his parameter α2 = 3/8) are given in the table below, using array indexing of base 1 instead of base 0 to be compatible with most computer languages:

K! rowspan="2"
A(K)B(K,L)C(K)CH(K)CT(K)
L=1L=2L=3L=4L=5
1025/21616/135-1/360
21/41/4000
33/83/329/321408/25656656/12825128/4275
412/131932/2197-7200/21977296/21972197/410428561/564302197/75240
51439/216-83680/513-845/4104-1/5-9/50-1/50
61/2-8/272-3544/25651859/4104-11/402/55-2/55
In another table in Fehlberg, coefficients for an RKF4(5) derived by D. Sarafyan are given:
K! rowspan="2"
A(K)B(K,L)C(K)CH(K)CT(K)
L=1L=2L=3L=4L=5
1001/61/241/8
21/21/2000
31/21/41/42/302/3
410-121/65/481/16
52/37/2710/2701/2727/56-27/56
61/528/625-1/5546/62554/625-378/625125/336-125/336

See also

Notes

  1. According to Hairer et al. (1993, §II.4), the method was originally proposed in Fehlberg (1969); Fehlberg (1970) is an extract of the latter publication.
  2. refer to
  3. Web site: Gurevich . Svetlana . Appendix A Runge-Kutta Methods . Munster Institute for Theoretical Physics . 4 March 2022 . 8–11 . 2017.

References

Further reading