PHYSICS · Subjective · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Research software practice, verification and validation
Computational Physics, Ch A workspace that can be rerun next year
Problem
Euler's method advances yn+1=yn+Δtf(tn,yn). Apply it to radioactive decay, dy/dt=−λy with λ=1s−1 and y(0)=1, using four step sizes Δt=0.5,0.25,0.125,0.0625s, each chosen so that an integer number of steps N=1/Δt lands exactly on t=1s. For this equation the Euler estimate after N steps is yN=(1−λΔt)N. The exact solution is y(1)=e−1=0.367879 (6 d.p.).
(a) Compute the four errors ∣yN−e−1∣, to 6 decimal places.
(b) Form the three ratios of successive errors (largest step first) and use the smallest-step ratio to estimate the measured order p=log2(ratio).
(c) A convergence-order test asserts that the measured order is 1 to within 15 per cent. Does it pass?