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 it reuses the same intermediate calculations to produce two estimates of different accuracy, allowing for automatic error estimation. 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). 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:
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. Note that while Fehlberg's original tables begin indexing at 0, the standard mathematical convention for Runge–Kutta methods established by Butcher uses coefficients denoted as a i j {\displaystyle a_{ij}} with i = 1 , 2 , … , s {\displaystyle i=1,2,\ldots ,s} and j = 1 , 2 , … , s {\displaystyle j=1,2,\ldots ,s} . Therefore, when implementing these methods in programming languages that use 0-based array indexing, there is a shift between the mathematical notation and array indices: what appears as k 1 {\displaystyle k_{1}} in the mathematical formulation corresponds to index 0 in the implementation arrays.
Fehlberg outlines a solution to solving a system of n differential equations of the form:
d y i d x = f i ( x , y 1 , y 2 , … , y n ) , i = 1 , 2 , … , n {\displaystyle {\frac {dy_{i}}{dx}}=f_{i}(x,y_{1},y_{2},\ldots ,y_{n}),i=1,2,\ldots ,n}
to iterative solve for
y i ( x + h ) , i = 1 , 2 , … , n {\displaystyle y_{i}(x+h),i=1,2,\ldots ,n}
where 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 {\textstyle h} , and an estimated slope specified by function f on the right-hand side of the differential equation.
… excerpt ends here. Continue reading the full article.

