Numerical ODEs · Definition
Runge-Kutta methods
Before you start you need to know
Euler advances with a single slope evaluation per step, which limits its accuracy. Runge-Kutta improves the approximation by combining several slopes computed at intermediate points.
Definition
Runge-Kutta methods are families of one-step numerical schemes that approximate the solution of an initial value problem by evaluating the function \(f\) at several intermediate points within each step.
An \(s\)-stage Runge-Kutta method is defined by coefficients \(a_{ij}\), \(b_i\) and \(c_i\), with \(k_i=f(t_n+c_ih,\ y_n+h\sum_j a_{ij}k_j)\). If the coefficients satisfy the order conditions, the local error is \(O(h^{p+1})\) and the global error is \(O(h^p)\). The classical fourth-order method uses four stages and is the most widely used in practice.
For \(y'=y\), \(y(0)=1\) and \(h=0.1\), the RK4 method gives \(y_1\approx 1.105171\), very close to \(e^{0.1}\), while Euler gives \(1.1\). This comparison shows how more evaluations per step reduce error without changing \(h\). Stages are computed in order, because in explicit methods each \(k_i\) depends on the previous ones.
A typical mistake is confusing the order of the method with the number of stages, since a four-stage method is not necessarily fourth order. Another common error is using \(y_n\) instead of \(y_n+h\sum a_{ij}k_j\) when evaluating \(k_i\). Checking the order conditions avoids both errors.
Think about it
Why does a four-stage method not automatically have fourth order?
Because the order depends on the conditions satisfied by \(a_{ij}\), \(b_i\) and \(c_i\); the number of stages only sets an upper bound on the achievable order.
Exercises 10
- How many stages does the classical RK4 method have?
- Which Runge-Kutta method coincides with the explicit Euler method?
- What global error order does the RK4 method have?
- In an explicit Runge-Kutta method, what shape does the coefficient matrix \(a_{ij}\) have?
- What is the value of \(c_1\) in any explicit Runge-Kutta method?
- For \(y'=2y\), \(y(0)=1\) and \(h=0.5\), what is \(y_1\) using Euler's method?
- A Runge-Kutta method has \(c_2=1/2\), \(a_{21}=1/2\), \(b_1=0\), \(b_2=1\). What is \(b_1+b_2\)?
- With \(y'=y\), \(y(0)=1\) and \(h=0.2\), what is the slope \(k_1\) in the first step of any explicit Runge-Kutta method?
- For \(y'=t+y\), \(y(0)=1\), what is \(k_1\) in the first step?
- For the midpoint method with \(y'=y\), \(y(0)=1\), \(h=0.2\), what is \(y_1\)? Use \(k_1=f(t_0,y_0)\), \(k_2=f(t_0+h/2,\ y_0+hk_1/2)\), \(y_1=y_0+hk_2\).
References
- Richard L. Burden, J. Douglas Faires, Annette M. Burden, Numerical Analysis, 10th edition, Cengage Learning, 2016.
- Lloyd N. Trefethen, David Bau III, Numerical Linear Algebra, 1st edition, SIAM, 1997.