Professional Documents
Culture Documents
Runge-Kutta Methods - Wikipedia, The Free Encyclopedia
Runge-Kutta Methods - Wikipedia, The Free Encyclopedia
org/wiki/Runge–Kutta_methods
Runge–Kutta methods
From Wikipedia, the free encyclopedia
In numerical analysis, the Runge–Kutta methods (German pronunciation: [ˌʁʊŋəˈkʊta]) are an important family
of implicit and explicit iterative methods for the approximation of solutions of ordinary differential
equations. These techniques were developed around 1900 by the German mathematicians C. Runge and
M.W. Kutta.
See the article on numerical ordinary differential equations for more background and other methods. See
also List of Runge–Kutta methods.
Contents
1 The common fourth-order Runge–Kutta method
2 Explicit Runge–Kutta methods
2.1 Examples
3 Usage
4 Adaptive Runge–Kutta methods
5 Implicit Runge–Kutta methods
5.1 Example
6 See also
7 References
8 External links
Then, the RK4 method for this problem is given by the following equations:
Thus, the next value (yn + 1) is determined by the present value (yn) plus the product of the size of the
interval (h) and an estimated slope. The slope is a weighted average of slopes:
1 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
5
The RK4 method is a fourth-order method, meaning that the error per step is on the order of h , while the
4
total accumulated error has order h .
Note that the above formulae are valid for both scalar- and vector-valued functions (i.e., y can be a vector
and f an operator). For example one can integrate Schrödinger's equation using the Hamiltonian operator as
function f.
Also note that if f is independent of y, so that the differential equation is equivalent to a simple integral, then
RK4 is Simpson's rule.
where
(Note: the above equations have different but equivalent definitions in different texts).
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). These data are usually
arranged in a mnemonic device, known as a Butcher tableau (after John C. Butcher):
0
c2 a21
c3 a31 a32
2 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
There are also accompanying requirements if we require 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 2-stage method has order 2 if b1 + b2 = 1, b2c2 = 1/2, and b2a21 = 1/2.
Examples
0
1/2 1/2
1/2 0 1/2
1 0 0 1
1/6 1/3 1/3 1/6
However, the simplest Runge–Kutta method is the (forward) Euler method, given by the formula
yn + 1 = yn + hf(tn,yn). This is the only consistent explicit Runge–Kutta method with one stage. The
corresponding tableau is:
0
1
An example of a second-order method with two stages is provided by the midpoint method
0
1/2 1/2
0 1
Note that this 'midpoint' method is not the optimal RK2 method. An alternative is provided by Heun's
method, where the 1/2's in the tableau above are replaced by 1's and the b's row is [1/2, 1/2].
If one wants to minimize the truncation error, the method below should be used (Atkinson p. 423). Other
important methods are Fehlberg, Cash-Karp and Dormand-Prince. To use unequally spaced intervals
requires an adaptive stepsize method.
Usage
The following is an example usage of a two-stage explicit Runge–Kutta method:
3 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
0
2/3 2/3
1/4 3/4
The tableau above yields the equivalent corresponding equations below defining the method
k1 = f(tn,yn)
t0 = 1
y0 = 1
t1 = 1.025
t2 = 1.05
t3 = 1.075
t4 = 1.1
The numerical solutions correspond to the underlined values. Note that f(ti ,k1) has been calculated to avoid
recalculation in the yi s.
4 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
Runge–Kutta step. This is done by having two methods in the tableau, one with order p and one with order
p − 1.
The lower-order step is given by
where the ki are the same as for the higher order method. Then the error is
p
which is O(h ). The Butcher Tableau for this kind of method is extended to give the values of :
0
c2 a21
c3 a31 a32
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 the Heun 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).
5 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
The approximate solution to the initial value problem reflects the greater number of coefficients:
Due to the fullness of the matrix aij, the evaluation of each ki is now considerably involved and dependent
on the specific function f(t,y). Despite the difficulties, implicit methods are of great importance due to their
high (possibly unconditional) stability, which is especially important in the solution of partial differential
equations. The simplest example of an implicit Runge–Kutta method is the backward Euler method:
It can be difficult to make sense of even this simple implicit method, as seen from the expression for k1:
In this case, the awkward expression above can be simplified by noting that
so that
from which
follows. Though simpler than the "raw" representation before manipulation, this is an implicit relation so that
the actual solution is problem dependent. Multistep implicit methods have been used with success by some
researchers. The combination of stability, higher order accuracy with fewer steps, and stepping that depends
6 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
only on the previous value makes them attractive; however the complicated problem-specific
implementation and the fact that ki must often be approximated iteratively means that they are not common.
Example
Another example for an implicit Runge-Kutta method is the Crank–Nicolson method, also known as the
trapezoid method. Its Butcher Tableau is:
See also
Euler's Method
Runge–Kutta method (SDE)
List of Runge–Kutta methods
numerical ordinary differential equations
Dynamic errors of numerical methods of ODE discretization
References
John C. Butcher (2003). Numerical methods for ordinary differential equations. John Wiley & Sons.
ISBN 0471967580.
George E. Forsythe, Michael A. Malcolm, and Cleve B. Moler (1977). Computer Methods for
Mathematical Computations. Prentice-Hall. (see Chapter 6).
Ernst Hairer, Syvert Paul Nørsett, and Gerhard Wanner (1993). Solving ordinary differential
equations I: Nonstiff problems (2nd ed.). Springer Verlag. ISBN 3-540-56670-8.
William H. Press, Brian P. Flannery, Saul A. Teukolsky, William T. Vetterling (1988). Numerical
Recipes in C. Cambridge University Press. (see Sections 16.1 and 16.2.)
Autar Kaw, Egwu Kalu (2008). Numerical Methods with Applications
(http://numericalmethods.eng.usf.edu/topics/textbook_index.html) (1st ed.). autarkaw.com.
http://numericalmethods.eng.usf.edu/topics/textbook_index.html.
Kendall E. Atkinson (1989). An Introduction to Numerical Analysis. John Wiley & Sons.
F. Cellier, E. Kofman (2006). Continuous System Simulation. Springer Verlag. ISBN 0-387-26102-8.
External links
Runge–Kutta (http://www.krellinst.org/UCES/archive/modules/diffeq/node10.html)
Runge–Kutta 4th Order Method (http://numericalmethods.eng.usf.edu/topics
/runge_kutta_4th_method.html)
Runge Kutta Method for O.D.E.'s (http://math.fullerton.edu/mathews/n2003/RungeKuttaMod.html)
DotNumerics: Ordinary Differential Equations for C# and VB.NET (http://www.dotnumerics.com
/NumericalLibraries/DifferentialEquations/) Initial-value problem for nonstiff and stiff ordinary
differential equations (explicit Runge-Kutta, implicit Runge-Kutta, Gear’s BDF and Adams-Moulton).
GafferOnGames (http://gafferongames.com/game-physics/integration-basics/) A physics resource for
computer programmers.
C language program to implement Runge–Kutta 4th order (http://www.blikbit.com/article/43)
Retrieved from "http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods"
Categories: Numerical differential equations | Runge–Kutta methods
7 of 8 2/15/2011 12:00 PM
Runge–Kutta methods - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Runge–Kutta_methods
8 of 8 2/15/2011 12:00 PM