The theta method for is y_ n+1 = y_n + h [(1 - ) ,f(t_n
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 theta method for y′=f(t,y) isyn+1=yn+h[(1−θ)f(tn,yn)+θf(tn+1,yn+1)],where θ is a constant with 0≤θ≤1. It is Euler's method for θ=0, backward Euler for θ=1 and the trapezoidal rule for θ=21. For an implicit method the local truncation error is defined as in the chapter, with the exact y(tn+1) in place of yn+1 on the right-hand side.
((a)) Show that τ=(21−θ)hy′′+O(h2). For which θ is the method of order 2, and what is the leading term of τ then?
((b)) Apply the method to y′=−y with y(0)=1, all dimensionless. Find the global error (computed minus exact) at t=1 for θ=0, 21 and 1, each with h=0.1 and with h=0.05.
((c)) Estimate the same errors from τ by the accumulation argument of the chapter. Each step commits an error hτ, which lowers the computed value below the exact one by that amount, and an error made at time s is multiplied by e−(t−s) by time t. Compare with (b), and say by what factor each error falls when h is halved.