A common experiment in science education consists of setting a pendulum oscillating and measuring its half-period using an optical gate placed at its equilibrium position. In addition to providing a way to relate the period to the Earth's gravitational field, this experiment highlights one of the anharmonic effects of such an oscillator: the dependence of the period on the initial angle.
The simulation reproduces this experiment virtually, taking air resistance into account through a damping coefficient
Enregistrement.de.l.ecran.2026-10-12.a.17.12.28-compressed.mp4
Keyboard controls
- Tab to stop the pendulum and clear the plotted points
- R to slow down the simulation (for increased precision)
- S to take a screenshot
Mouse controls
- Click and drag the slider to adjust the damping
- Click and drag the pendulum to set its initial state
The pendulum's motion is modeled using the differential equation
where
This differential equation is integrated numerically using the Verlet method, with a time step equivalent to 2 ms in slow-motion mode.