aidoesscience
aidoesscience › Resonance · driven Q
Validating · validations

Resonance · the driven oscillator simulation

Push a damped mass-on-a-spring at frequency ω — how big a swing do you get, and how far behind does it lag?

▶ Run the simulationSee the measured result

Measured by the lab
0.98425098
Known value
0.98425098
Relative error
2.99e-10

Units: dimensionless (ω_r/ω₀ at Q = ω₀/γ = 4; exactly √(1 − γ²/(2ω₀²)) = √(31/32))

How the lab tests it

Drive a damped oscillator (ω₀=2, γ=0.5) with F=f₀·cos(ωt). At each ω wait out the transient, then LOCK IN: integrate x·cos(ωt) and x·sin(ωt) over whole drive periods — the two quadratures recover the steady amplitude A and the phase lag φ at once. Sweep ω across ω₀ and overlay the measured (A,φ) on the analytic curves.

What it checks

the Lorentzian A(ω)=f₀/√[(ω₀²−ω²)²+(γω)²], peaking at the resonant frequency ω_r=√(ω₀²−γ²/2) with sharpness Q=ω₀/γ, and the phase lag φ=atan2(γω, ω₀²−ω²) that sweeps 0→π and passes through EXACTLY π/2 at ω=ω₀. Measured points land on the Lorentzian to 3–4 digits; the peak (1.97 vs 1.969) and the φ=90° crossing (2.00 vs ω₀=2.0, damping-independent) hit to ~0.05%, with A_max and Q a few % low only because the drive grid is coarse near the peak

This simulation has a catalogued, oracle-checked result: The driven oscillator does NOT resonate at its natural frequency.