next up previous
Next: Implicit Methods Up: No Title Previous: Euler Method for Numerical

Explicit Second Order Methods

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.

eqnarray38

What about accuracy? Proceed by Taylor expansions:

eqnarray49

This last equation agrees with the Taylor expansion through terms of tex2html_wrap_inline465 , so the local truncation error is tex2html_wrap_inline465 . The midpoint method is second order accurate (i.e., the global error is second order).

Trapezodial Use a full Euler step to predict tex2html_wrap_inline469 , and average the slopes (i.e., f) at the current and new times.

eqnarray75

For homework, Due Tuesday, Feb 9

  1. Perform a Taylor expansion as above to determine the accuracy of the Trapezodial rule
  2. Modify your ODE code to also implement the midpoint and trapezodial rules. Compare the three methods and the exact answer for tex2html_wrap_inline471 . In particular, for f=-y, solve up to time T=1 using timesteps tex2html_wrap_inline477 . Compare the errors at time 1 for the three methods. If you plot the last say 2/10 sec., with the scales magnified, you should see clear evidence of the difference between 1st- and 2nd-order convergence.

    You should hand in 5 plots - the three methods using two different values of the timestep, and each method for a sequence of timesteps.



E. Bruce Pitman
Wed Apr 7 10:53:29 EDT 1999