🛰️Ordinary Differential Equations: Initial Value Problems
Systems, Higher-Order ODEs and Geometric Integration
First-order systems, events, Störmer–Verlet and symplectic integration, rigid-body attitude dynamics
Kristiania, 1907
The aurora borealis appears in a ring around the magnetic pole, not over it. Kristian Birkeland, in Norway, had suggested that it is caused by charged particles from the Sun guided by the Earth's magnetic field. His colleague, the mathematician Carl Størmer, set out to compute where such particles actually go.
The equation of motion of a charged particle in a dipole field has no closed-form solution. Størmer integrated it numerically — by hand, with the help of students — computing hundreds of trajectories over years of work. For the integration he used a simple scheme that steps positions directly from the second-order equation using accelerations at the current position, with no velocities at all.
In 1967 the French physicist Loup Verlet, simulating the motion of argon atoms in a computer, used the same formula and found it remarkably well behaved over very long runs. Molecular dynamics adopted it under his name. Only in the 1980s and 1990s did numerical analysts explain why: the method preserves the geometric structure of Hamiltonian mechanics, which almost every other integrator destroys.
Everything is a first-order system. Solvers accept . A second-order equation becomes two first-order ones by introducing the velocity: , . A spacecraft's translational state is six numbers; with attitude (a quaternion) and angular velocity it is thirteen. Write the state vector, write its derivative, and every method of this unit applies unchanged.
📐The large-amplitude pendulum
The small-angle period s holds for small swings only. Integrating the full pendulum with
solve_ivp and an event at each upward zero crossing gives periods of 2.0074 s at 5°, 2.0413 s at 30°, 2.3683 s at 90° and 4.8944 s at 170° — 2.44 times the small-angle value. Events let the solver locate such crossings accurately without a fine output grid.💡Störmer–Verlet
For , with the velocity, one step is a kick–drift–kick:
Second order, one force evaluation per step (the last one is reused), time-reversible — and symplectic: the map it applies to preserves phase-space area exactly, as the true flow of any Hamiltonian system does. A symplectic method exactly conserves a 'shadow' energy that differs from the true one by . So its energy error oscillates but never drifts, over any number of steps.
Derivation
Verlet is the central second difference, and a conserved 'shadow' energy you can check
Störmer's form. Replace by the second difference of lesson 3-3 at step :
The kick–drift–kick form computes exactly this. Its drifts give and , and the two half-kicks around give . Subtract the drifts and substitute: the same formula. It is symmetric in time — swap and and nothing changes — which is part of why it does not drift.
A conserved quantity you can verify. Take the oscillator and the symplectic Euler of lesson 9-1: , then . As a map on it is a matrix,
so it preserves areas in the plane exactly — the defining property of a symplectic map in two dimensions. (Explicit Euler's matrix has determinant : every step inflates areas, and the energy, by that factor.) Expanding the new values shows that
takes exactly the same value after every step. It differs from twice the true energy by a term of order , so the true energy wobbles within a narrow band and can never drift away. Störmer–Verlet has a shadow energy of the same kind, closer to the true one by a further power of .
📐A thousand orbits
An orbit of eccentricity 0.5 with 100 steps per revolution. RK4 — fourth order, four evaluations per step — has relative energy errors of , and after 10, 100 and 1000 orbits: it grows linearly, and the orbit slowly decays. Störmer–Verlet — second order, one evaluation per step — has after 10 orbits and still after 1000. Over short times RK4 is far better; over long times the symplectic method wins, at a quarter of the cost. The orbit's orientation precesses slightly under Verlet, but its size and shape — set by energy and angular momentum — do not decay.
The mathematical difficulties of the theory of rotation arise chiefly from the want of geometrical illustrations and sensible images, by which we might fix the results of analysis in our minds.
💡Rigid-body attitude as a system
A spacecraft with principal moments of inertia and no external torque obeys Euler's equations:
Spin about the axis of least or greatest inertia is stable. Spin about the intermediate axis is not: integrated for two minutes from a 1 rad/s spin with a wobble, the spin component falls to almost zero and reverses sign three times — the body flips end over end, while kinetic energy and angular momentum stay constant to . Cosmonaut Vladimir Dzhanibekov filmed a wing nut doing exactly this aboard Salyut 7 in 1985. Explorer 1, the first US satellite, showed a related instability in 1958: spinning about its long, minimum-inertia axis, it dissipated energy through its flexible antennas and ended up tumbling about the maximum-inertia axis.
Derivation
Euler's equations, and why the middle axis is unstable
Where the equations come from. Without external torque the angular momentum is constant in inertial space. In axes fixed to the body (principal axes), , and a vector constant in space appears to change in rotating axes at the rate :
The first component of is , so ; the other two follow cyclically.
Spin about the middle axis. Let the body spin at rate about axis 2, with a small wobble . To first order in the wobble, stays constant and
Differentiate the first and substitute the second:
With both brackets are negative, so the coefficient is positive: grows exponentially, as with — an eigenvalue with positive real part (lesson 6-1). The same calculation for spin about axis 1 or axis 3 gives a negative coefficient: , a bounded wobble.
💡Where you will use this
Orbital Mechanics: long-term propagation of planetary systems and debris uses symplectic integrators (Wisdom–Holman). Spacecraft Attitude Control: Euler's equations plus quaternion kinematics, with renormalisation or Lie-group integrators to keep the quaternion unit-length. Structural dynamics: the Newmark average-acceleration method is closely related to Störmer–Verlet and conserves energy for linear systems. Molecular and particle simulations: Verlet everywhere.
📚Further reading
- Ernst Hairer, Christian Lubich and Gerhard Wanner, 'Geometric numerical integration illustrated by the Störmer–Verlet method', Acta Numerica 12, 399–450 (2003) — the whole theory of this lesson through one method.
- Benedict Leimkuhler and Sebastian Reich, Simulating Hamiltonian Dynamics (Cambridge University Press, 2004) — symplectic integrators, shadow energies and rigid-body integration.
- Ernst Hairer, Christian Lubich and Gerhard Wanner, Geometric Numerical Integration (2nd ed., Springer, 2006) — the full reference.
↓But there is a problem
Many of the systems in this unit had something in common once linearised: a spacecraft near its target attitude, a structure vibrating by small amounts, an electrical network. Their equations are linear with constant coefficients, — and for those, stepping forward approximately is unnecessary. The exact solution is known: an exponential, of a matrix.
Computing that exponential sounds trivial. In 1978 two numerical analysts published a survey of the ways people did it, and called it Nineteen Dubious Ways.