Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Summary and Synthesis

Making Time Flow | ODE Methods & Conservation | Numerical Methods Module 3 | COMP 521

Module Summary: Your Dynamics Toolkit

This module has given you a complete toolkit for temporal evolution built on understanding fundamental trade-offs:

Part 1 connected Euler’s local approximation to its behavior on an oscillator:

Part 2 showed how Runge-Kutta methods achieve higher accuracy:

Part 3 introduced symplectic integration’s profound insight:

Part 4 analyzed when methods become unstable:

These aren’t separate topics — they’re one framework showing how continuous physics becomes discrete computation while preserving what matters most.

Key Takeaways

Investigation: a stable answer to the wrong question

The oscillator showed that a small energy error can coexist with a growing phase error. Now change the physics. Let uu be a population divided by its initial population and let τ\tau be time divided by its decay timescale:

dudτ=−u,u(0)=1,u(τ)=e−τ.\frac{du}{d\tau}=-u,\qquad u(0)=1,\qquad u(\tau)=e^{-\tau}.

This is a dimensionless model of exponential loss. A physically meaningful solution is nonnegative and decreases monotonically. Conservation of uu would be wrong. The mathematical model itself removes population.

Predict from the update before looking at a trajectory

Euler gives

un+1=(1−h)un.u_{n+1}=(1-h)u_n.

For each candidate step h=0.25h=0.25, 1.5, and 3, predict three separate properties: boundedness, positivity, and accurate decay. Explain your prediction using 1−h1-h, rather than a memorized ranking of method names.

h=0.25: multiplier=+0.75, minimum=+0.0010, final absolute error=1.475e-03
h=1.5: multiplier=-0.50, minimum=-0.5000, final absolute error=6.002e-02
h=3.0: multiplier=-2.00, minimum=-2.0000, final absolute error=3.998e+00
<Figure size 900x400 with 2 Axes>

The panels use different vertical ranges so both the resolved trajectory and the larger failures are readable. This is a comparison of mechanisms, not a visual claim that equal distances on the two panels mean equal errors.

Does an implicit step settle the question?

Backward Euler gives un+1=un/(1+h)u_{n+1}=u_n/(1+h). For every positive hh, it preserves positive decay in this example. At h=3h=3, however, its one-step factor is 1/41/4, whereas the exact factor is e−3≈0.0498e^{-3}\approx0.0498. A stable step can retain much more population than the model predicts. Whether that discrepancy is acceptable depends on the desired observable and accuracy, not the word “implicit.”

This example separates model behavior, numerical stability, and numerical accuracy. We need evidence for all three when they matter to the scientific claim.

Transfer: which conclusion survives the evidence?

Consider these reports without choosing a new method immediately:

ReportWhat it establishesWhat you still need to investigate
“The oscillator energy stays within a narrow band.”An energy diagnostic over the tested durationPhase and state error; refinement at the intended duration
“The population remains bounded.”No growth in the measured magnitude over that runPositivity, the correct decay law, and accuracy
“The solver accepted every step.”Its own error-estimate criterion was metActual error in the observable; sensitivity to tolerances and unresolved features
“The fourth-order method costs four calls per step.”One part of per-step workThe steps needed to meet the same accuracy requirement; rejected work if adaptive

Choose one row and design the smallest additional comparison that could contradict the report’s implied claim. State what each possible outcome would mean. For example, compare oscillator phase at a fixed physical time under refinement; do not merely extend an energy plot and call it a different test.

Looking Forward

The next scientific application should determine the diagnostic. Orbital motion needs phase and trajectory checks as well as conservation. A cooling or reacting system needs the correct dissipative behavior and resolved slow evolution. A Hamiltonian Monte Carlo proposal also needs the sampler’s own acceptance and reversibility arguments; an accurate ODE trajectory alone is not a sampling validation.

These are applications of the numerical ideas, not a revised assignment map. Project 2 remains quadrature; Project 3 introduces root finding and the Star class. The assignment briefs specify deliverables.

Before transferring a solver, record the equations, units, initial state, duration, observable, comparison, and acceptance criterion. Then ask which failure from this module could survive your planned checks.


Quick Reference Tables

Integration Methods Comparison

The energy and area entries below refer to the linear oscillator, except for the decay behavior explicitly identified for backward Euler. They are not universal properties of every system a method could integrate.

MethodOrderEnergy BehaviorPhase SpaceWhen to Use
Euler1Oscillator energy grows exponentiallyOscillator area expandsBaseline; resolved decay problems
RK22Systematic driftNot preservedShort integrations
RK44Slow driftNot preservedModerate accuracy needs
Leapfrog2Bounded oscillator error for 0<hω<20<h\omega<2Symplectic in exact arithmeticResolved separable Hamiltonian systems
Yoshida44Check stability and refinementSymplectic in exact arithmeticSmooth separable Hamiltonian systems
Backward Euler1Artificial oscillator damping; positive scalar decayContracts for oscillator and decay examplesConsider for stiff decay; measure damping error

Timestep selection: restrictions and measurements

SystemWhat restricts the step?What should be measured?
Harmonic oscillatorLeapfrog requires 0<hω<20<h\omega<2; forward Euler has no stable nonzero stepState, energy, and unwrapped phase at fixed duration
Kepler orbitResolve periapsis; no universal fraction of period certifies accuracyOrbital elements, phase, and energy under refinement
Close encounterResolve force variation and encounter timescalesDeflection and energy transfer, with singularity handling stated
Stiff decayForward Euler requires hγ<2h\gamma<2; implicit methods have different dampingSlow solution accuracy and decay of fast transients
Semidiscrete wave equationScheme-dependent CFL restrictionDispersion, dissipation, and spatial plus temporal refinement

Stability regions summary

For the scalar test equation, the entries give the portion of each axis with ∣R(z)∣≤1|R(z)|\le1. Boundary points may fail to damp a decaying mode. The leapfrog row instead describes the two-state oscillator update; its endpoints are excluded because repeated eigenvalues can allow growth.

MethodNegative real axisImaginary axis
Forward Euler[−2,0][-2,0]Only 0
Explicit midpoint RK2[−2,0][-2,0]Only 0
Classical RK4Approximately [−2.785,0][-2.785,0][−i8,i8][-i\sqrt8,i\sqrt8]
Kick–drift–kick leapfrog on an oscillatorNot a scalar decay rule$0<
Backward EulerEntire nonpositive axisEntire axis, with artificial damping away from zero
Implicit midpoint / trapezoidal on the linear test equationEntire nonpositive axisEntire axis; unit amplification

Diagnose before choosing a repair

SymptomCandidate explanationDiscriminating check
Oscillator energy growsNumerical amplification, an implementation error, or a force-law errorCompare the derived one-step energy factor and refine
Orbit spiralsNumerical phase/amplitude error or physical dissipationCheck the equations and an independent trajectory diagnostic
Simulation grows without boundPhysical growth, instability, overflow, or a singularityLocate the first discrepancy and test the applicable step restriction
Very many stepsTight accuracy target, stiffness, unresolved structure, or overheadSeparate function cost from step count and compare relevant timescales
Phase driftsNumerical frequency differsRefine at fixed duration and compare phase; bounded energy is insufficient
NaN valuesInvalid domain, overflow, or instabilityInspect the first non-finite operation

Glossary

A-stable: A method whose scalar linear stability region contains the entire left half-plane. This removes that linear stability step restriction; it does not guarantee accuracy or rapid damping of stiff modes.

Adaptive timestep: Adjusting the step using an error estimate. Ordinary state-dependent adaptation generally does not preserve a fixed-step method’s symplectic structure.

Butcher tableau: Compact notation organizing the coefficients (aᵢⱼ, bᵢ, cᵢ) that define a Runge-Kutta method.

CFL condition: The numerical domain of dependence must contain the physical one. A common explicit bound is h≤CCFLΔx/cmax⁡h\le C_{\rm CFL}\Delta x/c_{\max}; the coefficient depends on the space/time discretization and dimension, and the bound alone is not a sufficient stability proof.

Conjugate momenta: In Hamiltonian mechanics, the momenta p conjugate to generalized coordinates q, related by p = ∂\partialL/∂\partialq̇.

Energy drift: Systematic change in total energy that should be conserved, indicating non-physical behavior of integrator.

Euler’s method: A first-order update using the initial slope. Its suitability depends on the equations, step length, duration, and required accuracy; its oscillator instability is one specific failure.

Global error: Total accumulated error over entire integration interval, typically O(h^p) for method of order p.

Hamiltonian: Function H(q,p,t) representing total energy of system. H = T + V for kinetic T and potential V.

Implicit method: Integration scheme where unknown appears on both sides, requiring an algebraic solution each step. Its stability properties depend on the particular method.

Initial Value Problem (IVP): Finding function x(t) given dx/dt = f(x,t) and x(t₀) = x₀. Fundamental problem of dynamics.

Leapfrog/Verlet: Symplectic integrator that staggers position and momentum updates to preserve symplectic structure in exact arithmetic for the separable Hamiltonian setting described here.

Liouville’s theorem: Phase space volume is preserved under Hamiltonian flow. Symplectic maps preserve canonical volume in exact arithmetic; floating-point implementations add rounding error.

Local truncation error: Error introduced in single step assuming perfect starting values, typically O(hp+1)O(h^{p+1}) for order-pp method.

Modified Hamiltonian: A formal nearby Hamiltonian describing a symplectic map order by order. Suitable truncations explain long-time near-conservation under stated assumptions; the infinite series need not converge.

Order of accuracy: Power pp in global error scaling O(hp)O(h^p). Higher order doesn’t guarantee better long-term behavior.

Phase space: Space of all possible states (q,p)(q,p) of Hamiltonian system. For an autonomous Hamiltonian, trajectories remain on constant-energy surfaces.

Poisson bracket: {f,g}=∂f/∂q⋅∂g/∂p−∂f/∂p⋅∂g/∂q\{f,g\} = \partial f/\partial q \cdot \partial g/\partial p - \partial f/\partial p \cdot \partial g/\partial q. Fundamental operation in Hamiltonian mechanics.

Predictor-corrector: Two-stage integration where initial estimate (predictor) is refined using additional information (corrector).

RK4 (Runge-Kutta 4): Classical fourth-order method using weighted average of four derivative evaluations whose update reduces to Simpson quadrature for a time-only right-hand side.

Stability function: R(z)R(z) relating consecutive values yn+1=R(hλ)yny_{n+1} = R(h\lambda)y_n for test equation y′=λyy' = \lambda y.

Stability region: Set of complex values z=hλz = h\lambda where ∣R(z)∣≤1|R(z)| \leq 1, ensuring bounded numerical solutions.

Stiff equation: An ODE for which an explicit method’s stability requirement forces much smaller steps than accuracy requires over the interval of interest. Multiple separated modes are one common mechanism, not a requirement.

Symplectic integrator: Numerical method preserving symplectic structure (including canonical phase-space volume, but not necessarily time reversibility) of Hamiltonian systems.

Symplectic structure: Geometric structure of phase space preserved by Hamiltonian flow, characterized by 2-form ω=dq∧dp\omega = dq \wedge dp.

Time reversibility: Property where integrating forward then backward returns exactly to start. Holds for symmetric methods in exact arithmetic; symplecticity alone is insufficient.

Yoshida coefficients: Special timestep ratios w0w_0, w1w_1 involving 21/32^{1/3} that achieve fourth-order accuracy while maintaining symplecticity.


A useful numerical conclusion states the observable, the measured error or comparison, and the conditions under which the evidence applies. The methods in this module give you ways to build that conclusion and ways to challenge it.