Simple harmonic motion is the back-and-forth of a mass on a spring, its period set by T = 2π·sqrt(m/k). Drag the sliders below to change the mass, spring constant and amplitude, and watch the period, frequency and the kinetic/potential energy split respond in real time.

Simple Harmonic Motion

A mass on a spring. Change the mass, stiffness, and amplitude, then watch the motion and energy respond.

T = 2π·sqrt(m/k)

Controls

0.50 kg
40 N/m
0.12 m

Live readings

Displacement x0.120m
Velocity v0.00m/s
Acceleration a0.0m/s²
Period T0.000s
Frequency f0.00Hz
Kinetic KE0.000J
Potential PE0.000J
Total energy E0.000J

Energy is conserved: KE + PE = E at every instant. Speed peaks at the centre; acceleration peaks at the turning points.

What Is the Simple Harmonic Motion Simulator?

The simple harmonic motion simulator is a free interactive physics lab that runs in your browser — nothing to install and no sign-up. Change the mass, spring constant and amplitude and watch the period, frequency and energy respond.

What you can change in the simple harmonic motion simulator
ControlRangeStep
Mass0.10 – 2.00 kg0.01
Spring constant per metre5 – 100 N1
Amplitude0.02 – 0.20 m0.01

Watch Energy Slosh Between Spring and Mass

Every cycle of simple harmonic motion is a trade: the spring stores elastic potential energy as it stretches and compresses, then hands it back to the mass as kinetic energy through the middle. This simulator lets you feel that exchange directly. Watch the KE and PE readouts as the block travels — they rise and fall in perfect opposition while Total energy E holds fixed, because the ideal model has no damping and KE + PE = E at every instant.

Now drag the Amplitude A slider and keep your eye on Period T and Frequency f. They do not budge. Pulling the mass twice as far only raises the energy, since E = 1/2·k·A², and lifts the peak speed — the rhythm itself is isochronous. Only the Mass m and Spring constant k sliders change the timing, through T = 2π·sqrt(m/k): load on more mass and the beat slows, stiffen the spring and it quickens.

The turning points expose the classic trap. Speed hits zero at x = ±A, yet the mass is not resting there — acceleration and restoring force peak exactly then, since a = -ω²·x, which is what flings it back. Maximum speed lives at the centre, where PE reads zero. Put real numbers to it with the simple harmonic motion calculator, then take the same hands-on approach to waves, pendulums, and circuits waiting across the full shelf of physics simulations.

Where the ideal simple harmonic motion breaks down

Every readout here assumes the spring's force stays exactly proportional to its stretch. Real springs obey that only over a limited range. Past the proportional limit a helical spring stiffens, and in compression it eventually binds solid; push the sliders to k = 100 N/m and A = 0.20 m and the peak force is 20 N with 2.000 J stored, beyond the rated travel of most classroom springs. Once the force stops being proportional to x the motion is still periodic but no longer harmonic: the period begins to depend on amplitude and the clean sine grows extra harmonics.

The second assumption is that nothing takes energy out: the Total energy E readout never moves, because the model has no damping. A real block is slowed by air and by internal losses in the metal, so its amplitude decays exponentially. What is worth noticing is how little that disturbs the timing: at a quality factor of 20 the period lengthens by only 0.031 per cent. Damping eats the amplitude long before it touches the beat, which is why oscillators make good clocks.

Dry friction behaves nothing like that. Sliding friction is roughly constant rather than proportional to speed, so it removes a fixed energy per swing and the amplitude falls in a straight line. It also does something the ideal model cannot: it stops the mass for good. With the default 0.50 kg block, k = 40 N/m and a static friction coefficient near 0.3, the restoring force cannot beat sticking anywhere inside 3.7 cm of centre, so the block parks in a dead band 31 per cent as wide as the default 0.12 m amplitude and stays there, off centre.

Finally, T = 2π·sqrt(m/k) treats the spring as weightless. Its coils move too, and a good approximation adds about a third of the spring's mass to the block. At m = 0.50 kg and k = 40 N/m the panel reads 0.702 s, but hang that block on a 60 g spring and the true period is 0.716 s, two per cent slow, which matters if you are measuring rather than demonstrating. One caution about the canvas: it renders one cycle in a fixed 2.5 s whatever you set, so read Period T from the panel rather than timing the block by eye.

Where this is actually used

A quartz watch is the purest case. Its crystal is a tiny tuning fork cut to vibrate at 32,768 Hz, chosen because it is 215, so fifteen halvings give exactly one pulse per second. What makes it a clock is the amplitude independence you can test above: drag Amplitude A from 0.12 m to 0.20 m and Period T holds at 0.702 s while the energy climbs from 0.288 J to 0.800 J. Frequency is fixed by stiffness and inertia alone, so a knock does not change the time. For scale, the fastest setting here, k = 100 N/m with m = 0.10 kg, gives 5.03 Hz; the crystal runs about 6,500 times faster.

One corner of a car is the same system with a damper bolted across it. Suspension engineers choose the ride frequency first, typically 1.0 to 1.5 Hz, because that is what a human body reads as comfortable, then work backwards: for a sprung mass of 300 kg at 1.2 Hz the same formula gives about 17 kN/m per corner, a spring that sags roughly 17 cm under static load. A damper is then sized to bleed the oscillation away in about one cycle, so the car settles after a bump instead of bouncing like the block above.

The same formula run backwards weighs things where a balance is useless. In free fall nothing has weight, so mass must be found from inertia, and a known spring turns a stopwatch reading into a mass. The sim gives the calibration: hold k = 40 N/m and move Mass m from 0.50 kg to 2.00 kg, and Period T goes from 0.702 s to 1.405 s, exactly double for four times the mass. That square root is also the weakness, squeezing large mass differences into small period differences.

Frequently asked questions

What determines the period of a mass on a spring?

Only the mass and the spring constant: T = 2π·sqrt(m/k). A heavier mass lengthens the period; a stiffer spring shortens it. The amplitude has no effect on the period at all.

Does the amplitude change the period?

No. Simple harmonic motion is isochronous — the period stays the same however far you pull the mass. A larger amplitude raises the total energy (E = ½·k·A²) and the peak speed, but the period and frequency are unchanged.

Where is the mass moving fastest?

At the centre, the equilibrium point, where all the energy is kinetic and the potential energy reads zero. At the two turning points the speed is zero — but the mass is not resting there: the acceleration and restoring force are at their maximum, which is what reverses it.

Is energy conserved in simple harmonic motion?

In the ideal, undamped model, yes. Energy shuttles back and forth between kinetic and elastic potential every quarter cycle while the total, KE + PE = E, stays constant. Real oscillations lose energy to friction and slowly decay.

How do displacement, velocity and acceleration line up in time?

Velocity runs a quarter of a cycle ahead of displacement, and acceleration is exactly half a cycle out of phase with it, because a = -omega^2 x. That is why the panel shows v = 0.00 m/s at the turning point x = 0.120 m while the acceleration sits at its largest negative value, -9.6 m/s^2, for the default 0.50 kg mass on a 40 N/m spring.

References & formula source

  • Halliday, Resnick & Walker — Fundamentals of Physics, Chapter 15 (Oscillations).
  • Young & Freedman — University Physics with Modern Physics, §14.2–14.3 (SHM; Energy in SHM).
  • R. Nave — HyperPhysics, Georgia State University, "Simple Harmonic Motion" section.
  • Further reading: Simple harmonic motion — Wikipedia