Spring-Mass Oscillator Simulator

Pull a mass on a spring and let go: the restoring force F = −kx always points back toward equilibrium, producing simple harmonic motion — the same mathematics as a pendulum, a vibrating guitar string, or an atom in a crystal. Heavier masses swing slower; stiffer springs swing faster. Test both claims below.

2 kg
Period 1.15 sFrequency 0.87 Hz

Controls

  • Spring constant k: Stiffness of the spring in newtons per meter — higher k means a stiffer spring.
  • Mass: Mass attached to the spring, in kilograms.
  • Starting displacement: How far the mass is pulled from equilibrium before release, in meters.
  • Play / pause: Start or pause the oscillation.
  • Reset: Return the mass to the starting position.

The physics

Assumptions

  • Ideal massless spring obeying Hooke's law
  • No friction or air resistance
  • Motion stays within the spring's elastic limit
  • Horizontal motion (gravity balanced by the surface)

Guided activity

  1. Fix k and m, pull the mass to 0.3 m, release, and measure the period.

  2. Double the mass. How does the period change? Verify the square-root relationship.

  3. Double the spring constant k instead. Which change affects the period more?

  4. Change only the amplitude and check: does the period care? Connect this to simple harmonic motion.

Challenge questions

  1. Derive the period formula by combining F = ma with F = −kx and recognizing simple harmonic motion.

  2. Why do car suspensions use soft springs but heavy cars still ride smoothly? Analyze with the formula.

  3. What happens to the period if you cut the spring in half (doubling k)?