Spring oscillator simulator
Stretch a spring, let go and watch simple harmonic motion with live energy bars. Hooke’s law F = −kx pulls the mass back toward equilibrium, the period is T = 2π√(m/k), and the total energy ½kA² swaps between spring potential energy and kinetic energy.
What if you changed…
At which point is the object fastest? Watch the energy bars.
See the calculation
- Angular frequency = √(k/m) = 4.47 rad/s. Period = 2π/ω = 1.4 s.
- Spring energy = ½kx² = 2.5 J. Kinetic energy = ½mv² = 0 J.
- Their sum remains ½kA² = 2.5 J.
What this model assumes
Horizontal ideal Hooke’s-law spring, no friction or damping. Displacement is measured from equilibrium.
Keep an eye on this
The minus sign in F = −kx describes direction; spring stiffness itself is positive.
Understand the physics ↗Formulas used in this simulation
- Hooke’s law
- F = −kx
- Force points back toward equilibrium
- Period
- T = 2π√(m/k)
- Independent of amplitude
- Angular frequency
- ω = √(k/m)
- In rad/s; f = ω/2π
- Spring potential energy
- PE = ½kx²
- Largest at the turning points
- Total energy
- E = ½kA² = ½m·vmax²
- vmax = Aω at equilibrium
Spring oscillator: common questions
Wondering about the why? Start here.
How do you calculate the period of a mass on a spring?
Use T = 2π√(m/k) with mass in kg and the spring constant in N/m. A 1 kg mass on a 20 N/m spring has T = 2π√(0.05) ≈ 1.40 s.
What is the spring constant k?
k is the stiffness: the force needed per metre of stretch, measured in N/m. A larger k means a stiffer spring, a stronger restoring force and a shorter period.
Where is the mass moving fastest?
At the equilibrium position, where the spring’s potential energy is zero and all of the energy is kinetic. The mass stops momentarily at the turning points, ±A.
Does a larger amplitude change the period?
Not for an ideal linear spring. It increases maximum speed and stored energy, while the period stays the same.
How does doubling the mass affect the period?
The period is multiplied by √2. To double the period, multiply mass by four while keeping stiffness constant.