Fundamentals / Numerical mathematics / Numerical ordinary differential equations

Linear response and split flows

Separate errors caused by a changing source from errors caused by composing noncommuting dynamics.

Preserve an input equilibrium

Take \(y'=-8y+12\), \(y(0)=0\), step \(h=0.5\). Compute a first exponential Euler and backward Euler step. Check the equilibrium under both methods and compare their decay multipliers to it.

Worked solution

The equilibrium is 1.5. The exponential step gives \(1.5(1-e^{-4})\approx1.47253\). Backward Euler solves \(5y_1=6\) and gives 1.2.

Starting exactly at 1.5 leaves both methods there. An initial perturbation is multiplied by \(e^{-4}\approx0.01832\) for the first method and \(1/5=0.2\) for the second. Agreement on steady state leaves a sizable difference in transient damping.

Explore the related calculation with adjustable inputs. Change the decay rate and forcing ramp, and compare the exact convolution with a frozen-input step.

A ramp with no decay

Take the limit of exponential Euler for \(y'=t\), starting at \(t=0,y=0\). Compute one step and the exact result. Then apply two half steps and derive the general global error on \([0,T]\) for uniform step \(h=T/N\).

Worked solution

With \(A=0\), \(\varphi_1(0)=1\). Freezing the input at zero gives zero after one step of length \(h\); the exact value is \(h^2/2\). Two half steps instead give

\[0+(h/2)(h/2)=h^2/4.\]

Over the fixed interval the method sums \(h\sum_{j=0}^{N-1}jh=h^2N(N-1)/2\). Subtracting this from \(T^2/2\) gives \(Th/2\). A quadratic local discrepancy has accumulated into a first-order final error.

Explore the related calculation with adjustable inputs. Change the decay rate and forcing ramp, and compare the exact convolution with a frozen-input step.

Reverse the shears

For \(q'=p,\ p'=-q\) start at \((0,1)\), \(h=0.4\). Compute drift–kick, kick–drift and symmetric kick–drift–kick. Compare their momentum to the exact value and identify which two first-order errors have opposite signs.

Worked solution

Drift–kick gives \((0.4,0.84)\); kick–drift gives \((0.4,1)\). The half kick initially has no effect, then the drift gives \(q=0.4\), and the second half kick gives \(p=0.92\).

Exact momentum is \(\cos(0.4)\approx0.921061\). The first two momentum errors are about −0.0811 and +0.0789; the symmetric error is about −0.00106. All three positions agree in this initial state, which makes momentum the more discriminating one-step test.

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.

Notebook practice · An exact decay factor can hide an aliased heat input