SHM Calculator
Calculate displacement, velocity, acceleration, period, angular frequency, and maximum values for simple harmonic motion using x = A cos(ωt + φ).
Try an example
Simple Harmonic Motion Spring–Mass Diagram
The mass moves repeatedly about equilibrium. Its displacement is x, and its maximum distance from centre is amplitude A.
Step-by-Step SHM Solution
Here's exactly how this answer was calculated, one step at a time.
Given: A = 0.1 m, f = 2 Hz, t = 0.125 s, φ = 0°
Step 1: Calculate angular frequency
Angular frequency connects the ordinary frequency in hertz to the oscillator's phase in radians.
ω = 2πf = 2π × 2 = 12.566371 rad/sStep 2: Calculate the phase at time t
The phase identifies the oscillator's point in its repeating cycle.
θ = ωt + φ = (12.566371 × 0.125) + 0° = 1.570796 radStep 3: Calculate displacement
Displacement is measured from the equilibrium position; it is positive on one side and negative on the other.
x = A cos(ωt + φ) = 0 mStep 4: Calculate velocity and acceleration
Velocity is greatest near equilibrium, while restoring acceleration is greatest at the turning points.
v = -Aω sin(θ) = -1.256637 m/s; a = -Aω² cos(θ) = -0 m/s²
The simple harmonic motion state is:
x = 0 m, v = -1.256637 m/s, a = -0 m/s²
Free Simple Harmonic Motion Calculator
This SHM Calculator finds displacement, velocity, acceleration, period, angular frequency, maximum speed, and maximum acceleration for a simple harmonic oscillator. Enter amplitude, frequency, time, and an optional initial phase. The calculator applies the standard equation x = A cos(ωt + φ) and provides a copyable step-by-step solution for every live result.
The spring–mass diagram makes the motion visual. It displays the equilibrium position, the amplitude limits, and the calculated current displacement of the mass. Use this free simple harmonic motion calculator for school and college physics, laboratory work, springs, vibrations, waves, and basic oscillator analysis.
What Is Simple Harmonic Motion?
Simple harmonic motion, usually called SHM, is a repeating back-and-forth motion in which the restoring force is proportional to displacement and points toward equilibrium. The classic examples are a mass on an ideal spring, a small-angle pendulum, a vibrating tuning fork, and electrical oscillations in an ideal LC circuit.
At equilibrium, the net restoring force is zero and the object moves fastest. At either turning point, displacement is greatest, velocity is zero, and restoring acceleration has its greatest magnitude toward the centre. This continuous exchange between kinetic and potential energy gives SHM its smooth sinusoidal pattern.
SHM Displacement Formula
A common displacement equation is x = A cos(ωt + φ). x is displacement from equilibrium in metres; A is amplitude in metres; ω is angular frequency in radians per second; t is time in seconds; and φ is the initial phase angle. The calculator uses degrees for easy input and converts phase to radians internally.
Cosine is only a convention. You may see x = A sin(ωt + φ) instead. Both describe the same physical motion when phase is chosen consistently. If φ = 0 in the cosine form, the object begins at positive maximum displacement. The amplitude is always the maximum absolute value of displacement.
Angular Frequency, Frequency, and Period
Ordinary frequency f counts cycles per second and is measured in hertz. Period T is seconds per cycle. They are reciprocals: T = 1/f and f = 1/T. Angular frequency gives the phase change rate in radians per second: ω = 2πf = 2π/T. One full cycle contains 2π radians.
For an oscillator at 2 Hz, the period is 0.5 s and angular frequency is 4π rad/s, about 12.566 rad/s. Keeping hertz and radians per second distinct is important. Frequency tells the number of full cycles, while angular frequency is designed for equations involving sine and cosine.
Velocity and Acceleration in SHM
Differentiate the displacement equation to obtain velocity: v = −Aω sin(ωt + φ). Differentiate again for acceleration: a = −Aω² cos(ωt + φ). Since x = A cos(ωt + φ), acceleration can also be written a = −ω²x. The minus sign shows that acceleration always points back toward equilibrium.
Maximum speed is vmax = Aω and occurs at x = 0. Maximum acceleration is amax = Aω² and occurs at x = ±A. At the turning points, the object pauses briefly before reversing direction, so velocity is zero. These relationships give useful checks on any SHM velocity or acceleration calculation.
Spring–Mass SHM Formulas
For an ideal horizontal spring with mass m and spring constant k, the angular frequency is ω = √(k/m). The period is T = 2π√(m/k). A stiffer spring increases frequency, while a larger mass reduces frequency. These formulas assume a linear spring, negligible friction, and motion along one direction.
The restoring force obeys Hooke's law, F = −kx. Combining it with Newton's second law produces a = −(k/m)x, which has the same shape as a = −ω²x. This is why the spring–mass system is a standard model of simple harmonic motion.
Energy in Simple Harmonic Motion
In ideal SHM, total mechanical energy remains constant. For a spring, total energy is E = ½kA². At maximum displacement, the energy is entirely elastic potential energy and velocity is zero. At equilibrium, spring potential energy is smallest and kinetic energy is greatest.
Real systems lose energy to air resistance, friction, and internal damping. Their amplitude gradually shrinks, so the motion is not perfectly simple harmonic forever. The calculator describes the ideal undamped model, which is an excellent approximation for many short-duration experiments and textbook problems.
How to Use the SHM Calculator
Enter positive amplitude in metres, frequency in hertz, the time at which you want the state, and optional phase in degrees. The calculator derives angular frequency, phase, displacement, velocity, acceleration, period, and maximum values. The full working can be copied with the Copy full solution button.
For example, with A = 0.1 m, f = 2 Hz, and t = 0.125 s with zero phase, the phase is π/2 radians. Displacement is zero, speed has maximum magnitude, and acceleration is zero. This agrees with the diagram: passing through equilibrium is the fastest part of an ideal oscillation.
Applications of SHM
Simple harmonic motion appears in vehicle suspension, musical instruments, clocks, sensors, seismometers, quartz resonators, atomic vibrations, and electrical circuits. Engineers use oscillator frequency to control timing and measure small changes in mass, force, or acceleration. In music, vibration frequency determines pitch.
The exact SHM model is most reliable for small oscillations and linear restoring forces. A pendulum follows SHM closely only at small angles. Large swings, nonlinear springs, damping, driving forces, and changing mass require more advanced models. Still, SHM provides the essential starting point for understanding repeating physical motion.
Common SHM Calculation Mistakes
Do not mix ordinary frequency f with angular frequency ω. Convert using ω = 2πf before placing a frequency inside sine or cosine. Convert degrees to radians when evaluating a phase mathematically. Also keep amplitude, displacement, and velocity units separate: metres, metres per second, and metres per second squared are not interchangeable.
Remember that displacement and velocity may be negative because direction matters, while amplitude and maximum values are non-negative magnitudes. Check that |x| never exceeds A. If calculated acceleration is not opposite in sign to displacement, revisit the phase or formula. These checks make SHM answers much easier to verify.
SHM Calculator FAQ Summary
SHM is periodic motion with a restoring effect proportional and opposite to displacement. Use x = A cos(ωt + φ), v = −Aω sin(ωt + φ), and a = −ω²x. Frequency, period, and angular frequency are linked by T = 1/f and ω = 2πf. This calculator gives each quantity with clear formula steps and a visual spring–mass model.
Frequently Asked Questions
What is the equation for SHM?
A common form is x = A cos(ωt + φ), where A is amplitude, ω is angular frequency, and φ is initial phase.
How do I find angular frequency?
Multiply frequency by 2π: ω = 2πf.
What is the SHM acceleration formula?
a = −ω²x, or a = −Aω² cos(ωt + φ).
Where is velocity maximum in SHM?
At equilibrium, where displacement is zero.
Where is acceleration maximum in SHM?
At the turning points, where displacement equals positive or negative amplitude.
Does a real pendulum always show SHM?
It is close to SHM only for small swing angles and low damping.