What this simulator teaches
Hooke's law connects force to displacement. Add inertia and that restoring force produces simple harmonic motion; add gravity, damping or periodic forcing and the same spring becomes a compact model of equilibrium, vibration and resonance.
hooke's lawstiffnesssimple harmonic motionenergyvertical equilibriumdampingresonancephase space
Select spring model6 animated learning modes
Hooke's law controls
Hooke's law
Restoring force is proportional to displacementHooke's law — force grows linearly with extension
Move the displacement control through compression and extension. The spring drawing and force–displacement graph update together.
F = −kx
Displacement / motionVelocity / comparisonEnergy / phaseForce / drive
Four ideas that explain spring motion
01 / Restoring forceFor an ideal linear spring, force is proportional to displacement and points toward the undeformed position: F = −kx.
02 / Natural frequencyCombining Hooke's law with Newton's second law gives ω₀ = √(k/m). More stiffness raises frequency; more mass lowers it.
03 / Energy exchangeIn undamped SHM, spring potential energy ½kx² and kinetic energy ½mv² exchange while total mechanical energy remains constant.
04 / Damping & resonanceDamping removes energy. Periodic forcing can replace it, producing a frequency-dependent steady response that peaks near resonance.
Model assumptions & limits
The simulator uses an ideal linear spring with constant stiffness over the displayed range. Real springs can depart from Hooke's law near coil contact, buckling, plasticity or geometric limits.
Downward is treated as positive. Static extension is xeq = mg/k. Oscillation about that equilibrium obeys mξ¨ + kξ = 0, so gravity shifts the equilibrium position but does not change the ideal period.
The damping tab uses linear viscous damping: mx¨ + cẋ + kx = 0. The damping ratio is ζ = c/(2√(mk)); ζ < 1 is underdamped, ζ = 1 critical, and ζ > 1 overdamped. Damped and driven transients are integrated with fourth-order Runge–Kutta at a fixed 1/1200 s internal step.
The live motion integrates mx¨ + cẋ + kx = F₀cos(ωt). The displayed steady-state amplitude and phase are the exact linear sinusoidal response for this model.
The spring itself is treated as massless. A real spring's distributed mass can increase the effective oscillating inertia; for a uniform light spring with one end fixed, a common first correction is to add roughly one-third of the spring mass to the attached mass.
Background & FAQ
The minus sign indicates direction. If x is positive, the spring force points in the negative direction; if x is negative, the force points positive. The spring always tries to restore the mass toward equilibrium.
No. For a perfectly linear Hooke's-law spring, the period T = 2π√(m/k) is independent of amplitude. Amplitude dependence appears when the spring or geometry becomes nonlinear.
Gravity adds a constant force mg, which shifts the equilibrium by mg/k. Measuring displacement from the new equilibrium removes that constant term, leaving the same SHM equation mξ¨ + kξ = 0.
At equilibrium, where spring potential energy is minimum. For ideal SHM the maximum speed is vmax = Aω₀.
Critical damping is the boundary ζ = 1 between oscillatory and non-oscillatory decay. In the linear model it gives the fastest return to equilibrium without overshoot for the standard release-from-rest condition.
For displacement amplitude with viscous damping, the peak occurs slightly below ω₀ when ζ < 1/√2: ωpeak = ω₀√(1 − 2ζ²). As damping approaches zero, the peak approaches ω₀.