Oscillations
Mass on a spring
Section titled “Mass on a spring”Pull a block on a spring and let go. It overshoots the middle, slows, comes back, overshoots again: simple harmonic motion. The surprising fact is that the period does not depend on how far you pulled it. A bigger amplitude means a bigger speed through the middle, and the two cancel exactly. Watch kinetic and potential energy trade places in the energy graph while their sum stays flat.
gives with
Maximum speed , maximum force , energy throughout.
The spring is a force with a potential, so its energy appears in the ledger. Velocity Verlet is symplectic: the energy oscillates slightly within a period but never drifts, and the measured period matches the known Verlet dispersion formula to 1e-8 and the textbook period to .
Simple pendulum
Section titled “Simple pendulum”For small swings the pendulum keeps time regardless of amplitude, which is why clocks used them for three centuries. Pull it back far, say 120°, and the period grows noticeably: the restoring force is no longer proportional to the displacement. The playground shows both the small-angle formula and the exact period.
Small angles: . Any amplitude :
with the complete elliptic integral of the first kind, computed by the arithmetic–geometric mean.
The string is a rod constraint solved with RATTLE, which keeps the length exact and the energy drift at 1e-10 over twenty periods. At 2 rad amplitude the period matches the elliptic integral to 1.7e-8 with second-order convergence.