Intuition
Euler’s method uses the slope at the start of a step as if it held all the way across, and it does not: by the end of the step the slope has changed. Heun’s idea is to take the Euler step only as a trial, read the slope where it lands, and then take the real step with the average of the two slopes. The average is much closer to the true mean slope over the step, and the error falls with the square of the step: halve h and the error is a quarter.
Estimating the average speed of a drive from the speedometer at the start alone, or from the start and the finish. Two readings averaged are far closer to the truth than one, for the price of looking twice.
One step of Heun’s method with on from . The trial Euler step lands at , where the slope is ; averaged with the slope at the start it gives , and the step with that slope ends at — against Euler’s and the solution’s .
Predict, then correct
Heun’s method, also called the improved Euler method: take a trial Euler step, then step again from with the average of the slope at the start and the slope at the trial point. In the integral form, it replaces the integral of the slope over the step by the trapezium rule. Each step evaluates twice, and the method is of order two: its global error is at most a constant times .
Two slopes instead of one
- The trial value is the predictor and the averaged step the corrector; only the corrected value is kept.
- Writing and , the step is .
Heun’s step matches the exponential to second order
On y′ = λy the two slopes can be written out. The slope at the start is λ times y_n; the trial point is (1 + hλ) times y_n, where the slope is λ(1 + hλ) times y_n. Averaging and stepping multiplies y_n by 1 + hλ + (hλ)²/2 — the first three terms of the series of e^{hλ}, which is what the exact solution multiplies by over one step. The first term missed is (hλ)³/6, so the local error is of order h³, and over a number of steps proportional to 1/h the global error is of order h².
Proof steps
The slope at the start of the step.
The trial Euler step.
The slope at the trial point.
Average the two slopes and step.
The exact solution multiplies by : the step agrees up to the term, so the local error is of order .
Applications
Practice
Two Slopes, Averaged
Take a trial Euler step, read the slope where it lands, and step again from the start with the average of the two slopes.
Try it
One step of Heun’s method with on , : what is ?
Try it
One step of Heun’s method with on , : what is ? Give three decimal places.
Try it
With , and , which is Heun’s step?
Try it
If the step of Heun’s method is halved, its error at a fixed point becomes about what?
Try it
For , , Heun’s method gives the exact value at every grid point.
Try it
How many evaluations of the right-hand side does one step of Heun’s method need?
Try it
In Heun’s method the trial Euler value is kept as the new estimate when it is close enough.
Try it
Which slope does the midpoint method use for its step from to ?
Final checkpoint
Try it
Heun’s method has an error of at with . About what error do you expect with ?
Try it
Why is Heun’s step more accurate than Euler’s?
Try it
On , one step of Heun’s method multiplies by with . What is that factor for and ? Give three decimal places.
Completion
Lesson complete
Great work! You now know how to:
- take a step of Heun’s method: predict, then correct
- prove that the step agrees with the exponential to second order
- predict how the error falls when the step is halved
- recognise the midpoint method as the other method of order two