# ANN: Simple Pendulum Simulation

Jim Hurley jhurley at infostations.com
Sun Oct 30 18:05:18 CST 2005

```>
>A simple simulation of a simple pendulum . . .
>
>
>                                  revOnlin -> User Spaces -> RogerG or
>Education.
>
>
>Cheers, Roger
>

Roger,

Nice job! Good interface.

If you have the inclination, you might want to tackle the large
amplitude pendulum. There is no nice analytic solution but you could
numerically integrate the equation of motion. Something like this:

Let A represent the angle. Then you  would do a numerical integration with

repeat loop
set the location of the pendulum to R,A --using radial coordinates
add c *  sine(A) to the angular velocity -- where c depends on the
mass, L and  g
--The angular acceleration is proportional to  the torque which is
proportional to sine(A)
--For small amplitudes sine(A) = A, in radial coordinates
add the angular velocity to A
end repeat loop

Where I have assumed the time interval between loops is one second,
so that dt =1

It would be interesting to show how the period (determined by the
number of loops between changes in sign of the angular velocity)
depends on the amplitude. Show that the clock slows down as it runs
down, i.e. the period decreases with decreasing amplitude--albeit
slowly; it is a second order effect in the amplitude. That's why
pendulum clocks work so well.

Jim

```