Pendulum Simulator: Simple and Double Pendulum with Exact Period
Simulates a simple or double pendulum with a fourth-order Runge-Kutta method, plots the angles over time and reports the period and energy drift.
Use the tool
Why this tool exists
For small swings a pendulum takes 2 pi sqrt(L/g) seconds, but for a 60 degree swing it takes about 7 percent longer. The simple mode shows the small-angle period, the exact period from the arithmetic-geometric mean formula and the period measured from the simulation, which agree to many digits.
The double pendulum mode uses the standard Lagrangian equations of motion, which were checked against an independent derivation with a computer algebra system and a high-order solver. It is chaotic: after ten to twenty seconds tiny changes in the inputs give a different path. The energy drift line shows how well the integrator conserves energy. There is no friction, and the result is a plot, not a live animation.
How to use it
- Choose simple or double.
- Enter lengths, masses, gravity and starting angles.
- Set the duration (up to 120 seconds).
- Read the period or angle plot and the energy drift.
Frequently asked questions
Is there damping?
No, the system is frictionless.
Why does the double pendulum differ for tiny changes?
It is chaotic, so small differences grow quickly.
What is the exact period formula?
T = 2 pi sqrt(L/g) / AGM(1, cos(theta0 / 2)).
Can I watch it move?
No, you get the angle-versus-time plot.