Oscillations
Mass on a spring
Section titled “Mass on a spring”Pull a block on a spring and let go. It overshoots the middle, slows, comes back, overshoots again: simple harmonic motion. The surprising fact is that the period does not depend on how far you pulled it. A bigger amplitude means a bigger speed through the middle, and the two cancel exactly. Watch kinetic and potential energy trade places in the energy graph while their sum stays flat.
gives with
Maximum speed , maximum force , energy throughout.
The spring is a force with a potential, so its energy appears in the ledger. Velocity Verlet is symplectic: the energy oscillates slightly within a period but never drifts, and the measured period matches the known Verlet dispersion formula to 1e-8 and the textbook period to .
Simple pendulum
Section titled “Simple pendulum”For small swings the pendulum keeps time regardless of amplitude, which is why clocks used them for three centuries. Pull it back far, say 120°, and the period grows noticeably: the restoring force is no longer proportional to the displacement. The playground shows both the small-angle formula and the exact period.
Small angles: . Any amplitude :
with the complete elliptic integral of the first kind, computed by the arithmetic–geometric mean.
The string is a rod constraint solved with RATTLE, which keeps the length exact and the energy drift at 1e-10 over twenty periods. At 2 rad amplitude the period matches the elliptic integral to 1.7e-8 with second-order convergence.
Damped oscillator
Section titled “Damped oscillator”Real oscillators run down. Here the block feels a drag that grows with its speed, like a hand moving through water. Each swing is a fixed fraction smaller than the one before, so the amplitude halves again and again in equal times.
Turn the damping up and the swings die faster and come very slightly less often. Turn it up far enough and the block does not swing at all: it creeps back to rest. The boundary between the two is called critical damping, and it is what a good door closer is tuned to.
. With and , the block oscillates when :
The swing halves every seconds.
A force that depends on velocity makes the last half of each step implicit; the engine solves it by a few fixed-point iterations, which keeps the scheme second order. The block follows the closed form to 1e-5 m over six seconds, and the energy ledger shows every joule the spring loses arriving in “dissipated”.
Driven oscillator and resonance
Section titled “Driven oscillator and resonance”Now something pushes the block back and forth in a steady rhythm. At first the motion is a muddle of the block’s own rhythm and the push’s. The block’s own part dies away, as in the damped oscillator, and what is left keeps time with the push, not with the spring.
How far it swings depends on how close the push’s rhythm is to the block’s own. Slide the driving frequency towards the natural frequency and the swing grows several times larger for the same force. That is resonance: a child on a swing, a wine glass and a singer, a bridge and marching feet.
. Once the start has died away,
The amplitude is largest at , a little below the natural frequency, and the lighter the damping the taller and narrower the peak.
The scene runs for six decay times and then five steady cycles, so the swing measured at the end is the steady one; it matches the formula to 2e-3 at driving frequencies below, near and above resonance. In the energy ledger the push appears as work done and the drag as dissipated, and in the steady state the two grow at the same rate.
Coupled oscillators
Section titled “Coupled oscillators”Two identical blocks, each on its own spring, joined by a weaker spring between them. Pull one aside and let go. It swings, but each swing tugs the other through the middle spring, and little by little the motion drains across: the first block comes to rest while the second swings at full size. Then it all drains back.
There are exactly two ways to start them where this does not happen. Pull both the same way and the middle spring never stretches, so each swings as if alone. Pull them apart by equal amounts and they mirror each other for ever, a little faster, because the middle spring now helps. Every other motion is a mixture of these two. Drag the two knobs to try all three.
With outer springs and a middle spring , the two normal modes are
Starting one block at and the other at rest gives both modes equally:
a fast swing inside a slow envelope. The motion has crossed over completely after .
Nothing about modes is built in: there are three springs and two blocks on a track. Started together or against each other, each block follows a single cosine to 2e-5 m over six seconds; started with one alone it follows the sum of the two to 5e-5 m over two full exchanges. The energy tab shows the total staying put while it moves between the blocks.
A mass on a vertical spring
Section titled “A mass on a vertical spring”Hang a mass on a spring and let go from where the spring is relaxed. It drops, overshoots, and bobs up and down about a point lower than where it started: the place it would hang at rest, where the spring’s pull equals its weight.
Gravity moves the middle of the swing down. It does nothing else. The period is exactly what the same mass and spring have on a level table, and it does not depend on : the same spring bobs at the same rate on the Moon.
At rest, , so . Measured from there, with , the weight cancels:
Released from the relaxed length the mass swings a distance either side, so its lowest point is below the release.
One spring force and gravity, on a body kept on a vertical line. The lowest point, the period and the greatest speed all match to a part in 100 000. The energy tab shows three things trading: kinetic, the spring’s potential and gravity’s.
Springs in series
Section titled “Springs in series”Join two springs end to end and pull. Each one stretches, and the stretches add, so the pair gives more than either alone: together they are softer than the softer of the two. The softer spring does most of the stretching.
Each spring carries the full force, because one pulls on the other. That is the rule for anything joined end to end.
Both feel the same force , so , and the total stretch is :
Two spring forces with a small body where they join. The textbook’s join has no mass; here it has a five-hundredth of the block’s, which lengthens the period by about a part in a thousand. It starts where the two springs already pull equally, so it has nothing to shake about.
Springs in parallel
Section titled “Springs in parallel”Fix two springs side by side to the same block and pull. Now they must stretch by the same amount, and each pulls back, so their pulls add: together they are stiffer than the stiffer of the two. The stiffer spring does most of the pulling.
Compare the period here with the one in series, with the same two springs and the same block. Stiffer means faster.
Both stretch by the same , so the forces are and :
Two spring forces on one block, held level so that the stiffer one, pulling harder on its side, cannot turn it. The period matches to a part in 100 000.