Fundamentals / Numerical mathematics / Numerical ordinary differential equations

Project · Choose a time integrator from measurements

A velocity sensor monitors an oscillator with one nearly conservative coordinate and one rapidly relaxing auxiliary variable. Design distinct numerical checks for phase, damping and the conditioning of a boundary measurement.

A stable calculation with the wrong period

The ideal oscillator has angular frequency \(2\) s⁻¹. Use an implicit midpoint step of 0.5 s. Derive the discrete rotation angle by acting on the complex scalar \(u'=i\omega u\). Estimate how far the numerical phase lags after 20 s. Compare with the midpoint experiment.

Work through the solution

One step multiplies by \((1+i\omega h/2)/(1-i\omega h/2)\). Its magnitude is one and argument \(2\arctan(0.5)=0.927295\) rad. In forty steps the exact phase advances 40 rad and the computed phase about 37.092 rad. The lag is about 2.91 rad even though the amplitude stays constant. A plot of energy alone cannot certify the period.

Relax a sensor without overdrawing the step budget

The auxiliary measurement follows \(z'=-(z-u)/\tau\), with \(\tau=0.02\) s. During one short window, regard \(u=1\) as constant and start from \(z=0\). Compare forward and backward Euler and the exact value at \(h=0.1\) s. Which qualitative property matters when the measurement represents a bounded response?

Work through the solution

Forward Euler gives \(z_1=5\). Backward Euler gives \(z_1=(z_0+5u)/(1+5)=5/6\). The exact value is \(1-e^{-5}\approx0.99326\). The implicit step is bounded and monotone but its transient error is substantial. Use the split relaxation experiment to distinguish resolving a transient from staying stable after it.

Diagnose a spatial boundary sensor

A separate steady calibration solves \(y''=k^2 y\) on \([0,1]\) with specified endpoint values. Starting a shooting solution with slope error \(\delta s\) at zero and exact starting value, derive the right-end error. Evaluate it at \(k=10\), \(\delta s=10^{-5}\). Why might a global boundary solve help?

Work through the solution

The error solves the homogeneous equation with \(e(0)=0\) and \(e'(0)=\delta s\). Therefore \(e(1)=\delta s\sinh(k)/k\approx0.01101\). A trial slope that looks accurate in isolation gives a visibly wrong right boundary. A collocation matrix imposes both boundaries together; its own error and conditioning still need verification. Compare the two boundary solvers.

Design a reporting table

Name a distinct scalar check for each part of this instrument. State when you would halve the time step and when you would change the mathematical formulation.

Work through the solution

Record accumulated phase at a fixed physical time, range and time-to-90% for the sensor response, and endpoint residual plus interior profile error for the spatial calibration. Halve the time step to test temporal truncation error. Change the boundary solver when initial-slope perturbations dominate the measurement despite a converged integrator.