Textbook model (SI units): a linear spring, viscous damper and sinusoidal external force.
m x″ + c x′ + k x = F₀ cos(ωt)
ω = 2πf · fₙ = √(k/m)/(2π)
A = F₀ / √((k − mω²)² + (cω)²)
φ = atan2(cω, k − mω²)
P̄ = c A²ω² / 2 · E = mv²/2 + kx²/2
Here m is mass, c damping, k stiffness, F₀ force amplitude, f drive frequency, x displacement and v velocity. The phase lag φ is displayed in degrees.
The live motion uses fixed-step fourth-order Runge–Kutta (illustrative numerical step: 1/240 s). The separate trial starts at rest, waits for transients to decay, fits the displacement to sine and cosine, and integrates the actual input power. The three checks compare different measured quantities with independent closed-form textbook predictions.
The apparatus is schematic: rigid cart, linear spring, friction proportional to speed, ideal drive, no hard-stop collisions, no spring mass or static friction. The ±0.35 m travel allowance is illustrative; crossing it flags an unsuitable setting rather than simulating damage. The view rescales to keep motion visible. All input settings, live numerical readings and trial tolerances are illustrative, not measured hardware specifications.