Skip to content
MoneyDeck

Simple Harmonic Motion Calculator

Period, frequency, displacement, velocity and energy of an oscillator

Updated · Free, no signup

kg
N/m
m

Maximum displacement from equilibrium.

s

Moment at which to evaluate position, velocity and acceleration.

°

0° = released from rest at +A.

Period (T)

0.9935 s

Frequency (f)

1.0066 Hz

Angular frequency (ω)

6.3246 rad/s

Displacement x(t)

0.0807 m

Velocity v(t)

-0.3739 m/s

Acceleration a(t)

-3.2263 m/s²

Maximum speed (Aω)

0.6325 m/s

Maximum acceleration (Aω²)

4 m/s²

Total energy (½kA²)

0.1 J

Spring constant (k)

20 N/m

  • The oscillator completes 1.007 cycles per second, or 60.4 per minute.
  • At t = 0.1 s, 65.1% of the energy is stored in the spring and the rest is kinetic.
  • Quadrupling the mass doubles the period; quadrupling the stiffness halves it. Amplitude does not change the period.

Displacement (m) and velocity (m/s) over two periods

About the Simple Harmonic Motion Calculator

This simple harmonic motion calculator models a mass on an ideal spring (or any oscillator whose period you already know). Enter the mass and spring constant, the amplitude and a moment in time, and it returns the period, frequency and angular frequency together with the displacement, velocity and acceleration at that instant, the maximum speed and acceleration, and the total mechanical energy stored in the system.

It is written for physics students working through oscillation problems, lab classes timing a spring-mass system, and engineers who want a quick feel for how stiffness and mass set a natural frequency. The chart traces displacement and velocity over two full cycles so you can see the quarter-period phase shift between them.

The model is ideal SHM: a linear (Hooke’s law) restoring force, no friction or damping, and a massless spring. The motion is written as x(t) = A·cos(ωt + φ), so with a phase of 0° the mass starts at maximum positive displacement and is released from rest.

With the default inputs, the period (t) is 0.9935 s. Change any value above to recalculate instantly.

How to use the simple harmonic motion calculator

  1. 1Choose whether you know the spring constant or the period.
  2. 2Enter the mass and the spring constant (or period).
  3. 3Enter the amplitude — how far the mass is pulled from equilibrium.
  4. 4Enter a time and, if needed, a phase constant.
  5. 5Read the period, instantaneous motion and energy, and check the chart.

Formula and method

ω = √(k/m) T = 2π/ω x(t) = A·cos(ωt + φ) v(t) = −Aω·sin(ωt + φ) a(t) = −ω²·x(t) E = ½kA²

A mass on an ideal spring feels a restoring force F = −kx. Newton’s second law then gives x″ = −(k/m)x, whose solution is a sinusoid with angular frequency ω = √(k/m). The period T = 2π/ω and frequency f = 1/T depend only on mass and stiffness, not on how far the mass is pulled.

Differentiating x(t) = A·cos(ωt + φ) gives the velocity and acceleration; their peaks are Aω (at equilibrium) and Aω² (at the turning points). Total mechanical energy is constant at ½kA² and sloshes between spring potential energy ½kx² and kinetic energy ½mv². In “known period” mode the effective spring constant is recovered as k = mω².

m
Oscillating mass (kg)
k
Spring constant (N/m)
A
Amplitude (m)
ω
Angular frequency (rad/s)
φ
Phase constant
T, f
Period (s) and frequency (Hz)

Worked examples

0.5 kg mass on a 20 N/m spring

ω = √(20 ÷ 0.5) = 6.325 rad/s, so T = 2π ÷ 6.325 = 0.993 s. Pulled 0.1 m and released, after 0.1 s the mass is at 0.1·cos(0.632) = 0.0806 m moving at −0.374 m/s. Its top speed is 0.632 m/s and the total energy is ½ × 20 × 0.1² = 0.1 J.

Stiff spring: 2 kg on 200 N/m

ω = √(200 ÷ 2) = 10 rad/s and T = 0.628 s. At t = 0.1 s the phase is 1 rad, so x = 0.05·cos 1 = 0.0270 m, v = −0.5·sin 1 = −0.421 m/s and a = −100 × 0.0270 = −2.70 m/s². Energy is ½ × 200 × 0.05² = 0.25 J.

Known 2-second period

A 2 s period means ω = π rad/s. A quarter period later (t = 0.5 s) the mass passes through equilibrium (x = 0) at its maximum speed, Aω = 0.2π = 0.628 m/s. With a 0.5 kg mass, the spring constant must be mω² = 4.93 N/m.

Frequently asked questions

What is simple harmonic motion?+

Simple harmonic motion is oscillation in which the restoring force is proportional to displacement and points back toward equilibrium (F = −kx). The result is a sinusoidal motion with a fixed period, like an ideal spring or a small-angle pendulum.

How do you find the period of a spring-mass system?+

Use T = 2π√(m/k). For example, a 0.5 kg mass on a 20 N/m spring has T = 2π√(0.025) ≈ 0.99 s. The period is independent of amplitude for an ideal spring.

Where is the speed greatest in SHM?+

Speed is greatest at the equilibrium position, where all the energy is kinetic, and equals Aω. At the turning points (x = ±A) the speed is zero and acceleration is at its maximum, Aω².

Does amplitude affect the period?+

Not in ideal simple harmonic motion. A larger amplitude means a higher maximum speed and more energy, but the time for one cycle stays the same. Real springs and pendulums deviate slightly at large amplitudes.

What is the difference between frequency and angular frequency?+

Frequency f counts cycles per second (Hz). Angular frequency ω = 2πf measures the rate in radians per second and is the quantity that appears inside the sine and cosine of the motion equations.

Related tools