Euler uses the slope at the start of the step for the whole step. If the slope changes during the step, that estimate is systematically wrong.
Step 1: Let's Learn
Read it, or press Listen and follow the words.
Improved Euler
Take a trial step, look at the slope where you land, and average the two slopes. Then step again with that average.
Runge-Kutta
The standard method samples the slope four times per step and takes a weighted average. It is the workhorse of scientific computing.
Order
Euler is first order, improved Euler second, and the standard Runge-Kutta fourth. Higher order means error falling far faster as the step shrinks.
What that buys
Halving the step in a fourth-order method divides the error by about sixteen. In Euler it only halves.
The trade
Runge-Kutta costs four slope evaluations per step against Euler’s one, and is still far cheaper for a given accuracy.
Sample the slope more than once
Euler uses the slope at the start of the interval only. Improved methods sample it at several points and combine them, which cancels much of the error at modest extra cost.
The improved Euler method
Take a trial step, compute the slope there, and average it with the starting slope. Averaging the two slopes corrects most of the systematic bias and makes the method second-order accurate.
Runge-Kutta
The classical fourth-order method samples four slopes per step and weights them. It is the workhorse of practical computation, accurate enough that step sizes can be comparatively large.
Accuracy against cost
Higher-order methods do more work per step and need far fewer steps for the same accuracy. Adaptive schemes vary the step size automatically, taking small steps only where the solution changes quickly.
Step 2: Try It Yourself
Tap and try it out.
- Released from(2, 0)
Every arrow is perpendicular to the line from the origin, so trajectories circle rather than approach.
Step 3: Watch an Example
One step at a time.
Watch Zeynep Average Two Slopes
Zeynep applies improved Euler to dy/dx = y with y = 1 and a step of 1.
- Step 1
She computes the slope at the start, which is 1.
Step 4: Your Turn
Practice makes it stick.
The Average
Problem 1 of 2
Slopes of 3 and 7 at the two ends of a step. What is their average?
The Cost
Problem 2 of 2
Standard Runge-Kutta. How many slope evaluations does it use per step?
Compare the Methods
1 of 8
Euler's method. How many slope evaluations per step?
2 of 8
Improved Euler. How many slope evaluations per step?
3 of 8
Slopes of 2 and 6. What is their average?
4 of 8
What is the order of Euler's method?
5 of 8
What is the order of the standard Runge-Kutta method?
6 of 8
A fourth-order method with the step halved. By roughly what factor does the error fall?
7 of 8
Sort each method by its order.
Tap something to move it.
- Empty
- Empty
8 of 8
A second-order method with the step halved. By roughly what factor does the error fall?
Step 5: Quick Check
Show what you know.
Question 1 of 2
Slopes of 5 and 9 at the ends of a step. What is their average?
Question 2 of 2
Why do better methods sample the slope more than once per step?
What You Learned
- Euler commits to the starting slope for the whole step, which biases every step the same way.
- Improved Euler averages two slopes; Runge-Kutta weights four.
- Higher order means error falling far faster as the step shrinks, which is worth the extra work.