Symplectic integrators and modified energy
Analyze a structure-preserving oscillator step and distinguish symplectic geometry, exact invariants, and asymptotic modified Hamiltonians.
On this page
The question for today
What you’ll understand
- Check a discrete map's canonical symplectic condition.
- Derive an exact modified quadratic invariant for symplectic Euler.
- Explain the limits of energy and long-time claims for general Hamiltonian systems.
A Hamiltonian trajectory carries geometric structure as well as a pointwise solution value. A method can have modest short-time error yet distort that structure in a way that accumulates over many oscillations. Symplectic methods are designed to preserve the canonical two-form of the flow. Their energy behavior is often striking, but symplecticity does not mean exact preservation of the original Hamiltonian. A harmonic-oscillator calculation makes both the benefit and that limitation visible without relying on a vague long-time slogan.
Preserving the canonical form
In canonical coordinates, Hamilton's equations are and . A differentiable discrete map is symplectic when its derivative preserves the canonical skew form. In one degree of freedom this is equivalent to area preservation, but in higher dimensions determinant one is only necessary, not sufficient. The full matrix identity records how position and momentum directions pair. Symplecticity is a property of the update map, not a property inferred from an energy plot.
For a separable Hamiltonian with kinetic and potential terms, a kick in momentum followed by a drift in position gives symplectic Euler. Each substep is the exact flow of one Hamiltonian part, and their composition is symplectic when the step is fixed independently of state. Reversing the substep order gives a related but different first-order method. Symmetric compositions such as Störmer–Verlet can raise the order while preserving the same geometry, provided their actual substeps satisfy the stated structure.
An oscillator has an exactly preserved nearby quadratic
For the unit oscillator, kick momentum by minus h times the old position, then drift position by h times the new momentum. The resulting two-by-two matrix has determinant one. Its trace is two minus h squared, so its eigenvalues lie on the unit circle when the positive step is strictly below two. At the boundary, the repeated eigenvalue can produce growing iterates; above it an unstable reciprocal pair appears. Symplecticity therefore does not remove step restrictions for a particular oscillatory problem.
Substitution into the displayed quadratic verifies an exact invariant for this linear method. That quadratic differs from the physical energy by a cross term proportional to h. It is positive definite for step magnitude below two, giving a direct bound on the oscillator iterates. Physical energy may oscillate rather than remain constant. This is a specific algebraic result for the oscillator, stronger and more precise than simply asserting that every symplectic method conserves energy.
Modified equations are asymptotic explanations
Backward error analysis seeks a modified differential equation whose flow matches a numerical step order by order in h. For symplectic maps near a Hamiltonian flow, the modified vector field can be Hamiltonian under appropriate local assumptions. The resulting modified Hamiltonian is generally a formal asymptotic series, not a convergent expression that the method exactly preserves. Truncation, smoothness, bounded trajectories, and the size of the step relative to the dynamics determine what quantitative conclusions can be justified.
Long-time near-energy results require additional hypotheses and do not guarantee accurate phase forever. State-dependent adaptive step selection can also destroy the symplecticity of a method that is symplectic at fixed h. Prescribing a sequence of state-independent symplectic maps preserves their geometric composition, but a single fixed modified Hamiltonian need not survive that variation. For this lesson, the oscillator's exact quadratic invariant is the concrete guarantee; the general modified-equation picture explains a mechanism rather than supplying an unconditional conservation theorem.
Work it through
Energy changes while the modified invariant stays fixed
Start the unit oscillator at q=1,p=0 and take one kick-then-drift symplectic-Euler step with h=0.5. Compare physical energy, the exact modified invariant, and explicit Euler.
The kick gives p₁=−0.5. The drift uses that new momentum, so q₁=1+0.5(−0.5)=0.75.
Physical energy becomes (0.75²+0.5²)/2=0.40625, while Iₕ=0.40625−(0.5/2)(0.75)(−0.5)=0.5, equal to its starting value.
Explicit Euler instead uses the old momentum in the drift: q₁=1 and p₁=−0.5, giving physical energy 0.625. The exact oscillator has q=cos(0.5), p=−sin(0.5), and physical energy 0.5.
The symplectic step does not conserve physical energy exactly. It preserves the stated nearby quadratic, while explicit Euler expands oscillator energy.
The living notebook
Explore the model
Interactive lab · oscillator
An analytic reference for a geometric step
Pause and Reset, then set damping ζ=0 and natural frequency ω₀=1. Predict displacement and velocity after one Step to time 0.5, and compare the analytic readouts with the manually computed symplectic-Euler pair (0.75,−0.5). Compute the physical energy of each pair.
- Displacement x(t)
- 1
- Velocity v(t)
- 0
- Regime
- underdamped
Unit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forThe analytic pair is approximately (0.87758,−0.47943) with energy 0.5. The instrument is an exact oscillator reference; it does not animate symplectic Euler or display a numerically modified energy.
Pause & reason
Check your understanding
Your turn
Try it yourself
For the same symplectic-Euler oscillator, take h=1 from q=1,p=0 for two steps. Compute physical energy and Iₕ after each step.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Each drift uses the newly kicked momentum. Keep the cross term in Iₕ even when the physical energy changes.
Compare with the solution
The first step gives p₁=−1 and q₁=0, so H₁=1/2 and I₁=1/2. The second kick leaves p₂=−1 because q₁=0, and the drift gives q₂=−1. Thus H₂=(1+1)/2=1, while I₁(q₂,p₂)=(1+1−1)/2=1/2. The physical energy changes, but the exact modified quadratic remains at its initial value.
Keep the idea
Take it with you
- Symplecticity preserves the canonical form rather than automatically preserving the physical energy.
- The oscillator supplies an exact nearby invariant and an explicit step-stability restriction.
- General modified Hamiltonians are asymptotic, and adaptive state-dependent steps need separate geometric analysis.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.