The
Runge-Kutta methods are a family of
numerical analysis techniques used for the approximation of solutions of
ordinary differential equations. They were developed around 1900 by the mathematicians
C. Runge[?] and
M.W. Kutta[?]. The fourth-order formulation ("RK4") is the most commonly used, since it provides substantial accuracy without excessive complexity.
If y' = f(t,y) is a differential equation and its value at some initial time is specified by y(t_{0}) = y_{0}, then the RK4 method is given by the following equation:
- <math> y_{k+1} = y_k + {h \over 6} \left[ k_1 + 2k_2 + 2k_3 + k_4 \right] </math>
where
- <math> k_1 = f \left( t_n, y_n \right) </math>
- <math> k_2 = f \left( t_n + {h \over 2}, y_n + {h \over 2} k_1 \right) </math>
- <math> k_3 = f \left( t_n + {h \over 2}, y_n + {h \over 2} k_2 \right) </math>
- <math> k_4 = f \left( t_n + h, y_n + hk_3 \right) </math>
Thus, the next value (y_{n+1}) is determined by the present value (y_{n}) plus the product of the size of the interval (h) and an estimated slope. The slope is a weighted average of slopes:
- k_{1} is the slope at the beginning of the interval;
- k_{2} is the slope at the midpoint of the interval, using slope k_{1} to determine the value of y at the point t_{n} + h/2 using Euler's formula;
- k_{3} is again the slope at the midpoint, but now using the slope k_{2} to determine the y-value;
- k_{4} is the slope at the end of the interval, with its y-value determined using k_{3}.
When the four slopes are averaged, more weight is given to the slopes at the midpoint:
- <math>\mbox{slope} = \frac{k_1 + 2k_2 + 2k_3 + k_4}{6}</math>
Iterative methods in general may be represented by the generic form y_{n+1} = cy_{n}, where c is a coefficient that depends upon the method used and the equation being evaluated. The primary reason that the RK4 method is successful is that the coefficient c that it produces is almost always a very good approximation to the actual value. Indeed, the RK4 method has a total accumulated error of O(h^{4}).
All Wikipedia text
is available under the
terms of the GNU Free Documentation License