A mass m hangs from a linear spring (Hooke’s law F = −kx) with viscous damping c and an optional periodic force. Measuring displacement x from the hanging equilibrium absorbs gravity completely, since the static stretch is mg/k.
m ẍ + c ẋ + k x = F0 cos(Ω t) T = 2π √(m/k), ωd = √(k/m − (c/2m)²), ζ = c / (2√(km)) Steady amplitude: A = F0 / √((k − mΩ²)² + (cΩ)²) Static stretch: xeq = m g / k, E = ½ m v² + ½ k x²The page integrates with fourth-order Runge–Kutta (0.5 ms steps). Five checks compare the integrated undamped period, energy conservation, static stretch from a full-gravity model, damped period and the driven amplitude with the closed forms.
Simplifications: massless, perfectly linear spring (no coil mass, no large-stretch non-linearity), linear damping, one dimension, and the mass moves only vertically.