The leapfrog method

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics

Error, Chance and the Machine, Ch Ordinary differential equations: order, stability and stiffness

Problem

The leapfrog method, also called the two-step midpoint rule, is yn+1=yn−1+2hf(tn,yn)y_{n+1} = y_{n-1} + 2hf(t_n, y_n). ((a)) Write down ρ(ζ)\rho(\zeta) and σ(ζ)\sigma(\zeta), check that the method is consistent, and show that it is zero-stable. ((b)) Apply the method to y′=λyy' = \lambda y with z=hλz = h\lambda and look for solutions yn=ζny_n = \zeta^n. Find the characteristic equation and its roots for λ=−10 s−1\lambda = -10\ \mathrm{s^{-1}} and h=0.01 sh = 0.01\ \mathrm{s}, and compare the root that belongs to the exact solution with eze^{z}. ((c)) Rounding errors of relative size u=2−53u = 2^{-53} in the starting values excite both roots. Estimate the number of steps, and the time in seconds, until the error carried by the larger root reaches size 1, and say how large the exact solution is then. ((d)) Show that for every real z≠0z \ne 0 the two roots have different moduli, so that one exceeds 1. Explain how a consistent, zero-stable method of order 2 can fail on every decaying mode y′=λyy' = \lambda y with λ<0\lambda < 0, whatever the step.

Browse the problem library