Pendula

Pendula

Pendula (the plural of pendulum I think, or is it pendulums, I dunno.) Anyway, we've all seen them in clocks, swings, lightbulbs swinging from the ceiling and stuff. They are dead easy to model. There are three bits of information you need to know about a pendulum.

A pendulum consists of two parts; A Mass, and a String, one end of which is fixed. There are two forces acting on the mass; Gravity and the Tension from the string. These two forces combine to make the mass travel on a circular path. For the purpouses of a simple computer simulation of a pendulum, you can assume that the string cannot stretch or compress, and is in effect, a solid bar. Because a pendulum is basically falling, and we all know that everything falls at a constant acceleration, the mass can be ignored too. This leaves the pendulum with the following properties.

Now, let's think how the pendulum behaves. Firstly, it is not simple harmonic motion. The angle of the string does not plot out a sine wave. The current angle of the pendulum changes it's angular momentum. When it is hanging vertically, the tension from the string cancels out the force of gravity, so it does not accelerate. When the string is at right angles to the vertical, it has the heighest acceleration. So, some equations:

And there you have it, nothing could be simpler. Aah, but there is one more thing, damping. Real pendulums do not swing forever. They suffer friction and slow down. To simulate this, one more line can be added:

where Damping is a value slightly less than 1, say 0.99. This will make the system lose energy and eventually slow to a standstill.