🕰️Pendulum Simulator - Exact Period, Phase Space, Double Pendulum Chaos
The simple-pendulum mode integrates the full nonlinear equation θ″ = −(g/L) sin θ − γθ′ with RK4, next to a small-angle pendulum (sin θ ≈ θ) released at the same angle. The larger the swing, the sooner the two drift apart. You get the exact period from the complete elliptic integral, compared with 2π√(L/g), the series approximation and the period measured in the simulation, along with a live phase portrait and kinetic, potential and total energy curves. The double-pendulum mode shows chaos. Add a twin that starts just 0.001° away and within seconds the two are doing completely different things, with their separation growing roughly exponentially on a log plot.
Free · No sign-up · Runs in your browserLast updated:
Loading tool...
How to use Pendulum & Double Pendulum Simulator
- 1Choose the simple or double pendulum, optionally starting from a preset
- 2Set the length, release angle, damping, mass and gravity, or drag a bob on the canvas to set its angle
- 3Press Start and watch the motion, the phase portrait and the energy curves
- 4Read the exact and small-angle periods and the error in the results; in double mode, see when the twins visibly separate
FAQ
- When is T = 2π√(L/g) not accurate?
- That formula comes from the small-angle approximation sin θ ≈ θ. The exact period is T = 4√(L/g)·K(sin(θ₀/2)), where K is the complete elliptic integral of the first kind, and it grows with amplitude. It is about 0.19% longer at 10°, 1.7% at 30°, 7.3% at 60° and 18% at 90°, and it goes to infinity as the release angle approaches 180°. Below about 5° the error is under 0.05%, which is why textbooks call that range "small".
- What do the closed loops in the phase portrait mean?
- The phase portrait plots angle θ against angular velocity ω, so each moment of the motion is a single point. Without damping, energy is conserved and the point keeps tracing the same closed curve. It is an ellipse for small swings and becomes lemon-shaped with sharper ends for large ones. With damping, energy drains away and the curve becomes a spiral into the origin. A chaotic double pendulum's portrait never closes and fills the plane erratically.
- Why is the double pendulum chaotic?
- It has two degrees of freedom and strongly nonlinear equations of motion, and at high enough energy it is extremely sensitive to initial conditions. Two copies that start 0.001° apart separate roughly like e^(λt) in phase space and are completely different within seconds. This isn't numerical error: the equations are deterministic, but any tiny difference gets amplified, so long-term behaviour is unpredictable in practice. At small angles the system is nearly linear, a mix of two normal modes, and is not chaotic.
- What are the normal modes of a double pendulum?
- At small angles the double pendulum can be linearised, and it has two patterns in which everything oscillates at a single frequency. With equal masses and lengths, the in-phase mode has θ₂/θ₁ = √2 and the lower frequency, and the anti-phase mode has θ₂/θ₁ = −√2 and the higher frequency. Any small-angle motion is a combination of the two. Try the in-phase and anti-phase presets to watch the bobs move in perfect lockstep.
- What is the energy drift, and is RK4 accurate enough?
- Without damping the total energy should stay exactly constant, and numerical integration introduces tiny errors. The tool shows how far the current energy has drifted from its starting value. With 1 ms steps for the simple pendulum and 0.5 ms for the double pendulum, the drift typically stays below about 10⁻⁸ after a minute, far too small to see. The divergence of the twin double pendulums comes from chaos itself, not from this error.