Lagrangian Sandbox
Analytical mechanics in action. Pick a system and its Euler-Lagrange equations, derived from , are integrated by RK4 (the verified shared engine). The left panel animates the mechanism; the right is the phase portrait . 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.
system
gravity g9.81
amplitude1.40
speed1.00
systempendulum
H0
dH/H0
L (ang)-
t0
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.