MECHANICS · High school · College

Spring–Mass Oscillator Simulator

A spring and mass oscillate smoothly while live measurements show displacement, period, angular frequency and the balance between kinetic and elastic potential energy.

↓ Jump to simulatorFree · No loginReal-time controlsUnits & models explained
LIVE EXPERIMENTReady · Press Start
Your browser does not support canvas. Read the scientific lesson below.
Press Start to explore the model

Scientific model: An ideal one-dimensional horizontal oscillator with a massless Hookean spring, frictionless surface and no damping, spring collisions, deformation limits or external driving. The visible spring shape is a schematic drawing.

Spring–Mass Oscillator Simulator — static example view
Example view of this experiment. Use the simulator above to explore your selected parameters and live measurements.
LEARNING OUTCOMES

What will you understand?

  • Connect Hooke’s law to simple harmonic motion.
  • Predict how mass and spring stiffness change oscillation period.
  • Observe the exchange between kinetic and elastic potential energy.
THE PHYSICS EXPLAINED

How the simulation works

The restoring force

For an ideal Hookean spring displaced a distance x from equilibrium, F = −kx. Newton’s second law then gives m x″ = −kx, whose undamped solution is x(t) = A cos(ωt) for a mass released from rest at amplitude A.

Period and mass

Angular frequency ω equals √(k/m), and the period T equals 2π√(m/k). Increasing mass slows the oscillation; increasing stiffness makes it faster. Changing amplitude does not change the period in the ideal model.

Energy conservation

The elastic potential energy is ½kx² and the kinetic energy is ½mv². Their sum remains constant when there is no friction or damping.

MODEL EQUATION
ω = √(k/m), T = 2π√(m/k)

Use the controls above to change the relevant parameters. All displayed values follow the assumptions stated on this page.

TRY IT YOURSELF

Three experiments to try

  1. Double the mass and compare the period with the original value.
  2. Increase the spring stiffness while keeping mass fixed; notice the spring oscillates faster.
  3. Watch the energy bar when the block crosses equilibrium versus the turning points.
WORKED EXAMPLE

Calculate it before you visualize it

For m = 2 kg and k = 50 N/m, ω = √(50/2) = 5 rad/s and T = 2π/5 ≈ 1.257 s. If the initial displacement is 0.40 m, total mechanical energy is ½ × 50 × 0.40² = 4 J.

QUICK KNOWLEDGE CHECK

Can you predict the result?

If the mass becomes four times larger while the spring stiffness stays fixed, what happens to the period?

Reveal the answer

The period doubles because T is proportional to the square root of mass.

ASSUMPTIONS & LIMITS

What the model does not show

An ideal one-dimensional horizontal oscillator with a massless Hookean spring, frictionless surface and no damping, spring collisions, deformation limits or external driving. The visible spring shape is a schematic drawing.

REFERENCES & MODEL REVIEW

Science sources

This teaching implementation follows idealized textbook models. It is designed for exploration and should not be used for engineering design or safety decisions.

OpenStax University Physics Vol. 1 — Simple Harmonic Motion ↗

Model implementation: MG Labs teaching model. Independent subject-matter review and classroom testing are still pending.