Why does a swing stop on its own — and why does pushing on the beat make it grow?
A pendulum left alone slows down and stops. The same pendulum, pushed at exactly the right rhythm, swings higher and higher until it loops the bar. Same hardware. Two opposite outcomes. The single equation that governs both — and every cousin of them, from car suspensions to laser cavities to bridges that fell down — has three terms: an inertia, a restoring force, and a velocity-dependent
Damping decides how it stops. Resonance decides when a push wins.
The equation that runs every oscillator
A mass on a spring obeys Newton’s law: . The net force has three pieces. The spring pulls back proportional to displacement: .
where and . The same equation describes a small-angle pendulum (), an LC electrical circuit (), a building swaying in wind, a guitar string, an atom’s electron cloud responding to light. Different physics, identical mathematics — one of the most-reused equations in all of physics.
Free decay — three ways to stop
Set (no external push), displace the mass, and let go. The derivatives on the left side compete with the restoring term on the right, and the answer depends on how big is compared to :
- Underdamped (γ < ω₀): the mass oscillates while shrinking — exponential envelope times a sinusoid. The widget at weak damping shows this — the trace ripples downward to zero.
- Critical damping (): the fastest return to rest with no oscillation. Car shock absorbers and door closers are tuned exactly here — anything less swings, anything more crawls.
- Overdamped (γ > ω₀): the mass crawls back to rest more slowly than critical. Useful when you want no oscillation guaranteed, even at the cost of speed (precision instruments, certain control systems).
The widget’s free-decay traces (forcing toggle off) make these three regimes immediate: same equation, three different shapes of “stop.” Mathematically, they’re all governed by the characteristic equation — the discriminant is positive, zero, or negative, and that’s what you’re looking at.
import numpy as np
# Equation: ẍ + 2γ·ẋ + ω₀²·x = F·cos(ω·t)
# Three free-decay regimes (F = 0), determined by γ vs ω₀.
omega0 = 1.0
def simulate(gamma, omega_drive=0.0, F=0.0, T=30, dt=0.05, x0=1, v0=0):
"""RK4 integration of the damped driven oscillator."""
n = int(T / dt) + 1
t = np.zeros(n); x = np.zeros(n); v = np.zeros(n)
x[0], v[0] = x0, v0
accel = lambda x_, v_, t_: (-2*gamma*v_ - omega0**2*x_
+ F*np.cos(omega_drive*t_))
for i in range(1, n):
t[i] = i * dt
k1x, k1v = v[i-1], accel(x[i-1], v[i-1], t[i-1])
k2x = v[i-1] + dt/2 * k1v
k2v = accel(x[i-1] + dt/2 * k1x, v[i-1] + dt/2 * k1v, t[i-1] + dt/2)
k3x = v[i-1] + dt/2 * k2v
k3v = accel(x[i-1] + dt/2 * k2x, v[i-1] + dt/2 * k2v, t[i-1] + dt/2)
k4x = v[i-1] + dt * k3v
k4v = accel(x[i-1] + dt * k3x, v[i-1] + dt * k3v, t[i])
x[i] = x[i-1] + dt/6 * (k1x + 2*k2x + 2*k3x + k4x)
v[i] = v[i-1] + dt/6 * (k1v + 2*k2v + 2*k3v + k4v)
return t, x
# Three free-decay regimes from displaced start (x=1, v=0):
[(name, simulate(gamma=g)[1][-1]) for name, g in
(("undamped", 0.0), ("under-damped", 0.1),
("critical", 1.0), ("over-damped", 2.0))]
# undamped: final x oscillates near ±1 (no decay)
# under: final x near 0 after many cycles, but visibly oscillates
# critical: final x essentially 0, no oscillation (fastest return)
# over: final x slightly above 0, slow exponential returnWhy the equation works at all — small-angle linearization
The small-angle pendulum lives on a lie — the linearization trick from the pendulum-clock page. The true equation has , which is nonlinear; replacing for small swings turns it into the linear oscillator above. Real damped oscillators that work in everyday engineering live almost entirely in this regime: car suspensions deflect a few centimeters, building columns flex by parts per thousand, microphone diaphragms move microns. They obey the linear equation because they live where the lie holds.
When the lie breaks — wide-angle pendulums, soft non-Hookean springs, large electrical signals near a transistor’s saturation, a building swaying past its elastic limit — the linear formulas become wrong, sometimes spectacularly. The 1940 Tacoma Narrows bridge collapse is famous for exactly this: small oscillations stayed predictable, but as amplitude grew, aerodynamic forcing crossed nonlinear thresholds the linear analysis didn’t see. The equation in arc 1 is exact only inside the regime; outside, you’re solving a different problem.
Forced — amplitude as a function of driving frequency
Now turn the forcing on: . After the transient (the free-decay piece) dies away, the mass settles into a steady state at the driving frequency: . The amplitude has a closed form — plug the steady-state ansatz into the equation and solve algebraically:
Two limits read off directly. For very slow forcing (), — the static deflection: the spring just balances the slowly-applied force. For very fast forcing (), — the mass can’t keep up at all, inertia wins. Between them, the curve has a peak — and that’s the resonance.
The widget’s lower panel shows for the current . Drag damping down to 0.05 — the peak shoots up, narrow and tall. Drag damping up to 1.0 — the peak vanishes; the curve is now monotonic. Lighter damping → sharper, taller peak. The amplitude is set by how much energy the forcing pumps in versus how much damping bleeds away — the equilibrium is the steady-state amplitude.
# Steady-state amplitude as a function of driving frequency:
# A(ω) = F / sqrt((ω₀² − ω²)² + (2γω)²)
# — a closed-form 'frequency response' that emerges by plugging
# x(t) = A·cos(ωt − φ) into the forced equation and collecting cos / sin.
def amplitude(omega, gamma, omega0=1.0, F=1.0):
a = omega0**2 - omega**2
b = 2 * gamma * omega
return F / np.sqrt(a*a + b*b)
# Peak location (where the response is largest):
# d/dω [A] = 0 → ω_peak = sqrt(ω₀² − 2γ²) (for γ < ω₀/√2)
# For very small γ, ω_peak ≈ ω₀ — the natural frequency.
def peak_omega(gamma, omega0=1.0):
if gamma >= omega0 / np.sqrt(2):
return 0.0 # no peak — overdamped frequency response
return np.sqrt(omega0**2 - 2*gamma**2)
[(g, peak_omega(g), amplitude(peak_omega(g) or 0.001, g))
for g in (0.05, 0.1, 0.3, 0.7, 1.0)]
# γ=0.05 → peak at 0.997, A ≈ 10 sharp resonance
# γ=0.1 → peak at 0.990, A ≈ 5.0
# γ=0.3 → peak at 0.906, A ≈ 1.7
# γ=0.7 → peak at ~0, A ≈ 1.4 no real resonance peak
# Lighter damping → sharper peak. The Q-factor 1/(2γ/ω₀) measures this
# 'sharpness' directly; a high-Q oscillator (laser cavity, atomic clock)
# is the same equation with γ pushed near zero.Resonance — pushing on the beat
Why does the peak sit at ?
The same identity governs an opera singer breaking glass (vocal cord drives the glass at its
The Q-factor measures how narrow the resonance peak is. High Q (atomic clocks: Q ≈ 10¹⁰; pendulum: Q ≈ 100) means the system rings cleanly at exactly one frequency. Low Q means a broad, easily-driven response. Choosing Q is one of the first decisions any oscillator designer makes — the rest is consequence.
# Resonance with energy bookkeeping: average the power F·v over a few
# cycles and watch energy build up coherently when ω = ω₀.
def energy_input(gamma, omega_drive, F=1.0, T=50, dt=0.01):
omega0 = 1.0
t = np.arange(0, T, dt)
A = amplitude(omega_drive, gamma)
a = omega0**2 - omega_drive**2
b = 2 * gamma * omega_drive
phi = np.arctan2(b, a)
v = -A * omega_drive * np.sin(omega_drive * t - phi)
forcing = F * np.cos(omega_drive * t)
return float(np.mean(forcing * v))
[(omega_drive, energy_input(0.1, omega_drive))
for omega_drive in (0.5, 0.9, 1.0, 1.1, 1.5)]
# ω=0.5 → avg power ≈ 0.05
# ω=0.9 → avg power ≈ 0.45
# ω=1.0 → avg power ≈ 2.5 ← resonance: 50× more energy in / cycle
# ω=1.1 → avg power ≈ 0.45
# ω=1.5 → avg power ≈ 0.05
# 'Pushing on the beat' is literally an integral identity — F·v averages
# to a positive number only when forcing is in phase with velocity.Resonance is not always disaster. The phrase “soldiers must break step on a bridge” is a half-truth at best — synchronized footfall can drive a low-Q bridge near its natural frequency, but most bridges are designed with damping high enough to make this irrelevant. Resonance is also what makes radios work, how MRI images you, why your microwave heats water (electromagnetic waves at one of water’s rotational resonances), and the entire principle of laser cavities. Dangerous resonance and useful resonance are the same equation; the engineering question is which side of the equation you live on. A high-Q oscillator is a tool when you want it and a bomb when you don’t.
Damping decides how it stops. Resonance decides when a push wins. One equation — — runs every oscillator that bleeds energy and listens to the right beat. Three free-decay regimes (under / critical / over) and one steady- state amplitude curve . Everything else is engineering: which γ, which ω₀, which Q.
In the widget, set damping (the undamped preset). The trace becomes a perfect cosine. Read its period off the time axis. Confirm with the formula using .
The widget’s three damping presets are weak (γ = 0.1), critical (γ = 1.0), overdamped (γ = 2.0). For each, predict whether the trace oscillates and roughly how long it takes to settle near zero. Confirm in the widget.
Compute for and using the formula (with ). Why does halving damping more than double the peak amplitude?
A friend says: “Resonance is dangerous — that’s why bridges collapse and singers break glass.” Refute in one sentence by listing three places where resonance is useful.
Introductory physics teaches the undamped harmonic oscillator (Hooke’s law + Newton II) as a decorative example, and then skips to wave equations, optics, or quantum. The damped driven case — with three regimes, a closed-form amplitude response, and an honest definition of resonance — is left for a sophomore-year mechanics or electrical-engineering course, where it drowns in Laplace transforms. Lemma collapses it: one equation with three terms, three regimes by sign of a discriminant, one amplitude formula, and a widget that shows all of it directly. The Q-factor and resonance frequency follow as one calculation; bridges, radios, lasers, and car suspensions show up as different choices on the same axes. The equation is older than electrical engineering and used everywhere in it; teaching it as ‘special and advanced’ is a curriculum artifact.