In order to get better formal accuracy, we need to include more terms in the taylor expansion. This is more difficult than it sounds, however. We do not know the r.h.s function before the fact (the way we do in integration). So we resort to guessing the solution -to some accuracy- by using the ODE, and using this prediction to formulate a correction step. The two most common two-step, predictor-correct methods are the midpoint rule (or modified Euler) and the trapezodial rule (or improved Euler). These names come from the analogous integration methods.
Midpoint Use an Euler step for half a timestep. Then use this mid-time predictor for y in the r.h.s of a corrector step.
What about accuracy? Proceed by Taylor expansions:
This last equation agrees with the Taylor expansion through terms of
,
so the local truncation error is
. The midpoint method is
second order accurate (i.e., the global error is second order).
Trapezodial Use a full Euler step to predict
, and average the
slopes (i.e., f) at the current and new times.
For homework, Due Tuesday, Feb 9
You should hand in 5 plots - the three methods using two different values of the timestep, and each method for a sequence of timesteps.