advanced36 min studyLesson 329 in Mathematics

Symplectic integrators and modified energy

Analyze a structure-preserving oscillator step and distinguish symplectic geometry, exact invariants, and asymptotic modified Hamiltonians.

On this page

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 q′=Hpq'=H_p and p′=−Hqp'=-H_q. 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.

(DΦ)TJ(DΦ)=J,J=(0I−I0)(D\Phi)^T J(D\Phi)=J,\qquad J=\begin{pmatrix}0&I\\-I&0\end{pmatrix}
This canonical condition must hold pointwise for the differentiable map. In dimensions above two, preserving volume alone does not establish it.↔ Scroll wide equations horizontally.

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.

pn+1=pn−hqn,qn+1=qn+hpn+1,Ih(q,p)=12(q2+p2−hqp)p_{n+1}=p_n-hq_n,\quad q_{n+1}=q_n+hp_{n+1},\qquad I_h(q,p)=\frac12(q^2+p^2-hqp)
Direct substitution gives I_h(qₙ₊₁,pₙ₊₁)=I_h(qₙ,pₙ). Positive definiteness requires |h|<2, while the original energy is H=(q²+p²)/2.↔ Scroll wide equations horizontally.

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.

H~=H+hH1+h2H2+⋯\widetilde H=H+hH_1+h^2H_2+\cdots
This is an asymptotic modified Hamiltonian, subject to truncation and regularity assumptions. It should not be read as a universally convergent exactly preserved energy.↔ Scroll wide equations horizontally.

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.

  1. The kick gives p₁=−0.5. The drift uses that new momentum, so q₁=1+0.5(−0.5)=0.75.

  2. 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.

  3. 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.

H(q1,p1)=0.40625,I0.5(q1,p1)=0.5H(q_1,p_1)=0.40625,\qquad I_{0.5}(q_1,p_1)=0.5
The exact invariant includes the cross term determined by the kick-then-drift ordering.↔ Scroll wide equations horizontally.
The result

The symplectic step does not conserve physical energy exactly. It preserves the stated nearby quadratic, while explicit Euler expands oscillator energy.

Explore the model

Interactive lab

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.

An analytic reference for a geometric stepUnit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Current readings: Displacement x(t): 1; Velocity v(t): 0; Regime: underdamped. All parameters are adjustable with the labeled controls below.02.557.510−1.15−0.5700.571.15Time · sDisplacementunderdamped
Displacement x(t)Current time
Displacement x(t)
1
Velocity v(t)
0
Regime
underdamped
t = 0 s

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.

Check your understanding

Which statement about a fixed-step symplectic method is justified in general?

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.

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.