Skip to content
Physics

Simple Harmonic Motion Calculator

Enter the amplitude, frequency, and time to find the instantaneous displacement, velocity, and acceleration of any oscillating object. Switch to spring-mass mode to add the spring constant and mass, which unlocks the period formula and total mechanical energy. The phase angle field lets you offset the oscillation from zero for a cosine-start or any arbitrary phase. All results update instantly as you type.

Your details

Kinematic mode uses frequency directly. Spring-mass mode derives frequency from the spring constant and mass.
Number of complete oscillations per second. Ignored in spring-mass mode (computed from k and m).
Hz
Maximum displacement from the equilibrium position, in metres.
m
Elapsed time from t = 0 at which to evaluate displacement, velocity, and acceleration.
s
Initial phase offset in radians. Use 0 for a sine start (zero displacement at t = 0). Use pi/2 (1.5708) for a cosine start (maximum displacement at t = 0).
rad
Displacement (y)
0.1m

y = A * sin(omega * t + phi)

Angular frequency (omega)6.2832rad/s
Period (T)1s
Velocity (v)0m/s
Acceleration (a)-3.9478m/s²
Max velocity (v_max)0.6283m/s
Max acceleration (a_max)3.9478m/s²
Displacement (m)0.1
Velocity (m/s)0
-3.9503.95012
Time (s), marker at t = 0.25 s
  • Displacement (m)
  • Velocity (m/s)
  • Acceleration (m/s²)

Displacement is 0.100000 m, velocity is 0.0000 m/s.

  • At this moment the object is at 100.0% of its maximum displacement (0.1 m from equilibrium).
  • The restoring acceleration is 3.9478 m/s^2, directed toward the equilibrium position.
  • One complete oscillation takes 1.0000 s. The angular frequency is 6.2832 rad/s.

Next stepThe object is near its turning point: velocity approaches zero and acceleration (restoring force) is at its maximum.

What is simple harmonic motion?

Simple harmonic motion (SHM) is the oscillating back-and-forth motion of an object about a fixed equilibrium point, where the restoring force is proportional to the displacement and always directed toward equilibrium. The two classic examples are a mass on a spring (Hooke's law) and a simple pendulum oscillating through small angles. Because the restoring force grows linearly with displacement, the resulting motion is perfectly sinusoidal: the object moves fastest through the centre and momentarily stops at the extreme positions called the amplitude. SHM appears throughout physics and engineering, from the vibration of atoms in a crystal lattice to the oscillations of electrical LC circuits.

The core SHM equations

Three equations describe the state of an oscillating object at any time t. Displacement is y = A * sin(omega * t + phi), where A is amplitude and phi is the initial phase angle. Differentiating once gives velocity v = A * omega * cos(omega * t + phi), and differentiating again gives acceleration a = -A * omega^2 * sin(omega * t + phi). The negative sign in the acceleration formula confirms that the force always acts toward the equilibrium, not away from it. Angular frequency omega links to ordinary frequency f by omega = 2 * pi * f, and to the spring constant k and mass m of a spring-mass system by omega = sqrt(k / m). Period T = 2 * pi / omega, so a stiffer spring or a lighter mass shortens the period.

Energy in simple harmonic motion

Mechanical energy is conserved throughout an SHM cycle: the total energy E = (1/2) * k * A^2 is constant. At the amplitude (turning points) all energy is stored as potential energy in the spring (PE = (1/2) * k * A^2, KE = 0). At the equilibrium position all energy is kinetic (KE = (1/2) * m * v_max^2, PE = 0). At any intermediate point both forms coexist, with KE = (1/2) * m * v^2 and PE = (1/2) * k * y^2, and their sum always equals E. This energy exchange is the physical reason the object keeps oscillating indefinitely in the absence of damping.

Phase angle and initial conditions

The phase angle phi (in radians) sets the starting condition of the oscillation. When phi = 0 the displacement formula is a pure sine: the object starts at equilibrium (y = 0) and moves in the positive direction. Setting phi = pi/2 (approximately 1.5708 rad) gives a cosine start: the object begins at maximum positive displacement and moves toward equilibrium. Any other value represents an intermediate starting point. In real experiments the phase angle is determined by how and where the oscillation was initiated - releasing a spring from rest at maximum stretch corresponds to the cosine (phi = pi/2) case.

Simple harmonic motion quantity summary

QuantitySymbolSI unitFormula
Angular frequencyomegarad/somega = 2*pi*f = sqrt(k/m)
PeriodTsT = 1/f = 2*pi/omega
Displacementymy = A * sin(omega*t + phi)
Velocityvm/sv = A * omega * cos(omega*t + phi)
Accelerationam/s^2a = -A * omega^2 * sin(omega*t + phi)
Max velocityv_maxm/sv_max = A * omega
Max accelerationa_maxm/s^2a_max = A * omega^2
Total energyEJE = (1/2) * k * A^2
Kinetic energyKEJKE = (1/2) * m * v^2
Potential energyPEJPE = (1/2) * k * y^2

Key SHM quantities, their symbols, SI units, and the formula relating them to amplitude, angular frequency, and time.

Frequently asked questions

What is the difference between frequency and angular frequency?

Frequency f (in Hz) counts the number of complete oscillation cycles per second. Angular frequency omega (in rad/s) measures how fast the phase angle of the oscillation changes, expressed in radians per second. They are related by omega = 2 * pi * f: because one full cycle sweeps 2 * pi radians, omega is always 2 * pi times larger than f. Angular frequency appears directly in the SHM equations for displacement, velocity, and acceleration, which is why it is the more natural quantity for calculations.

Why does acceleration have a negative sign in the SHM formula?

The minus sign in a = -A * omega^2 * sin(omega * t + phi) reflects the fundamental property of SHM: the restoring force (and therefore acceleration) always points back toward equilibrium, opposite to the displacement. When displacement is positive (object is above equilibrium), acceleration is negative (directed downward or inward toward equilibrium), and vice versa. This is Newton's second law applied to Hooke's law: F = -k * y, so a = F/m = -(k/m) * y.

Does the period of a spring-mass system depend on amplitude?

No. This is one of the most useful properties of SHM. The period T = 2 * pi * sqrt(m / k) depends only on the mass and spring constant, not on how far you initially pull or push the mass. Larger amplitude means the object travels farther, but the restoring force is proportionally larger too, so the object moves faster - the two effects cancel out perfectly and the period stays the same. This amplitude-independence is why pendulum clocks and spring-driven mechanical watches keep accurate time regardless of how far they swing.

What is the phase angle and how do I choose it?

The phase angle phi (in radians) captures the initial state of the oscillation at t = 0. Set phi = 0 if the object starts at equilibrium and moves in the positive direction (sine start). Set phi = pi/2 (about 1.5708 rad) if the object starts at maximum positive displacement (cosine start, like releasing a compressed spring from rest). Set phi = -pi/2 if the object starts at maximum negative displacement. In general, phi = arcsin(y_0 / A), where y_0 is the initial displacement, with the sign of the initial velocity determining the quadrant.

How is mechanical energy distributed during an SHM cycle?

Total mechanical energy E = (1/2) * k * A^2 is constant. At the extreme positions (y = plus or minus A) all energy is potential and kinetic energy is zero. At the equilibrium (y = 0) all energy is kinetic and potential energy is zero. At intermediate positions kinetic energy KE = (1/2) * m * v^2 and potential energy PE = (1/2) * k * y^2 share the total, always summing to E. Enabling spring-mass mode in this calculator shows the real-time KE-PE split for any position you specify.

Can I use this calculator for a pendulum?

For small angles (less than about 15 degrees), a simple pendulum behaves like an SHM system. The effective spring constant is k_eff = m * g / L, where m is the mass of the bob, g is gravitational acceleration (about 9.81 m/s^2), and L is the pendulum length. The angular frequency is then omega = sqrt(g / L). You can enter that omega directly in kinematic mode (convert to frequency using f = omega / (2 * pi)) or compute k_eff and use spring-mass mode.

Sources

Written by Dr. Tomás Okafor, PhD Physicist · Lagos, Nigeria

Physicist specializing in classical mechanics, bringing 17 years of research and applied dynamics expertise to every calculator he reviews.

Search 3,500+ calculators

Loading search…