The Kahn Chaotic Pendulum
J. Donald Tillman
May 2020
Some time ago, back in the mid 90s, my family and I were visiting The Exploratorium in San Francisco. A wonderful experience, of course. But while there, I came across the Chaotic Pendulum exhibit. And it made a big impression on me. I ended up staring at the thing for about half an hour. The family was getting concerned.

Chaotic pendulums are usually in the form of a Double Pendulum, one pendulum dangling from another. And while the motion of a single pendulum is simple and predictable, the motion of the double pendulum is chaotic. And while the math behind the single pendulum is simple, the math behind the double pendulum is much more complex.
But this chaotic pendulum is different. It is an elegant work by San Francisco Bay area environmental artist and sculptor Ned Kahn. This is a quadruple pendulum, where a T-shaped bar pivots at the juncture, and three regular pendulums pivot off from its endpoints. The whole thing is encased in an acrylic frame so nobody gets their fingers stuck or heads bonked. And a knob lets the visitor crank the main T-shaped bar.
This simple structure is capable of some remarkable movements. A dance of sorts. Expressing a palette of behaviors.
I thought it would be interesting to simulate Kahn Quadruple Chaotic Pendulum in JavaScript. Please enjoy!
The Simulation
Use the mouse to give it a spin...
(This is a first pass; I'll improve things later. No, I have not compared the dimensions, masses, and time constants of this with the real pendulum. If you'd like to look at the code, it's here. About 6 pages.)
Why is the movement of this device so fascinating?
Normally mechanical devices operate on individual axes. Like on a robot; each servo motor has the responsibility of positioning a particular piece to an intended angle, and it goes about doing that job, meeting that spec, and applying power to get that peice to that angle.
Here there are no servo motors. Instead energy is being transferred between potential energy and kinetic energy, with the total kinetic + potential energy remaining constant. The potential energy is due to the height of the masses. The kinetic energy is due to the speed of the masses.
It turns out that this is very similar to the way human and mobile animals move around. We naturally minimize the energy we use to get a particular task done. And robots typically don't do that.
Derivation
The system is described with four angles, the angular position of the T Bar and the three small pendulums. And the derivatives of those. We'll number them; 0 is the T Bar on top, and 1, 2, and 3 are the smaller pendulums, left to right.
We'll be using the Lagrange approach; calculating the kinetic and potential energies of the system, and finding the accelerations. This is pretty straightforward, but the math is error-prone as all hell, so I'm writing it out here to keep things straight.
Here are the x,y positions of the endpoints of the T Bar:
Calculate the kinetic energy, T, and the potential energy, V, (those are traditional Lagrange variable names) of all four parts, and add them up.
Find the total kinetic energy, T:
Find the total potential energy, V:
Calculate the Lagrange:
Find the partial derivatives of L over the angles:
Find the partial derivatives of L over the angular velocities:
Now, take the time derivative of those:
Now, bring them together, with the double dotted angles on the left and everthing else on the right.
Simplify
Simplify some more
And from here we can use a little matrix math to solve for the four accelerations given the four positions and four velocities.