πŸŒ€

Spring & Hooke's Law Simulator

Explore spring force, oscillation, and energy storage. Adjust spring constant, mass, and damping - then watch the physics unfold in real time

Spring force
-
Kinetic energy
-
Potential energy
-
Total energy
-
Spring diagram
Kinetic energy Potential energy Total energy
Phase space (velocity vs. displacement)
Displacement (x)
-
Velocity (v)
-
Spring force (F = βˆ’kx)
-
Elastic PE (Β½kxΒ²)
-
Kinetic energy (Β½mvΒ²)
-
Total mechanical energy
-
Period (T = 2Ο€βˆšm/k)
-
Frequency (f = 1/T)
-
Damping state
-
Controls
5300 N/m
0.110 kg
0.020.60 m
0 (none)8 (heavy)
0.25Γ—3Γ—
Show equilibrium line
Show force arrow

Hooke's Law

F = βˆ’kΒ·x

The restoring force of a spring is proportional to displacement and always points back toward equilibrium. The negative sign is key: the further you stretch or compress, the harder the spring pulls or pushes back. The spring constant k (N/m) measures stiffness - larger k means a stiffer spring that resists deformation more strongly.

Simple Harmonic Motion (SHM)

x(t) = AΒ·cos(Ο‰t + Ο†) Β Β  Ο‰ = √(k/m) Β Β  T = 2Ο€βˆš(m/k)

Without damping, the mass oscillates forever in a perfect sinusoid. The angular frequency Ο‰ depends only on k and m - not on amplitude. This is the key property of SHM: period is amplitude-independent. A heavier mass oscillates more slowly; a stiffer spring oscillates more quickly.

Energy in a spring system

PE = Β½kxΒ² Β Β  KE = Β½mvΒ² Β Β  E_total = Β½kAΒ²

Energy constantly converts between elastic potential energy (maximum at the turning points, x = Β±A) and kinetic energy (maximum at equilibrium, x = 0). Total mechanical energy equals Β½kAΒ² and is constant without damping. Watch the energy bars swap back and forth as the mass oscillates.

Damping

F_damp = βˆ’bΒ·v Β Β  x(t) = AΒ·e^(βˆ’bt/2m)Β·cos(Ο‰_dΒ·t)

Real springs lose energy to friction, air resistance, and internal material deformation. Damping force is proportional to velocity. Three regimes exist: underdamped (b < 2√km) - oscillates with decaying amplitude; critically damped (b = 2√km) - returns to equilibrium fastest without oscillating; overdamped (b > 2√km) - sluggishly creeps back.

Phase space

Plot: velocity (v) vs. displacement (x)

An undamped oscillator traces a perfect ellipse in phase space - it returns to exactly the same state after every cycle. A damped oscillator spirals inward toward the origin as energy is lost. The shape of the spiral reveals the damping regime at a glance.

Period is mass-dependent, not amplitude-dependentDouble the amplitude and the period stays the same - only k and m determine how fast the spring oscillates. This is what makes SHM special.
Critical damping is the "sweet spot"Car suspensions and door closers aim for critical damping - the system returns to rest as fast as possible without overshooting. Too little and it bounces; too much and it's sluggish.
Energy is maximum at the turning pointsWhen the mass momentarily stops (v = 0), all energy is stored as elastic PE. When it passes through x = 0, all energy is kinetic. The total never changes (without damping).
Stiffer spring = higher frequencyDoubling k increases Ο‰ by √2 β‰ˆ 1.41Γ—, shortening the period. Doubling mass decreases Ο‰ by the same factor - the two effects are symmetric in Ο‰ = √(k/m).
01
Adjust spring constant kDrag the k slider. A higher k (stiffer spring) makes the oscillation faster - watch the period readout in the table drop as k increases. The spring coils also compress visually.
02
Change the massA heavier mass oscillates more slowly. Try setting k to 50 and comparing m = 0.5 kg vs m = 5 kg - the period roughly triples.
03
Set initial displacementThis is the amplitude A - how far you pull the mass from equilibrium before releasing it. It affects the peak forces and energies, but not the period.
04
Add dampingDrag b away from 0. Watch the oscillation decay and the phase-space ellipse spiral inward. Find the critical damping point (b β‰ˆ 2√km) where the mass returns to rest without bouncing.
05
Watch the energy barsThe bar chart below the diagram shows KE (blue), PE (green), and total (purple) updating every frame. Without damping the bars swap perfectly; with damping the total bar shrinks.
06
Copy or download resultsHover any stat card or table row to reveal the copy icon. Use πŸ“‹ Copy CSV to copy the full session log, or πŸ–¨οΈ Report to download a printable HTML report with a diagram snapshot.

Experiments to try

Period independence from amplitude: Set any k and m. Change xβ‚€ from 0.05 m to 0.50 m. The period shown in the table stays exactly the same - only the peak force and energy change.
Find critical damping: Set k = 50, m = 1.0. The critical damping coefficient is 2√(50Γ—1) β‰ˆ 14.1. Drag b slowly up - watch the phase spiral tighten and the oscillations disappear at the critical point.
Energy conservation check: Set b = 0 (no damping). The Total energy bar should stay perfectly flat throughout the oscillation. Add any damping and watch it decline.
Stiff vs. soft spring: Use the "Stiff steel" preset (k=250, m=0.3), then "Soft rubber" (k=3, m=0.5). Compare the periods, force magnitudes, and phase-space ellipse shapes side by side.