Skip to main content

29  Numerical Methods for Ordinary Differential Equations

A differential equation gives the rate of change of a state. To compute a trajectory, we must turn that rate into a finite step. We begin with the simplest construction, then distinguish the error made in one step from the error accumulated over an interval.

Accuracy as the step size tends to zero does not settle how large a step we can use. A numerical solution can grow even when the exact solution decays. We study this restriction through a scalar test equation, then consider higher-order methods and the behavior of oscillating mechanical systems.

29.1 Initial Value Problems and Well-Posedness

NoteDefinition: Initial Value Problem

An initial value problem (IVP) for a system of ordinary differential equations has the form \[ \begin{align} \by'(t) = \boldsymbol{f}(t, \by(t)), \qquad \by(t_0) = \by_0, \end{align} \] where \(t \in [t_0, T]\) and \(\by(t) \in \fR^m\). The function \(\boldsymbol{f}: [t_0, T] \times \fR^m \to \fR^m\) is the vector field.

NoteExample

For \(y'=-y\) and \(y(0)=1\), the exact solution is \(y(t)=e^{-t}\). At time \(t_n\), the derivative suggests the linear approximation \(y(t_n+h)\approx y(t_n)+hy'(t_n)\). Replacing the exact value by the current approximation gives \[ \begin{align} y_{n+1}=y_n-hy_n=(1-h)y_n. \end{align} \] This is forward Euler. Repeating the step gives \(y_n=(1-h)^n\). We can already ask two different questions: does it approach \(e^{-t_n}\) as \(h\) decreases, and does it decay for a fixed \(h\)?

WarningExercise

Compute four Euler steps with \(h=1/2\) and compare with \(e^{-2}\). Repeat with \(h=2\) and \(h=3\). When does the numerical sequence alternate in sign? When does its magnitude grow? Explain why the differential equation itself has none of this growth.

Before analyzing a method, we need an exact solution to compare it with. The next theorem gives a sufficient existence and uniqueness condition. Its global Lipschitz assumption is stronger than the local assumptions often used in ODE theory, but guarantees a solution throughout the stated finite interval.

NoteTheorem: Picard–Lindelöf Existence and Uniqueness

Let \(\boldsymbol{f}(t, \by)\) be continuous in \(t\) and uniformly Lipschitz continuous in \(\by\) on the domain \([t_0, T] \times \fR^m\): \[ \begin{align} \|\boldsymbol{f}(t, \bu) - \boldsymbol{f}(t, \bv)\| \leq L \|\bu - \bv\| \qquad \text{for all } \bu, \bv \in \fR^m, \end{align} \] where \(L < \infty\) is the Lipschitz constant. Then the IVP has a unique continuous solution \(\by(t)\) on \([t_0, T]\).

Integrate the differential equation to obtain \[ \begin{align} \by(t)=\by_0+\int_{t_0}^t\boldsymbol f(s,\by(s))\,ds. \end{align} \] On an interval of length \(\Delta\) with \(L\Delta<1\), define \(\mathcal T\bu\) by the right-hand side with \(\bu\) in the integrand. In the supremum norm, \[ \begin{align} \|\mathcal T\bu-\mathcal T\bv\|_\infty \leq L\Delta\,\|\bu-\bv\|_\infty. \end{align} \] Thus applying \(\mathcal T\) repeatedly contracts differences by the factor \(L\Delta\). Choose any initial continuous function \(\bu_0\) and define \(\bu_{j+1}=\mathcal T\bu_j\). With \(q=L\Delta<1\), the contraction estimate implies \[ \begin{align} \|\bu_{j+1}-\bu_j\|_\infty\leq q^j\|\bu_1-\bu_0\|_\infty. \end{align} \] For \(r\geq1\), the triangle inequality gives \[ \begin{align} \|\bu_{j+r}-\bu_j\|_\infty \leq\sum_{l=j}^{j+r-1}q^l\|\bu_1-\bu_0\|_\infty \leq\frac{q^j}{1-q}\|\bu_1-\bu_0\|_\infty. \end{align} \] This tends to zero independently of \(r\). Completeness of the space of continuous functions in the supremum norm gives a uniform limit \(\by\).

Starting with a continuous function, the successive differences are bounded by a geometric series. The iterates converge uniformly to a continuous function. Uniform convergence and the Lipschitz estimate bound the difference of the integrands uniformly by \(L\|\bu_j-\by\|_\infty\). The difference of their integrals is therefore at most \(L\Delta\|\bu_j-\by\|_\infty\), which tends to zero. Hence passing to the limit in the integral gives a fixed point and hence a solution. If there were two fixed points, the same inequality would force their distance to be zero.

Use the endpoint value as initial data on the next interval of length at most \(\Delta\). The global Lipschitz assumption gives the same contraction factor on every interval. Finitely many intervals cover \([t_0,T]\) and give the unique solution. If \(L=0\), the map is independent of its argument and the conclusion follows directly.

The integral of the continuous function \(\boldsymbol f(s,\by(s))\) is continuously differentiable by the fundamental theorem of calculus. Thus the fixed point satisfies the original differential equation, not just its integral version. The finite-interval continuation is valid because the Lipschitz condition is global in the state variable.

WarningExercise

Let \(q=L\Delta<1\) and \(\bu_{j+1}=\mathcal T\bu_j\). Prove \(\|\bu_{j+1}-\bu_j\|_\infty\leq q^j\|\bu_1-\bu_0\|_\infty\) and bound \(\|\bu_{j+r}-\bu_j\|_\infty\) by the tail of a geometric series. Explain how this establishes convergence and why the limit satisfies the integral equation. This is the contraction argument used in the proof.

29.2 Time-Stepping Methods

The exact increment satisfies \(\by(t_{n+1})-\by(t_n)=\int_{t_n}^{t_{n+1}}\boldsymbol f(t,\by(t))\,dt\). Approximating this integral by its left endpoint, right endpoint, or trapezoidal rule gives three basic methods. The right-endpoint methods contain the unknown new state on both sides, so each step requires solving equations.

NoteDefinition: Forward Euler, Backward Euler, and Trapezoidal Methods

For time step \(h = t_{n+1} - t_n\):

  1. Forward Euler (explicit): \(\by_{n+1} = \by_n + h \boldsymbol{f}(t_n, \by_n)\).

  2. Backward Euler (implicit): \(\by_{n+1} = \by_n + h \boldsymbol{f}(t_{n+1}, \by_{n+1})\).

  3. Trapezoidal Rule (implicit Crank–Nicolson): \[ \begin{align} \by_{n+1} = \by_n + \frac{h}{2} \left[ \boldsymbol{f}(t_n, \by_n) + \boldsymbol{f}(t_{n+1}, \by_{n+1}) \right]. \end{align} \]

29.3 Consistency, Stability, and the Discrete Gronwall Lemma

A numerical time-stepping method is convergent if the computed trajectory approaches the exact trajectory as the step size \(h \to 0\). We quantify error at each step and track its accumulation over a finite time interval.

NoteDefinition: Local Truncation Error and One-Step Defect

Let \(\by_{n+1} = \Phi_h(t_n, \by_n)\) denote an autonomous or non-autonomous one-step method. The local truncation error is the defect of the exact solution: \[ \begin{align} \boldsymbol{\tau}_{n+1} = \frac{\by(t_{n+1}) - \Phi_h(t_n, \by(t_n))}{h}. \end{align} \] The method is consistent of order \(p\) if \(\|\boldsymbol{\tau}_{n+1}\| = O(h^p)\) as \(h \to 0\) for all sufficiently smooth solutions.

There are two common error conventions. The unnormalized one-step defect is the numerator in this definition and is \(h\boldsymbol\tau_{n+1}\). Our local truncation error divides it by \(h\). For forward Euler, Taylor expansion gives a defect of order \(h^2\) and a local truncation error of order \(h\). Both statements describe the same calculation.

NoteLemma: Discrete Gronwall Lemma

Let \(\{e_n\}_{n=0}^N\) be a sequence of non-negative real numbers satisfying the linear recurrence \[ \begin{align} e_{n+1} \leq (1 + \alpha) e_n + \beta, \qquad n = 0, 1, ..., N-1, \end{align} \] where \(\alpha, \beta \geq 0\). For \(\alpha>0\), \[ \begin{align} e_n \leq e^{n \alpha} e_0 + \beta \frac{e^{n \alpha} - 1}{\alpha}. \end{align} \] For \(\alpha=0\), the corresponding bound is \(e_n\leq e_0+n\beta\).

First let \(\alpha>0\). Apply the recurrence twice to see the pattern: \[ \begin{align} e_1&\leq(1+\alpha)e_0+\beta,\\ e_2&\leq(1+\alpha)^2e_0+\beta[(1+\alpha)+1]. \end{align} \] Induction gives \[ \begin{align} e_n\leq(1+\alpha)^ne_0+\beta\sum_{j=0}^{n-1}(1+\alpha)^j. \end{align} \] Indeed, multiplying the bound at step \(n\) by \(1+\alpha\) shifts all powers up by one, and adding \(\beta\) supplies the missing power zero. This is exactly the same formula for \(n+1\).

The finite geometric sum is \([(1+\alpha)^n-1]/\alpha\), because its ratio differs from one by \(\alpha\). The elementary inequality \(1+\alpha\leq e^\alpha\) implies \((1+\alpha)^n\leq e^{n\alpha}\). Since \(e_0,\beta\) are nonnegative, replacing the powers by this upper bound preserves the inequality: \[ \begin{align} e_n\leq e^{n\alpha}e_0+\beta\frac{e^{n\alpha}-1}{\alpha}. \end{align} \] For \(\alpha=0\), no division by \(\alpha\) is allowed. The recurrence reduces to \(e_{n+1}\leq e_n+\beta\). Applying it \(n\) times gives \(e_n\leq e_0+n\beta\). Thus the separate zero case agrees with the limiting formula.

NoteTheorem: Fundamental Theorem of One-Step Convergence

Let \(\Phi_h\) be a consistent one-step method of order \(p\) applied to an IVP whose vector field \(\boldsymbol{f}\) is Lipschitz continuous with constant \(L\). Suppose the numerical increment function satisfies \(\|\Phi_h(t, \bu) - \Phi_h(t, \bv)\| \leq (1 + \Lambda h) \|\bu - \bv\|\) for some constant \(\Lambda \geq 0\). Then on the fixed interval \([t_0, T]\) with \(Nh = T - t_0\), the global error \(\be_n = \by(t_n) - \by_n\) satisfies \[ \begin{align} \max_{0 \leq n \leq N} \|\be_n\| \leq e^{\Lambda(T - t_0)} \|\be_0\| + \frac{e^{\Lambda(T - t_0)} - 1}{\Lambda} \max_k \|\boldsymbol{\tau}_k\|, \end{align} \] where the quotient is interpreted as \(T-t_0\) when \(\Lambda=0\). Consequently, when the numerical and exact solutions use the same initial value, a one-step defect of order \(O(h^{p+1})\) yields a global error of order \(O(h^p)\).

Express the error at step \(n+1\) by subtracting the numerical update from the exact solution: \[ \begin{align} \be_{n+1} &= \by(t_{n+1}) - \by_{n+1} \\ &= \left[ \Phi_h(t_n, \by(t_n)) + h \boldsymbol{\tau}_{n+1} \right] - \Phi_h(t_n, \by_n) \\ &= \left[ \Phi_h(t_n, \by(t_n)) - \Phi_h(t_n, \by_n) \right] + h \boldsymbol{\tau}_{n+1}. \end{align} \] Taking norms and applying the triangle inequality yields \[ \begin{align} \|\be_{n+1}\| \leq (1 + \Lambda h) \|\be_n\| + h \max_k \|\boldsymbol{\tau}_k\|. \end{align} \] The first bracket compares two numerical steps starting from different states. The second term is the defect of a step starting from the exact state. Keeping these contributions separate explains why one is controlled by the step map’s Lipschitz constant and the other by consistency.

Applying the Discrete Gronwall Lemma (the referenced result) with \(\alpha = \Lambda h\) and \(\beta = h \max_k \|\boldsymbol{\tau}_k\|\) gives \[ \begin{align} \|\be_n\| \leq e^{n \Lambda h} \|\be_0\| + h \max_k \|\boldsymbol{\tau}_k\| \frac{e^{n \Lambda h} - 1}{\Lambda h} = e^{\Lambda(t_n - t_0)} \|\be_0\| + \frac{e^{\Lambda(t_n - t_0)} - 1}{\Lambda} \max_k \|\boldsymbol{\tau}_k\|. \end{align} \] Since \(t_n - t_0 \leq T - t_0\) and \(\max_k \|\boldsymbol{\tau}_k\| = O(h^p)\), the global error is bounded by \(O(h^p)\) when initial data are exact (\(\be_0 = \bzero\)).

If \(\Lambda=0\), use the zero-parameter case of the lemma directly: after \(n\) steps the added defect is at most \(nh\max_k\|\boldsymbol\tau_k\|\leq(T-t_0)\max_k\|\boldsymbol\tau_k\|\). This justifies the quotient convention without dividing by zero. For fixed \(T-t_0\), the exponential constants do not change as \(h\to0\), so a uniform \(O(h^p)\) local truncation bound gives the stated global order.

29.4 Euler Methods and Stability Functions

NoteTheorem: Stability Functions for Linear Test Equations

Applied to the Dahlquist test equation \(y' = \lambda y\) with \(z = h\lambda \in \fC\), the numerical update satisfies \(y_{n+1} = R(z) y_n\). The stability functions are: \[ \begin{align} R_{\mathrm{FE}}(z) = 1 + z, \qquad R_{\mathrm{BE}}(z) = \frac{1}{1 - z}, \qquad R_{\mathrm{TR}}(z) = \frac{1 + z/2}{1 - z/2}. \end{align} \] The region of absolute stability is \(\mathcal{S} = \{z \in \fC : |R(z)| \leq 1\}\). Backward Euler and the Trapezoidal Rule are A-stable: \(\fC^- = \{z \in \fC : \operatorname{Re}(z) \leq 0\} \subseteq \mathcal{S}\). Backward Euler is additionally L-stable: \(\lim_{z \to -\infty} R_{\mathrm{BE}}(z) = 0\).

Let \(z=h\lambda\). Forward Euler substitutes the old value into the derivative: \[ \begin{align} y_{n+1}=y_n+h\lambda y_n=(1+z)y_n. \end{align} \] Thus its multiplier is \(R_{\rm FE}(z)=1+z\).

For backward Euler, the derivative uses the new value. Move its term to the left before dividing: \[ \begin{align} y_{n+1}=y_n+zy_{n+1},\qquad (1-z)y_{n+1}=y_n. \end{align} \] Whenever \(1-z\neq0\), the multiplier is \(1/(1-z)\). Similarly the trapezoidal update gives \[ \begin{align} y_{n+1}=y_n+\tfrac z2(y_n+y_{n+1}),\qquad (1-z/2)y_{n+1}=(1+z/2)y_n, \end{align} \] so its multiplier is \((1+z/2)/(1-z/2)\) when defined.

To prove the stability assertions, write \(z=x+iy\) with \(x\leq0\). Then \[ \begin{align} |1-z|^2=(1-x)^2+y^2\geq1. \end{align} \] The denominator of backward Euler is therefore nonzero and \(|R_{\rm BE}(z)|\leq1\). For the trapezoidal rule, \[ \begin{align} |1-z/2|^2-|1+z/2|^2 &=[(1-x/2)^2+(y/2)^2]\\ &\quad-[(1+x/2)^2+(y/2)^2]=-2x\geq0. \end{align} \] Its denominator is also nonzero on this half-plane, so \(|R_{\rm TR}(z)|\leq1\). This proves A-stability for both implicit methods.

Along the negative real axis, \(1/(1-z)\to0\) as \(z\to-\infty\), whereas the trapezoidal multiplier tends to \(-1\) after dividing numerator and denominator by \(z\). Thus backward Euler has the additional L-stability property and the trapezoidal rule does not. See Hairer et al. (1993) for these stability notions.

WarningExercise

Derive \(R_{\mathrm{TR}}(z)\) from the trapezoidal update. Write \(z=x+iy\) and compute \(|1-z/2|^2-|1+z/2|^2\). Use its sign to prove A-stability and to locate the points where \(|R_{\mathrm{TR}}(z)|=1\). Take the limit along the negative real axis to show that the method is not L-stable. Finally, apply both implicit methods to \(y'=-1000y\) with \(h=0.1\). Compare their first three values with the exact decay. Preservation of the magnitude of an oscillation does not imply exact phase: determine the trapezoidal phase change when \(z=i\omega h\).

29.5 Runge–Kutta Methods

Runge–Kutta methods achieve high orders of accuracy without storing historical steps by evaluating intermediate stages within each time step.

WarningExercise

A first improvement on Euler is to estimate the derivative halfway through the step. Form the provisional value \(\by_{n+1/2}=\by_n+(h/2)\boldsymbol f(\by_n)\) and then set \(\by_{n+1}=\by_n+h\boldsymbol f(\by_{n+1/2})\). For a smooth autonomous vector field, expand this update to order \(h^2\) and compare it with the exact Taylor expansion. What is its one-step defect? This two-stage construction illustrates why intermediate stages can improve the order.

NoteDefinition: Classical Fourth-Order Runge–Kutta Method (RK4)

For an autonomous ODE \(\by' = \boldsymbol{f}(\by)\), the classical RK4 method computes four stages: \[ \begin{align} \boldsymbol{k}_1 &= \boldsymbol{f}(\by_n), \\ \boldsymbol{k}_2 &= \boldsymbol{f}\left( \by_n + \frac{h}{2}\boldsymbol{k}_1 \right), \\ \boldsymbol{k}_3 &= \boldsymbol{f}\left( \by_n + \frac{h}{2}\boldsymbol{k}_2 \right), \\ \boldsymbol{k}_4 &= \boldsymbol{f}\left( \by_n + h\boldsymbol{k}_3 \right), \end{align} \] and sets the update \[ \begin{align} \by_{n+1} = \by_n + \frac{h}{6} \left( \boldsymbol{k}_1 + 2\boldsymbol{k}_2 + 2\boldsymbol{k}_3 + \boldsymbol{k}_4 \right). \end{align} \] The one-step defect is \(O(h^5)\). With the normalization in the referenced result, the local truncation error and the global error are both \(O(h^4)\).

NoteTheorem: RK4 Stability Polynomial

Applied to the scalar linear test equation \(y' = \lambda y\), the stability function of RK4 is \[ \begin{align} R(z) = 1 + z + \frac{z^2}{2} + \frac{z^3}{6} + \frac{z^4}{24} = \sum_{k=0}^4 \frac{z^k}{k!}, \qquad z = h\lambda. \end{align} \]

WarningExercise

Substitute \(f(y)=\lambda y\) into the four stages. Express each stage as \(\lambda y_n\) times a polynomial in \(z=h\lambda\), and collect terms in the update. Why does matching the exponential on this scalar test problem alone not prove order four for a nonlinear ODE?

29.6 Symplectic Integrators and Geometric Mechanics

For the oscillator \(q'=v\), \(v'=-q\), the exact energy \(H=(q^2+v^2)/2\) is constant. Forward Euler instead multiplies this energy by \(1+h^2\) at every step. A small local error can therefore accumulate into a qualitatively wrong orbit over many periods. We now construct an update from simple motions that preserve the geometry of position and momentum. The matrix identity below defines precisely the property called symplecticity.

NoteDefinition: Velocity Verlet Algorithm

For a potential \(V\) with continuous second derivatives and a separable Hamiltonian \(H(\bq, \bv) = \frac{1}{2}\|\bv\|_2^2 + V(\bq)\) with equations of motion \(\bq' = \bv\) and \(\bv' = \bF(\bq) = -\nabla V(\bq)\), the Velocity Verlet method is: \[ \begin{align} \bv_{n+1/2} &= \bv_n + \frac{h}{2} \bF(\bq_n), \\ \bq_{n+1} &= \bq_n + h \bv_{n+1/2}, \\ \bv_{n+1} &= \bv_{n+1/2} + \frac{h}{2} \bF(\bq_{n+1}). \end{align} \]

Velocity Verlet first changes velocity with position held fixed, then changes position with velocity held fixed, and finally completes the velocity change. In one position dimension these are shears of the \((q,v)\) plane. Each preserves area. In higher dimensions, symplecticity requires the stronger matrix identity \(\bJ^T\boldsymbol\Omega\bJ=\boldsymbol\Omega\), where \(\boldsymbol\Omega\) pairs positions with their corresponding momenta. Volume preservation alone would not establish it.

NoteTheorem: Symplecticity and Area Preservation of Velocity Verlet

The one-step Velocity Verlet map \(\Psi_h: (\bq_n, \bv_n) \mapsto (\bq_{n+1}, \bv_{n+1})\) preserves the canonical symplectic structure. In particular, the Jacobian matrix \(\bJ = \frac{\partial(\bq_{n+1}, \bv_{n+1})}{\partial(\bq_n, \bv_n)}\) satisfies \[ \begin{align} \det(\bJ) = 1. \end{align} \] The full symplectic assertion is that its Jacobian satisfies \(\bJ^T\boldsymbol{\Omega}\bJ=\boldsymbol{\Omega}\) for the canonical symplectic matrix \(\boldsymbol{\Omega}\). Symplecticity implies \(\det(\bJ)=1\), so Velocity Verlet also preserves phase-space volume.

Decompose the Velocity Verlet step into the composition of three elementary shears: \[ \begin{align} \Psi_h = \psi_3 \circ \psi_2 \circ \psi_1, \end{align} \] where: \[ \begin{align} \psi_1(\bq, \bv) &= \left( \bq,\, \bv + \frac{h}{2}\bF(\bq) \right), \\ \psi_2(\bq, \bv) &= (\bq + h\bv,\, \bv), \\ \psi_3(\bq, \bv) &= \left( \bq,\, \bv + \frac{h}{2}\bF(\bq) \right). \end{align} \] Evaluating the Jacobian of each shear map: \[ \begin{align} \bJ_1 = \begin{pmatrix} \bI & \bzero \\ \frac{h}{2}\nabla\bF(\bq) & \bI \end{pmatrix}, \qquad \bJ_2 = \begin{pmatrix} \bI & h\bI \\ \bzero & \bI \end{pmatrix}, \qquad \bJ_3 = \begin{pmatrix} \bI & \bzero \\ \frac{h}{2}\nabla\bF(\bq_{n+1}) & \bI \end{pmatrix}. \end{align} \] Here \(\nabla\bF\) denotes the Jacobian of the force, the matrix of its first partial derivatives. Since the force is the negative gradient of a potential with continuous second derivatives, that Jacobian is the negative Hessian of \(V\). Equality of mixed partial derivatives makes it symmetric. This symmetry is essential for the symplectic calculation.

Because \(\bF=-\nabla V\), the Hessian block \(\bS = \frac{h}{2}\nabla\bF = -\frac{h}{2}\nabla^2V\) is symmetric (\(\bS^T = \bS\)). With canonical symplectic matrix \(\boldsymbol{\Omega} = \begin{pmatrix} \bzero & \bI \\ -\bI & \bzero \end{pmatrix}\), evaluating the quadratic form for \(\bJ_1\): \[ \begin{align} \bJ_1^T \boldsymbol{\Omega} \bJ_1 &= \begin{pmatrix} \bI & \bS \\ \bzero & \bI \end{pmatrix} \begin{pmatrix} \bzero & \bI \\ -\bI & \bzero \end{pmatrix} \begin{pmatrix} \bI & \bzero \\ \bS & \bI \end{pmatrix} \\ &= \begin{pmatrix} -\bS & \bI \\ -\bI & \bzero \end{pmatrix} \begin{pmatrix} \bI & \bzero \\ \bS & \bI \end{pmatrix} = \begin{pmatrix} -\bS + \bS & \bI \\ -\bI & \bzero \end{pmatrix} = \boldsymbol{\Omega}. \end{align} \] Similarly, for the translation shear \(\bJ_2\): \[ \begin{align} \bJ_2^T \boldsymbol{\Omega} \bJ_2 &= \begin{pmatrix} \bI & \bzero \\ h\bI & \bI \end{pmatrix} \begin{pmatrix} \bzero & \bI \\ -\bI & \bzero \end{pmatrix} \begin{pmatrix} \bI & h\bI \\ \bzero & \bI \end{pmatrix} \\ &= \begin{pmatrix} \bzero & \bI \\ -\bI & h\bI \end{pmatrix} \begin{pmatrix} \bI & h\bI \\ \bzero & \bI \end{pmatrix} = \begin{pmatrix} \bzero & \bI \\ -\bI & -h\bI + h\bI \end{pmatrix} = \boldsymbol{\Omega}. \end{align} \] The third shear \(\bJ_3\) has the same form as \(\bJ_1\) and satisfies \(\bJ_3^T \boldsymbol{\Omega} \bJ_3 = \boldsymbol{\Omega}\). The canonical matrix \(\boldsymbol\Omega\) records the pairing of each position coordinate with its corresponding momentum coordinate. The displayed calculations verify the full symplectic matrix identity for each individual shear, rather than checking its determinant alone.

By the chain rule, \(\bJ = \bJ_3 \bJ_2 \bJ_1\), so \[ \begin{align} \bJ^T \boldsymbol{\Omega} \bJ = \bJ_1^T \bJ_2^T \left( \bJ_3^T \boldsymbol{\Omega} \bJ_3 \right) \bJ_2 \bJ_1 = \bJ_1^T \left( \bJ_2^T \boldsymbol{\Omega} \bJ_2 \right) \bJ_1 = \bJ_1^T \boldsymbol{\Omega} \bJ_1 = \boldsymbol{\Omega}. \end{align} \] Each shear has unit determinant: \(\det(\bJ_1) = \det(\bJ_2) = \det(\bJ_3) = 1\). Therefore \[ \begin{align} \det(\bJ) = \det(\bJ_3)\det(\bJ_2)\det(\bJ_1) = 1 \cdot 1 \cdot 1 = 1. \end{align} \]

The product in the chain rule evaluates each Jacobian at the corresponding intermediate state. The identity for each factor holds at every such state, so the cancellations remain valid even for nonlinear forces. A unit determinant follows separately from their triangular block forms. This establishes both claims in the theorem.

WarningExercise

Symplectic geometry of the harmonic oscillator. Consider the harmonic oscillator \(q' = v\), \(v' = -q\) with exact energy \(E(q, v) = \frac{1}{2}(q^2 + v^2)\).

  1. Compute the one-step update matrix \(\mathbf{M}_{\mathrm{FE}}\) for Forward Euler and show that \(\det(\mathbf{M}_{\mathrm{FE}}) = 1 + h^2 > 1\).

  2. Compute the one-step update matrix \(\mathbf{M}_{\mathrm{Verlet}}\) for Velocity Verlet. Confirm that \(\det(\mathbf{M}_{\mathrm{Verlet}}) = 1\).

  3. For \(0<h<2\), show that Velocity Verlet conserves the positive definite quadratic form \(\tilde{H}(q, v) = \frac{1}{2}(q^2 + v^2) - \frac{h^2}{8}q^2 = H(q, v) + O(h^2)\).

29.7 Further Exercises

WarningExercise

The discrete Gronwall lemma and Forward Euler convergence.

  1. Let \(\by(t)\) solve \(\by' = \boldsymbol{f}(t, \by)\) with \(\|\boldsymbol{f}(t, \bu) - \boldsymbol{f}(t, \bv)\| \leq L\|\bu - \bv\|\). Use Taylor’s theorem to show that the one-step defect of Forward Euler satisfies \(\|\by(t_{n+1}) - (\by(t_n) + h\boldsymbol{f}(t_n, \by(t_n)))\| \leq \frac{h^2}{2} M_2\), where \(M_2 = \max \|\by''(t)\|\).

  2. Derive the error recurrence \(\|\be_{n+1}\| \leq (1 + Lh)\|\be_n\| + \frac{h^2}{2}M_2\).

  3. Apply the referenced result to establish the rigorous global error bound \(\|\be_n\| \leq \frac{M_2}{2L}(e^{L(t_n - t_0)} - 1)h\).

WarningExercise

Adaptive step size control via embedded Runge–Kutta pairs.

  1. An embedded pair computes a lower-order approximation \(\by_{n+1}^{[p]}\) and a higher-order approximation \(\by_{n+1}^{[p+1]}\) sharing stages. Show that the difference \(\be_{n+1} = \by_{n+1}^{[p+1]} - \by_{n+1}^{[p]}\) satisfies \(\|\be_{n+1}\| = C h^{p+1} + O(h^{p+2})\).

  2. Given error tolerance \(\varepsilon\) and current step size \(h_{\mathrm{old}}\), derive the optimal step size formula \(h_{\mathrm{new}} = s h_{\mathrm{old}} (\varepsilon / \|\be_{n+1}\|)^{1/(p+1)}\) with safety factor \(s \in (0, 1)\).

  3. Explain why adaptive solvers reject a step and repeat with smaller \(h\) when \(\|\be_{n+1}\| > \varepsilon\), and why an implementation may cap the growth factor, for example by \(h_{\mathrm{new}}\leq5h_{\mathrm{old}}\). Explain why the numerical cap is a design choice.

WarningExercise

Stiffness in chemical cascades and BDF methods. Consider the singularly perturbed initial value problem \(\varepsilon y' = -y + \cos(t)\) with \(y(0) = 0\) and \(\varepsilon = 10^{-4}\).

  1. Find the exact solution and identify the fast boundary layer transient \(e^{-t/\varepsilon}\) and the slow quasi-steady state \(\cos(t) + \varepsilon \sin(t)\).

  2. Explain why explicit RK4 requires \(h \lesssim 2.8 \times 10^{-4}\) throughout the entire simulation, even after the transient has decayed to zero.

  3. Formulate the BDF2 update \(\frac{3\by_{n+1} - 4\by_n + \by_{n-1}}{2h} = \boldsymbol{f}(t_{n+1}, \by_{n+1})\) and show that it allows time steps \(h = 0.1\) in the smooth regime.

NoteFurther reading

Hairer, N{}rsett, and Wanner give a careful account of ODE methods and their analysis (Hairer et al. 1993). Dahlquist’s paper is the classical source for the stability barrier for linear multistep methods (Dahlquist 1963). Quarteroni, Sacco, and Saleri provide a broader numerical-analysis reference (Quarteroni et al. 2007).