Simple Harmonic Motion Calculator
Displacement, velocity, and acceleration at any time in SHM.
About this calculator
Simple harmonic motion describes any system where the restoring force is proportional to displacement — a mass on a spring, a pendulum swinging through small angles, a vibrating guitar string. This calculator evaluates the classic sinusoidal solution: position x(t) = A·cos(ωt + φ), velocity v(t) = -Aω·sin(ωt + φ), and acceleration a(t) = -Aω²·cos(ωt + φ), where the angular frequency ω is derived directly from the period you enter (ω = 2π/T). Rather than asking for mass and spring stiffness separately, the calculator works purely from amplitude, period, and time — so it applies to any SHM system regardless of what's physically oscillating, as long as you know how long one cycle takes. Because no mass is supplied, the kinetic, potential, and total energy outputs are given per unit mass (in units of velocity-squared, not joules) — multiply by your system's actual mass in kilograms to get real energy in joules.
Notice that potential plus kinetic energy always equals the constant total energy, a direct check that the simulation conserves energy correctly at every instant. The phase constant lets you shift where in the cycle t = 0 falls; leaving it at zero starts the object at maximum positive displacement. A common mixup is confusing period (time per cycle) with frequency (cycles per second) — they're reciprocals, and this calculator derives frequency for you so you only ever need to supply one. Maximum velocity and acceleration occur at the equilibrium point and at the endpoints of travel, respectively, never at the same instant.
Inputs
Results
Displacement (m)
0
Velocity (m/s)
-0.31
How to Use This Calculator
- Enter amplitude (m) — the maximum displacement from equilibrium.
- Enter period (s) — the time for one complete oscillation.
- Enter time (s) at which to evaluate the motion and the phase constant (rad).
- Read displacement (m) and velocity (m/s) at the specified time.
- Review angular frequency (rad/s), maximum velocity (m/s), and maximum acceleration (m/s2).
How the result changes with Period (s)
| Period (s) | Displacement (m) | Velocity (m/s) |
|---|---|---|
| 1 | -0.1 | -0 |
| 1.5 | -0.05 | -0.36 |
| 3 | 0.05 | -0.18 |
| 5 | 0.08 | -0.07 |
What each input means
- Amplitude (m)
- Maximum displacement from equilibrium.
- Period (s)
- Time for one complete oscillation.
- Time (s)
- Time at which to evaluate position/velocity/acceleration.
- Phase Constant (rad)
- Initial phase offset in radians.
What each result means
- Displacement (m)
- x(t) = A·cos(ωt + φ).
- Velocity (m/s)
- v(t) = -Aω·sin(ωt + φ).
- Acceleration (m/s²)
- a(t) = -Aω²·cos(ωt + φ).
- Frequency (Hz)
- f = 1/T.
- Angular Frequency (rad/s)
- ω = 2π/T.
- Max Velocity (m/s)
- v_max = Aω at equilibrium.
- Max Acceleration (m/s²)
- a_max = Aω² at endpoints.
How this is calculated
Worked example, using the default values
- Identify Input Parameters4 parametersAmplitude (m) = 0.1, Period (s) = 2, Time (s) = 0.5, Phase Constant (rad) = 0 = 4 input(s) provided
- Calculate Displacement0 = 0
- Calculate Velocity-0.31416 = -0.31416
- Calculate Acceleration0 = 0
- Calculate FrequencyFrequency = 1 / periodS0.5 = 0.5
Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why does the calculator ask for period instead of mass and spring stiffness?
Because the sinusoidal solution for position, velocity, and acceleration only ever needs the angular frequency ω, and ω is derived directly from the period as ω = 2π/T. Mass and spring stiffness (or pendulum length and gravity) are two of the many possible ways to produce a given period, but once you know T, none of those underlying details change the shape of the motion — so the calculator skips straight to the period you'd measure with a stopwatch.
Why are the kinetic, potential, and total energy outputs not in joules?
The engine never asks for mass, so it computes energy per unit mass instead — kinetic energy as ½v², potential energy as ½ω²x², and total energy as ½ω²A², all in units of velocity-squared rather than joules. Multiply any of these by your system's actual mass in kilograms to convert to real energy; the ratio between them stays valid regardless of mass.
What does changing the phase constant actually do to the motion?
The phase constant φ shifts where in the oscillation cycle the object sits at t = 0, since displacement is computed as A·cos(ωt + φ). Leaving it at zero starts the object at maximum positive displacement (x = A) with zero velocity; a nonzero phase moves that starting point earlier or later in the cycle without changing the amplitude, period, or energy of the motion.
At what point in the motion is velocity at its maximum, and where is acceleration highest?
Maximum velocity, A·ω, occurs when the object passes through equilibrium (x = 0), because that's where the restoring force — and therefore deceleration — is momentarily zero. Maximum acceleration, A·ω², occurs at the two endpoints of travel where displacement is greatest, since acceleration is always proportional to displacement and directed back toward equilibrium. The two maxima never happen at the same instant.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Pendulum Calculator
Calculate the period and frequency of a simple pendulum from its length and local gravitational acceleration using T = 2π√(L/g).
Quantum PhysicsSchrodinger Equation Calculator
Calculate energy eigenvalues, wave functions, and quantum states for infinite wells and harmonic oscillators.
Music TheoryHarmonic Analysis Calculator
Analyze a chord progression by determining scale degrees and identifying common patterns.
PhysicsFluid Dynamics (Bernoulli) Calculator
Apply Bernoulli's equation to calculate pressure or velocity changes in an ideal fluid between two points at different heights.
PhysicsBuoyancy Calculator
Calculate the buoyant force, net force, and whether an object floats or sinks using Archimedes' principle: F_b = ρ_fluid × V × g.
More in Science & Physics.