Intuition
If two slopes averaged give order two, more slopes, well placed, give more. The classical Runge–Kutta method reads the slope four times in each step: at the start, twice in the middle, and at the end, each reading taken at a point reached with the one before. Their weighted average, with the middle counted twice, is accurate to order four: halve the step and the error falls sixteenfold. For decades it was the method, and it is still the first one to reach for.
Surveying the slope of a field with four readings, two of them checks in the middle, instead of one at the gate: a little more walking, and a far better map.
Three methods with the same step on , . At Euler’s method reaches , Heun’s , and Runge–Kutta, the dots, — against .
Four slopes, weighted
The classical Runge–Kutta method, often called RK4, takes each step with four slopes. is the slope at the start; the slope in the middle of the step, at the point reached with ; the slope in the middle again, at the point reached with ; and the slope at the end, at the point reached with . The step uses their weighted average, with weights over . It evaluates four times per step and is of order four.
What the four slopes buy
- For , with no on the right, and the step is Simpson’s rule for .
Runge–Kutta matches the exponential to fourth order
On y′ = λy every slope is λ times the height it is read at, so each one times h is z = hλ times y_n times a polynomial in z. The second slope is read at (1 + z/2) y_n, the third at (1 + z/2 + z²/4) y_n, the fourth at (1 + z + z²/2 + z³/4) y_n. Weighting them 1, 2, 2, 1 over 6 and stepping multiplies y_n by the first five terms of the series of e^z, which is what the exact solution multiplies by. The first term missed is z⁵/120: a local error of order h⁵, and a global error of order h⁴.
Proof steps
The slope at the start, times h.
Read at .
Read at .
Read at , at the end of the step.
Weight over and collect the powers of : the series of up to .
Applications
Practice
Four Slopes
Start, middle, middle again, end: each slope is read at a point reached with the one before, and the middle two count double.
Try it
A Runge–Kutta step with on , has , , and . What is ? Give four decimal places.
Try it
For , and , what is ?
Try it
For , , and , what is ?
Try it
What weights does the classical Runge–Kutta method give its four slopes?
Try it
The error of the Runge–Kutta method at a fixed point is with step . About what is it with step ?
Try it
How many evaluations of does one step of the classical Runge–Kutta method need?
Try it
For , with no on the right, a Runge–Kutta step is Simpson’s rule for .
Try it
The Runge–Kutta method needs the values from several earlier steps to compute the next one.
Final checkpoint
Try it
On with , one Runge–Kutta step multiplies by with . What is that factor? Give four decimal places.
Try it
To reach an error of about on a smooth problem, why is Runge–Kutta usually cheaper than Euler’s method, although each of its steps costs four times as much?
Try it
The Runge–Kutta method is exact for every equation whose solution is a polynomial.
Completion
Lesson complete
Great work! You now know how to:
- compute the four slopes of a Runge–Kutta step and combine them
- prove that the step matches the exponential to fourth order
- compare the cost and the accuracy of the three methods
- recognise Simpson’s rule inside the method