Reject and retry
A controller compares an Euler–Heun difference of 0.018 m with a scale \(0.002+0.001\max(|y_n|,|y_H|)\) m. The larger state magnitude is 2 m and the attempted step is 0.3 s. Determine acceptance, the next proposed step with safety factor 0.9, and the expected new error ratio if curvature stays constant.
Worked solution
The scale is 0.004 m, so \(E=4.5\), which requires rejection. The proposal is
Since the difference scales quadratically, the expected new ratio is \(4.5(0.1273/0.3)^2\simeq0.81\), assuming the scale stays unchanged.
Recompute both stages from the state and time at the start of the rejected trial. The accepted time remains unchanged until a valid trial has finished.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Bound timing uncertainty
A threshold measurement has absolute state error at most 0.004 and is crossed with speed of magnitude at least 0.2 per second throughout a verified bracket. Bound the time uncertainty due solely to state error. Now compare with a tangential zero \(g(t)=(t-1)^2\) and determine when an apparent residual of 0.004 can occur.
Worked solution
The mean value theorem applied to the monotone crossing gives time uncertainty at most \(0.004/0.2=0.02\) s. Interpolation or time-discretisation errors need their own contributions if they are not already included in the state error.
At the tangency, \(g=0.004\) occurs at \(1\pm\sqrt{0.004}\), about 0.0632 s from the exact event. The event derivative vanishes at the root and the signal has the same sign on both sides, so a standard sign-change trigger can miss it.
Explore the related calculation with adjustable inputs. Decrease the crossing speed in the threshold example and inspect the growth of timing sensitivity.
Check energy separately from phase
Implicit midpoint on the unit oscillator rotates by \(\theta=2\arctan(h/2)\) per step. With \(h=0.2\), evaluate the phase error after 100 steps and compare the exact and numerical energies if both start at \(H=0.5\).
Worked solution
The step angle is \(2\arctan(0.1)=0.1993373\) rad, compared with the physical 0.2 rad. After 100 steps the numerical solution lags by approximately \(0.06627\) rad.
Both energies are 0.5 in exact arithmetic because implicit midpoint preserves this quadratic invariant. Comparing energy histories alone therefore hides a positional error that continues to accumulate with elapsed time.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Accept or retry a nonautonomous Euler step
Use Euler for \(y'=t+y,\ y(0)=1\) over \(h=0.4\). Compare a full step with two half steps, estimate the correction of the finer answer and its extrapolated value. For absolute local tolerance 0.02 and safety factor 0.9, determine the proposed retry step.
Worked solution
The full step gives \(1+0.4=1.4\). The first half step gives 1.2 at time 0.2. Its new slope is \(0.2+1.2=1.4\) and the second half step yields
With \(p=1\) the correction estimate is \(0.08\), so the extrapolated value is 1.56. The exact endpoint \(2e^{0.4}-1.4\approx1.58365\) shows the size of the remaining higher-order contribution.
The estimated fine error magnitude exceeds 0.02. The proposed step is \(0.9(0.4)(0.02/0.08)^{1/2}=0.18\), retried from time zero. Using a slope evaluated at time zero for the second half would skip the explicit time dependence and invalidate the estimate.
Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.
Revisit chapter 5 · Estimate error using one full step and two half steps.