MechSimulator

Simple Harmonic Motion

x(t) = A cos(ωt + φ) — Simulate, Explore, Practice & Quiz

Mode
📖 User Guide
System
Graph
2.0 kg
50 N/m
1.0 m
0.20 m
ω (rad/s)
5.00
Frequency (Hz)
0.80
Period (s)
1.26
x (m)
0.200
v (m/s)
0.000
a (m/s²)
-5.00
Presets
User Guide — Simple Harmonic Motion Simulator
1 Overview

This free simple harmonic motion period formula simulator lets you explore SHM through two classic systems: a vertical spring-mass oscillator and a simple pendulum. The interactive canvas shows the physical animation on the left and a live waveform graph on the right, plotting displacement x(t), velocity v(t), acceleration a(t), or energy curves in real time as the system oscillates.

All key SHM parameters are calculated instantly: angular frequency ω, frequency f, period T, instantaneous displacement, velocity, and acceleration. Whether you are studying the relationship T = 2π√(m/k) for springs or T = 2π√(L/g) for pendulums, this tool provides visual confirmation of every formula.

2 Getting Started

The simulator opens in Simulate mode with the Spring-Mass system active (m = 2 kg, k = 50 N/m, A = 0.2 m). The mass oscillates immediately, and the waveform graph traces x(t) in real time. Six readout cards display ω, frequency, period, displacement, velocity, and acceleration.

Use the System pills to switch between Spring-Mass and Pendulum. The Graph pills toggle between x(t), v(t), a(t), and Energy views. Sliders for mass, spring constant (or pendulum length), and amplitude are below the canvas. Presets like Clock Pendulum, Car Suspension, Tuning Fork, and Heavy Spring load realistic configurations instantly.

3 Simulate Mode

Spring-Mass system: Adjust mass m (0.5–10 kg), spring constant k (5–200 N/m), and amplitude A (0.05–0.5 m). The animation shows the mass bouncing on a vertical spring while the graph traces the selected waveform. Increase mass to see the period T lengthen; increase k to see it shorten — confirming ω = √(k/m).

Pendulum system: Adjust length L (0.3–3 m) and amplitude. The period depends only on length and gravity: T = 2π√(L/g). Mass does not affect the pendulum’s period (for small angles), which you can verify by changing mass and observing no change in ω.

Energy graph: Select the Energy view to see kinetic and potential energy oscillate out of phase while total energy remains constant — a visual demonstration of energy conservation in SHM.

Press Reset to restart the animation from t = 0 with the current parameters.

4 Explore Mode

Explore mode provides concept cards across three categories: Fundamentals (SHM definition, angular frequency, period, frequency, phase), Energy (KE, PE, total energy, energy conservation), and Applications (pendulum clocks, spring-mass dampers, musical instruments). Each card has a formula, a canvas diagram, and a worked numerical example.

Key equations covered include x(t) = A·cos(ωt + φ), v(t) = −Aω·sin(ωt), a(t) = −ω²x, PE = ½kx², and KE = ½mv². This mode bridges the gap between formula memorisation and physical understanding.

5 Practice & Quiz

Practice mode generates unlimited random SHM problems: find the period of a spring-mass system, calculate maximum velocity from amplitude and ω, determine the energy stored at maximum displacement, or compute pendulum length for a target period. Step-by-step solutions are shown for incorrect answers.

Quiz mode presents 5 randomised questions mixing conceptual and numerical items about SHM parameters, energy transformations, and system comparisons. A detailed score with per-question breakdown is shown at the end of each quiz.

6 Tips & Best Practices
  • Toggle between graph types to see how displacement, velocity, and acceleration relate — velocity leads displacement by 90°, and acceleration is 180° out of phase.
  • Double the mass and observe the period increase by a factor of √2 — confirming the square-root dependency in T = 2π√(m/k).
  • Switch to Energy view to watch KE and PE exchange in real time, with total energy remaining flat.
  • Use the Pendulum system to verify that period is independent of mass and amplitude (for small angles).
  • Try the presets — the Clock Pendulum has L = 0.25 m giving exactly T = 1 s, the standard for pendulum clocks.
  • The simulator runs at 60 fps for smooth animation — pause by switching to Explore mode if you need to study a frozen frame.

What Is Simple Harmonic Motion (SHM)?

Simple Harmonic Motion is a fundamental type of periodic oscillation where the restoring force acting on an object is directly proportional to its displacement from an equilibrium position and always directed towards that equilibrium. Described by the equation x(t) = A cos(ωt + φ), SHM appears throughout mechanical engineering, physics, and everyday life — from the oscillation of a spring-mass system to the swing of a pendulum. Understanding SHM is essential for studying vibrations, wave mechanics, alternating current circuits, and structural dynamics.

This interactive simulator lets you explore SHM with two classic systems: a vertical spring-mass and a simple pendulum. Adjust mass, spring constant, length, and amplitude to see how the motion parameters change in real time. The waveform chart displays displacement, velocity, acceleration, or energy graphs alongside the animated physical system.

Key Equations of SHM

For a spring-mass system, the angular frequency is ω = √(k/m), where k is the spring constant and m is the mass. The period is T = 2π/ω and the frequency is f = 1/T. Displacement, velocity, and acceleration are related by: v(t) = −Aω sin(ωt) and a(t) = −Aω² cos(ωt) = −ω²x(t). For a simple pendulum of length L, the angular frequency is ω = √(g/L) for small-angle oscillations.

Energy in SHM

In an ideal SHM system with no damping, total mechanical energy is conserved. At maximum displacement, all energy is potential (PE = ½kx²); at the equilibrium position, all energy is kinetic (KE = ½mv²). The total energy E = ½kA² remains constant throughout the cycle. The energy graph in this simulator shows the continuous exchange between kinetic and potential energy as the mass oscillates.

Who Uses This Simulator?

This SHM simulator is designed for mechanical engineering students, physics learners, technical trainees, and instructors teaching oscillatory motion. Whether you are preparing for exams, building intuition about periodic systems, or demonstrating concepts in a classroom, this tool provides an interactive, visual approach to mastering Simple Harmonic Motion.

Explore Related Simulators

If you found this Simple Harmonic Motion simulator helpful, explore our Vibrations simulator, Hooke’s Law simulator, Spring Design simulator, and Newton’s Laws simulator for more hands-on practice.