The canonical flow
Unit mass and scaled units make the three conservative systems directly comparable. Harmonic frequency and Kepler gravity parameter are one.
M084 · Hamiltonian / numerical geometry
Run Euler, RK4, symplectic Euler and Verlet side by side. Compare long-time phase or orbital fidelity, energy drift, local canonical-map geometry and reversibility; halve the step and confront a rapidly changing Kepler periapsis.
Physics tutorial
BackgroundA numerical method replaces continuous Hamiltonian motion by a discrete canonical map.
Why it mattersGeometric numerical integration studies which structures a discrete method preserves and what that implies over long times.
Start with the essentials
Unit mass and scaled units make the three conservative systems directly comparable. Harmonic frequency and Kepler gravity parameter are one.
Symplectic Euler is first order. The use of updated momentum in the drift distinguishes it from explicit Euler.
Two half-kicks make a second-order reversible map. This does not make the true Hamiltonian exactly conserved or an unresolved periapsis accurate.
The readout reports the largest entrywise defect using central differences. A unit determinant alone is weaker in four dimensions. The Kepler patch is a two-dimensional projection, never a full-volume measurement.
All steps contribute to the maximum energy error; plots retain at most about 600 samples per method. A stable energy trace can hide accumulating phase error. Stopped records have no predicted continuation.
A common logarithmic transform shows tiny and large errors together while retaining the sign of energy drift. Nominal cycles use a reference period of two pi in scaled time. Pendulum references compare 32 and 64 RK4 subdivisions of each coarse step.
Typical misconceptionSmall energy error guarantees a correct orbit.
Better mental modelPhase error can accumulate at nearly conserved energy. Compare the reference state at matching times.
Typical misconceptionA symplectic method conserves the exact Hamiltonian every step.
Better mental modelA resolved fixed-step method often has bounded oscillatory energy error, while the true energy is not exact.
Typical misconceptionPreserving geometry cures a large time step.
Better mental modelThe fast near-center encounter still needs a short step. Halve the step and compare orbital error, not just determinant.
Typical misconceptionThe area of a projected Kepler patch proves symplecticity.
Better mental modelKepler phase space has four dimensions. The full matrix test supplies the relevant local evidence.
Review a full harmonic record and change the selected method.
What to observe: All colors keep the same step; energy growth, drift and bounded oscillation differ.Use the long RK4 record, then halve the fixed step.
What to observe: Both state error and energy drift respond to resolution; high local order is not the only criterion.Compare large-amplitude libration and rotating pendulum presets.
What to observe: The numerical reference is explicitly refined rather than replaced by a harmonic approximation.Compare resolved and unresolved periapsis; inspect the full-map defect and halve the step.
What to observe: A symplectic map can preserve its geometry while producing a poor trajectory.