Elastic (Spring) Pendulum Simulation
Coupled radial and angular oscillations via Lagrangian mechanics — integrated with 4th-order Runge–Kutta. Observe energy transfer, autoparametric resonance, and quasi-periodic orbits.
The elastic pendulum (spring pendulum) is a mass \(m\) on a spring of stiffness \(k\) and natural length \(L_0\), free to both stretch and swing. Using polar coordinates \((r,\theta)\), the Lagrangian is:
\[\mathcal{L} = \dfrac{1}{2}m\!\left(\dot r^2 + r^2\dot\theta^2\right) + mgr\cos\theta - \dfrac{1}{2}k(r-L_0)^2\]
Equations of Motion (with Rayleigh damping \(b\))
\[\ddot r = r\dot\theta^2 + g\cos\theta - \dfrac{k}{m}(r-L_0) - \dfrac{b}{m}\dot r\]
\[\ddot\theta = -\dfrac{2\dot r\dot\theta}{r} - \dfrac{g}{r}\sin\theta - \dfrac{b}{m}\dot\theta\]
Key Phenomena
- Energy transfer: Energy periodically exchanges between radial (spring) and angular (pendulum) modes.
- Autoparametric resonance: When \(\omega_r \approx 2\omega_\theta\), radial motion parametrically excites angular motion.
- Characteristic frequencies: \(\omega_r = \sqrt{k/m}\), \(\omega_\theta = \sqrt{g/L_{\text{eq}}}\) where \(L_{\text{eq}}=L_0+mg/k\).
- Quasi-periodic orbits: Intricate Lissajous-like 2D trajectories when frequencies are incommensurate.
- Chaos: Large amplitudes can produce sensitive dependence on initial conditions.
Numerical Method
The coupled 4D system \((r,\dot r,\theta,\dot\theta)\) is integrated with classical 4th-order Runge–Kutta (RK4) at fixed step \(\Delta t=0.005\,\text{s}\).
How to Use
- Adjust parameters then click Reset to apply.
- Use Pause / Resume to freeze the simulation mid-flight.
- Toggle ☀️ / 🌙 in each canvas header to switch light/dark backgrounds independently.
- Try the Example presets to quickly explore interesting dynamical regimes.
\[\ddot r = r\dot\theta^2 + g\cos\theta - \dfrac{k}{m}(r-L_0),\qquad \ddot\theta = -\dfrac{2\dot r\dot\theta}{r} - \dfrac{g}{r}\sin\theta\]
Parameters & Initial Conditions
System Parameters
Initial Conditions
Simulation
8×
Example Presets
Spring Pendulum
2D Trajectory — color by speed
slow
mid
fast
Displacement vs Time
\(r-L_0\)
\(\theta\)