AP subjects/AP Physics 1/Simple Harmonic Motion Simulator
CED 7.2AP Physics 1

Simple Harmonic Motion Simulator

Use this free simple harmonic motion simulator to switch between a mass on a spring and a pendulum, change the mass, spring constant, length and amplitude, and see which of them actually change the period TT and the frequency ff.

Controls
typemassspring-constantlengthamplitudeplay

How to use the simulator

Two buttons choose the oscillator. Mass-spring shows a block bouncing vertically on a spring about a dashed equilibrium line marked “eq”. Pendulum shows a bob swinging about a dashed vertical line. Both animate in real time, so one full cycle on screen takes one period.
  • mass m: 0.5 to 5 kg in steps of 0.5 kg. In pendulum mode this slider is greyed out and cannot be moved, because the pendulum's period does not depend on mass.
  • spring const. k: 5 to 60 N/m in steps of 5 N/m (mass-spring only).
  • length L: 0.2 to 3.0 m in steps of 0.1 m (pendulum only).
  • amplitude A: 10% to 100% in steps of 5%. It sets how far the block moves or how far the bob swings (up to about 29° at 100%), as a percentage of the largest swing the drawing allows.
  • Pause / Play freezes the motion; Reset returns to m = 1 kg, k = 20 N/m, L = 1.0 m and A = 60%.
The readout shows the formula in use, the period T in seconds and the frequency f in hertz, to two decimal places. Start with the amplitude slider: move it from 10% to 100% and the period does not change at all, even though the object now travels much farther each cycle. It simply moves faster to cover the larger distance in the same time.

The equations

Simple harmonic motion happens whenever the restoring force is proportional to the displacement from equilibrium and points back toward it. For a spring that is Hooke's law, Fs=−kxF_s = -kx. The periods, both on the AP Physics 1 equation sheet, are Ts=2πmkTp=2πℓgT_s = 2\pi\sqrt{\frac{m}{k}} \qquad T_p = 2\pi\sqrt{\frac{\ell}{g}} and the frequency is f=1/Tf = 1/T.
A heavier block is harder to accelerate, so it oscillates more slowly; a stiffer spring pulls back harder, so the oscillation is faster. For a pendulum, a heavier bob feels a bigger restoring force but has proportionally more inertia, so mass cancels out; only the length and gg matter.
Because of the square root, the period scales slowly. Multiplying mm by 4 doubles TsT_s, and multiplying ℓ\ell by 4 doubles TpT_p. Dividing by 4 halves them.
The pendulum formula assumes small angles. Real pendulums swung through larger angles take slightly longer; the simulator always uses the small-angle formula, which is a good approximation for the swings it draws.

Worked example

A 2 kg block hangs from a spring with k=50k = 50 N/m. Find its period and frequency, then find what happens if the mass is reduced to 0.5 kg.
Period. T=2π2/50=2π0.04=2π(0.2)=1.26T = 2\pi\sqrt{2/50} = 2\pi\sqrt{0.04} = 2\pi(0.2) = 1.26 s.
Frequency. f=1/1.26=0.80f = 1/1.26 = 0.80 Hz, so the block makes about four oscillations every five seconds.
Smaller mass. At 0.5 kg the mass is 14\tfrac{1}{4} as large, so the period halves: T=2π0.5/50=0.63T = 2\pi\sqrt{0.5/50} = 0.63 s and f=1.59f = 1.59 Hz.
In the simulator choose Mass-spring, set m = 2 and k = 50. The readout should give T = 1.26 s and f = 0.8 Hz. Drop the mass to 0.5 kg and you should see 0.63 s and 1.59 Hz.
Pendulum comparison. Switch to Pendulum and set L = 2.4 m: T=2π2.4/9.8=3.11T = 2\pi\sqrt{2.4/9.8} = 3.11 s. Shorten it to 0.6 m, a quarter of the length, and the period halves to 1.55 s. Notice that the mass slider no longer has any effect.

Common mistakes on the AP exam

  • Thinking amplitude changes the period. For ideal simple harmonic motion it does not; a larger amplitude raises the maximum speed and energy instead.
  • Putting mass into the pendulum period. TpT_p depends only on ℓ\ell and gg.
  • Forgetting the square root. Doubling the mass on a spring multiplies the period by 2≈1.41\sqrt{2} \approx 1.41, not by 2.
  • Mixing up T and f. Period is seconds per cycle; frequency is cycles per second.
  • Placing maximum speed at the turning points. The speed is greatest at equilibrium and zero at the extremes, where the acceleration is largest.
  • Assuming gravity changes a spring's period. A vertical spring has the same TsT_s as a horizontal one; gravity only shifts the equilibrium position.

When the AP exam uses this

These relationships are the focus of Topic 7.2, Frequency and Period of SHM, in Unit 7, Oscillations. Experimental design questions often ask how to determine kk or gg from period measurements, for example by graphing T2T^2 against mm (slope 4π2/k4\pi^2/k) or T2T^2 against ℓ\ell (slope 4π2/g4\pi^2/g) so that the data fall on a straight line.
Embed this simulator on your class page

Free for classroom use. Paste this into your site, LMS page or blog; keep the credit link under it.