Swing Simulation (2D)

A swing as a damped, pumpable pendulum: angle, phase plane, energy exchange and the exact large-angle period.

Switch to 3D

Presets

Playback

Swing

Rope length, rider mass and start angle.

Air and pumping

Drag removes energy; pumping adds it back.

Layers

Model checks

The science

Swing as a pendulum

A child on a swing is modelled as a point mass m at distance l from the pivot. The angle theta obeys theta'' = -(g/l) sin(theta) - (2 l'/l) theta' - k1 theta' - k2 theta' |theta'|. For small angles the period is T0 = 2 pi sqrt(l/g); for a large angle theta0 the exact period is T = 4 sqrt(l/g) K(sin(theta0/2)) with K the complete elliptic integral, so a high swing is slower than a low one.

Energy

Without air resistance and pumping the sum E = (1/2) m l^2 theta'^2 - m g l cos(theta) is conserved: potential energy at the highest point turns into kinetic energy at the bottom, v = sqrt(2 g l (1 - cos theta0)). Air resistance (a linear plus a quadratic term) removes energy every cycle.

Pumping

The rider stands up (shortens l) while passing the bottom and squats (lengthens l) near the ends, so angular momentum m l^2 theta' is almost conserved while l changes and the swing gains energy. This is a parametric resonance: the pumping frequency is twice the swing frequency, which the rule above produces automatically.

Simplifications

Massless ropes, a point-mass rider, a fixed frame, and a smooth relaxation (time constant 0.15 s) for the rider's stand/squat motion. The drag coefficients are illustrative, not measured for a real child.

What to try
  • Start at 80 degrees without pumping: the measured period is longer than 2 pi sqrt(l/g), and matches the elliptic-integral value.
  • Raise air resistance and watch the phase-plane spiral into the origin.
  • Switch pumping on from a small angle: energy grows until drag balances it.
  • Compare short and long ropes: the period scales with the square root of the length.
Angle versus time
Phase plane (angle, angular velocity)
Energy versus time
Period versus amplitude