Methods from Numerical solutions
All methods from Numerical solutions.
Euler's method
For the IVP
choose a step size and define
The update uses the tangent line at the left endpoint of each step.
The formula uses the current slope over one short step: the tangent line through has value at . This is the degree-one Taylor model at the current point and Taylor's theorem describes the remainder omitted by one such step.
For an exact starting value , the fundamental theorem of calculus gives
Euler replaces the changing slope inside this integral by . If on the step, then , so this local error is at most .
In an actual computation is already approximate, so errors also propagate from previous steps. If the slope field changes at most proportionally with (the Lipschitz condition) and the solution is smooth on a fixed interval, standard stability estimates bound the largest accumulated error by a constant times as tends to zero. Thus, for a sufficiently small step size and a fixed interval, halving roughly halves Euler's global error. This numerical stability concerns error propagation in the method, not whether solutions of the ODE grow or decay.
- [1]:A visibly large step
- [2]:A smaller step
- [3]:Heun's method
Heun's method
Starting from , first predict the next value with Euler:
Then correct using the average of the slope at the current point and the predicted endpoint:
Where Euler uses only the left-endpoint slope, Heun's method applies the trapezoidal rule to
but the endpoint value is unknown, so the Euler prediction supplies it. Using both slopes makes Heun more accurate at the same step size.
When and the exact solution are sufficiently smooth and the usual Lipschitz and error-stability conditions hold on a fixed interval, Euler has local error and global error , whereas Heun has local error and global error . Thus halving roughly quarters Heun's global error (until round-off or other errors dominate).