An elastic (spring) pendulum has two degrees of freedom: the spring can stretch by r while the bob also swings through angle θ. Their coupled equations of motion are integrated with 4th-order Runge-Kutta (RK4) rather than simple Euler stepping, so energy stays well-conserved even at large amplitude. Tune the spring constant k so its natural frequency is roughly twice the pendulum's swing frequency and you get autoparametric 2:1 resonance — energy sloshes back and forth between the bounce and the swing instead of staying put.
A bob hangs from a zig-zag spring whose colour shifts between purple and cyan depending on stretch, leaving a fading purple trail. A second phase-plot canvas plots (r − r_eq) against dr/dt, so you can see orbits turn from a clean loop into a scrambled cloud as the system moves from regular to chaotic motion.
Pick a preset — 2:1 Resonance, Gentle Swing, Stiff Spring or Chaotic — or drag the sliders for spring constant k, mass m, natural length L₀, gravity g, damping, initial angle θ₀ and initial stretch. The energy-split bars (Elastic/Swing/Grav) and the ω_spring/ω_pend ratio update live, and Pause/Reset let you freeze or restart the run.
This same 2:1 autoparametric coupling is what makes a Wilberforce pendulum wind and unwind between vertical bouncing and twisting — and it is one of the simplest mechanical systems that can turn fully chaotic even though it has no random forcing at all.
It is a mass hanging from a spring instead of a rigid rod, free to both stretch/compress along the spring (radial coordinate r) and swing through an angle θ. That gives it two coupled degrees of freedom instead of the single angle of a simple pendulum.
When the spring's natural frequency ω_spring = √(k/m) is about twice the pendulum's swing frequency ω_pend = √(g/L_eq), the two motions can trade energy efficiently — a purely vertical bounce will spontaneously start swinging sideways and back again, a phenomenon called autoparametric resonance.
The elastic pendulum's equations are stiff and energy-sensitive; simple Euler integration drifts and adds fake energy over time. Fourth-order Runge-Kutta evaluates the derivatives four times per step and combines them for much better long-term energy conservation, which matters for seeing genuine chaotic behaviour rather than integrator artefacts.
Watch the Regime readout and the phase plot. Large swing angles or an energy split that keeps changing unpredictably (rather than settling into a repeating pattern) push the classifier to report "chaotic," and the phase-plot trace stops tracing a clean closed loop and instead fills in a scrambled cloud.
The Elastic bar sums spring potential energy and radial kinetic energy, the Swing bar is the tangential kinetic energy from the angular motion, and the Grav bar is gravitational potential energy relative to the bob hanging straight down. Watching them rise and fall together is the clearest way to see energy sloshing between the two motions.