Intuition
A step can be too long in two ways. It can be too long for accuracy, and halving it and comparing the two answers shows by how much. And it can be too long for the method to behave at all: on a solution that dies away fast, Euler’s method with a long step overshoots zero, overshoots back further, and the numbers explode while the true solution quietly vanishes. Too short a step has a cost as well: more work, and more rounding in the arithmetic. Good software therefore changes the step as it goes, short where the solution changes quickly and long where it is smooth.
Driving a winding road at night: slow on the bends, faster on the straights. One speed for the whole road is either too slow on the straights or dangerous on the bends.
Euler’s method on , , whose solution dies away at once. With each step halves the value, and that broken line follows the solution down. With each step multiplies by : the values alternate and grow, although every step is computed exactly as the method says.
Accuracy, a limit on the step, and rounding
Three things bound the step. Accuracy: for a method of order the error is about , and running with and with estimates it — for Euler’s method the difference of the two answers is about the error of the finer one. A limit on the step: on , Euler’s method dies away with the solution only when , however little accuracy is wanted. And rounding: every step adds a tiny rounding error, and more steps add more of them, so shrinking further eventually makes the answer worse. Adaptive methods estimate the error of every step and lengthen or shorten the next one to keep it near a tolerance.
Rules of thumb
- Halve and compare: if the answers with and agree to the digits wanted, keep them; if not, halve again.
- For Euler’s method, : the finer answer is off by about the difference of the two answers.
When Euler’s steps die away with the solution
The solution y₀e^{−kx} dies away for every k > 0. Euler’s method multiplies by 1 − hk at every step, so y_n = (1 − hk)ⁿ y₀, which tends to zero exactly when 1 − hk lies strictly between −1 and 1, that is when 0 < hk < 2. With a longer step the factor is below −1: the values alternate in sign and grow without limit, although every step is computed correctly. The limit on h comes from k, not from the accuracy wanted.
Proof steps
One Euler step on .
By induction on .
A geometric sequence with tends to zero exactly when its ratio is less than in size.
Unpack the absolute value: .
Divide by : the step must be shorter than .
Applications
Practice
A Limit on the Step
On y′ = −ky, Euler’s method multiplies by 1 − hk at every step. The values die away with the solution only when that factor lies strictly between −1 and 1.
Try it
Euler’s method is run on . Below what step size do its values tend to zero?
Try it
Euler’s method on with : by what factor is each value multiplied?
Try it
Euler’s method on , with gives which values?
Try it
The only reason to shorten the step of Euler’s method is to gain accuracy.
Try it
Euler’s method gives at with and with . Estimate the error of the answer with .
Try it
Heun’s method, of order two, gives with step and with . What is the best estimate of the exact value?
Try it
On , Euler’s method needs steps shorter than . More than how many steps does crossing then take?
Try it
The solution of , , settles near within a hundredth and then changes slowly. Why is Euler’s method expensive on it?
Final checkpoint
Try it
On a computer, making the step shorter and shorter always makes the answer more accurate.
Try it
What does an adaptive method do?
Try it
Heun’s method on multiplies by with . Up to what value of does that factor stay below ?
Completion
Lesson complete
Great work! You now know how to:
- find the limit on Euler’s step for a solution that dies away
- estimate an error by halving the step
- improve an answer from two step sizes
- explain what adaptive and stiff mean