Mass-Spring Oscillator Simulator
How to use the mass-spring simulator
- Set the mass, spring constant and how far the mass is pulled, then watch it oscillate.
- Compare the measured period with T = 2π√(m ÷ k). Note that the stretch does not change it: that is what makes the motion simple harmonic.
- Add damping to see the amplitude decay while the period stays almost the same.
Frequently asked questions
What is Hooke's law?
The restoring force of a spring is proportional to how far it is stretched: F = −kx. The constant k, in newtons per metre, is the spring's stiffness.
Why does a heavier mass oscillate more slowly?
The period is T = 2π√(m ÷ k): four times the mass gives twice the period, and four times the stiffness gives half. Unlike a pendulum, gravity does not appear in the formula.
Where does the energy go?
It moves back and forth between kinetic energy ½mv² at the centre and potential energy ½kx² at the ends; the total stays constant without damping. Damping turns it into heat, and the energy-left figure shows how much remains.
It says WebGL is turned off.
The 3D view needs WebGL, which every current browser has. It can be switched off by hardware acceleration being disabled in the browser settings, or by a very old graphics driver. Turn hardware acceleration on, or try another browser.
Is anything uploaded?
No. The simulation is drawn by your own browser with WebGL; nothing is sent anywhere, and it keeps working offline once the page has loaded.