Fun with Pendulums

One equation of motion, five bodies, five drives — and everything that falls out of it.

It started with one pendulum hanging from another. Then the pivot began to move. Then the rods turned into disks, hoops and triangles — and the same two equations kept quietly absorbing all of it. This page is the instrument I built to watch what those equations do.

Every figure below is alive: the pendulums are integrated in real time in your browser, the maps accumulate crossing by crossing, and the whole page retells itself when you pick a different body, drive or parameter set from the switcher.

We derive the one general equation first, then follow it from order into chaos — through Poincaré sections, spectra and Lyapunov exponents. At the end, you can assemble a pendulum of your own.

One equation of motion

In its most general form — whatever the bodies are, whatever the pivot is doing — a double pendulum reduces to one sketch and two generalized coordinates:

x̂p(t) = xₚ x̂ + yₚ ŷŷℓ₁ℓ₂ℓ₃ℓ₄m₁, I₁m₂, I₂θ₁θ₂g
Parameters
the two masses
hinge → COM distances
full body lengths
moments of inertia about COM
pivot path — any smooth curve
angles from vertical
gravity, along +ŷ
Coordinates
Velocities

Kinetic energy of two rigid bodies — translation of each center of mass plus rotation about it. Substituting the velocities and expanding, the cross terms collect via cos θ₁cos θ₂ + sin θ₁sin θ₂ = cos(θ₁−θ₂):

Potential energy is just the heights of the two centers of mass:

Euler–Lagrange, with viscous damping entering as a Rayleigh dissipation function on the right-hand side:

For θ₁ the two ingredients are

Differentiate the first in time and subtract the second: every term containing a bare pivot velocity cancels, and the pivot survives only through ẍₚ, ÿₚ — always in the combinations (g + ÿₚ) sin θᵢ + ẍₚ cos θᵢ. Shaking the pivot is exactly a time-dependent gravity. The same steps for θ₂ give the pair, each with its own damping torque:

The energy decays monotonically — k₁ = k₂ = 0 recovers the conservative pendulum exactly:

The two equations are linear in ; solving the 2×2 system gives the form RK4 integrates (wide — scrolls sideways):

With the pivot at rest, E = T + V is conserved — every analysis below places its initial conditions by fixing E and solving that quadratic for ω₂. From here on everything is numerical: RK4 on the pair above. Each body and drive on this page is one substitution into these same two equations — pick them in the switcher and the whole page retells itself.

Systems of Interest

Pick a body and a drive — every section below retells itself for the selection.

body
drive
selected system

xDriven Double Compound Pendulum

Uniform rods, mass spread along each length. Pivot shaken along x.

Assumptions
com
inertia
body 1
body 2
drive
Parameters

The Poincaré journey

How a swinging pendulum becomes a single dot on a map — and how far that one trick carries. I stamp a lone orbit onto a plane, one dot per swing-through; then I let every start the energy allows stamp the same plane, and a map assembles. As the energy climbs, a single number — the Lyapunov exponent — keeps score while a chaotic sea floods the orderly islands. When the pivot itself begins to shake the recipe breaks, and a stroboscope locked to the drive rebuilds it. By the end, all of those planes stack into one object you can turn in your hands — the whole journey at a glance.

01 · Reading the motion

The section and the exponent

(θ₁, θ₂, ω₁, ω₂) = (0, 0, 1.587, 4.94) · E = 22.56 J
the long run — six starts · one energy · E = 22.56 Jloaded · computed offline with the same integrator

Whatever the switcher above says, this card teaches on the simple double pendulum — a point mass on equal arms — so each reading can build on the last. I hold the pivot perfectly still, which is what lets θ₁ = 0 stand as an honest section: each time the inner arm swings up through the vertical I read off the outer arm's angle and speed and stamp that one pair — one swing-through, one dot — and the run halts a beat at every crossing so you can read the pair as it lands. Every start here lies on that section at one shared energy E, so the first stamp is the start itself; a periodic orbit returns to its handful of points, a quasi-periodic one draws a closed ring, chaos sprays — islands adrift in a sea, all at the very same energy. The lower plane is the long run of all six starts, computed offline with this same integrator and loaded whole, with the start you chose lit.

02 · The sweep

Turning up the energy

Below, that same reading is taken across a whole energy surface at once. Read the big panel like a weather map of the motion: tight nested rings are orbits trapped on their own private surfaces, orderly forever; chains of little islands are resonances where the motion locks into step; and the haze between them is the chaotic sea, where trajectories wander free and λ runs high. As the energy climbs the sea rises and floods the islands one by one — the slider turns that tide up and down.

λ vs E
λ
E →

The cursor rides with the slider — drag either, both move. Where the curve climbs, the sea is winning; where it dips, islands survive.

E = 0.220 J
0.004 J0.40 J

Stack every one of those slices — one section for each energy, threaded up a vertical axis — and the whole journey becomes a single object you can turn in your hands: θ₂ across, ω₂ into the depth, energy climbing upward, and the bright plane is the very slice the slider is reading.

E ↑
slice · f = 0.55
θ₂
ω₂

Every section was a cross-section and the slider was always a height — but this clean stack belongs to a pendulum whose pivot is held still, the one case where energy is conserved and each orbit is pinned to its own floor. Shake the pivot and a single orbit stops resting on one slice and wanders up and down through the stack as the drive trades energy in and out — that wandering object, and the dense high-precision clouds these placeholders stand in for, arrive with the precomputed data.

The instrument panel

Four monitors on one clock: the pendulum, its two angles, the spectrum they carve out, and how fast neighbouring histories tear apart. A short guide to reading each one waits below the panel.

Stage
t = 0.0 s
θ(t) / rad
ω₁ Spectrum / Hz
λ Estimate / s⁻¹
θ₁ / rad
θ₂ / rad
ω₁ / rad·s⁻¹
ω₂ / rad·s⁻¹

Play or reset from the top-left; type or scrub any initial condition. When the pivot is driven, its forcing frequency is marked on the spectrum.

How to read them

Reading the monitors

Stage

Gold is body 1 and blue is body 2 — here and on every figure of this page. The two fading trails follow each body's centre of mass, so a tangled trail means tangled motion. When the pivot is driven, the dashed path at the top is the track the drive makes the pivot ride.

θ(t) / ω(t)

Read the traces against the printed bound — the axis rescales to the motion, so check the number before judging the size. When the bound reads π the angles wrap: a vertical jump is a trace passing ±π, not a glitch. The θ/ω pills switch which pair you watch — angles or angular speeds — and gold and blue name the same two bodies as ever.

Spectrum

The bars ask one question of the chosen signal: which pure tones compose it? One sharp line is periodic motion; two lines at incommensurate frequencies are quasi-periodic — never repeating, yet perfectly orderly; a broadband carpet with no favourite tone is chaos. The violet dashed marker sits at the drive's forcing frequency, so you can tell what the shaking feeds in from what the pendulum does on its own. And the display is an all-time average, so it sharpens the longer you let it run.

λ Estimate

The green line is a running average still settling toward the true λ — give it time. Near zero the motion is regular; above zero it is chaotic, and small errors double every ln 2/λ seconds — the same number the λ strip up in the Poincaré journey measures live with two pendulums. The bigger λ grows, the faster the pendulum forgets where it started.

Build your own pendulum

Pick the bodies, set the drive, choose where it starts — then watch your own system join the gallery.

explore more / build your own →