Back

Lagrangian Sandbox

Analytical mechanics in action. Pick a system and its Euler-Lagrange equations, derived from L=TVL=T-V, are integrated by RK4 (the verified shared engine). The left panel animates the mechanism; the right is the phase portrait (q,q˙)(q,\dot q). The readouts are the conserved quantities Noether's theorem guarantees: the Hamiltonian, because the Lagrangian has no explicit time dependence, and the angular momentum whenever the potential is rotationally symmetric, which the Kepler and gravity-free spring obey but the gravity-loaded pendulum does not. Watch the energy readout sit still while a chaotic double pendulum thrashes.

Figure 1. A Lagrangian system animated beside its phase portrait, with the Noether-conserved quantities. Method: closed-form Euler-Lagrange right-hand sides, integrated by the shared RK4 engine.
system
gravity g9.81
amplitude1.40
speed1.00

WHAT TO TRY

  • Switch the system: a simple pendulum, a chaotic double pendulum, a springy elastic pendulum, or a Kepler orbit, each from the same Euler-Lagrange machinery L = T - V integrated by RK4.
  • Watch the energy readout dH/H: the symplectic-quality integrator holds it near zero even for the chaotic double pendulum, the honest check that the dynamics is faithful.
  • Raise gravity g or the amplitude: the motion speeds up and, for the double pendulum, tips from near-regular into full chaos where tiny changes in start completely rewrite the trajectory.