Simple Harmonic Motion Calculator (Spring-Mass & Pendulum)

Calculate the period, frequency, and angular frequency of a spring-mass system or a simple pendulum, and visualize how displacement, velocity, and acceleration change over time. Learn the physics of oscillation from spring constant and mass, or pendulum length and gravity.

Tips

  • A spring-mass system's period depends only on the spring constant and mass, not the amplitude. Try changing the amplitude and notice how the period stays the same on the graph.
  • The pendulum formula T=2π√(L/g) is only accurate for small swing angles (roughly under 15°). Larger angles make the real period longer than this calculated value.
  • Mass has no effect at all on a simple pendulum's period. A heavier or lighter bob on the same length string will swing with the same period.
  • Switch gravity to "Moon" to see how the same pendulum length produces a longer period than on Earth — weaker gravity means a weaker restoring force, so the swing is slower.
  • Notice on the graph that velocity is zero exactly when displacement is at its peak or trough — this visually shows the 90-degree phase difference between displacement and velocity.

Frequently Asked Questions

Solving the equation of motion m(d²x/dt²)=-kx gives an angular frequency ω=√(k/m) that contains no amplitude term. A larger amplitude means a larger displacement, but Hooke's law also makes the restoring force proportionally larger, so the acceleration scales the same way — the time for one full cycle stays constant. This property is called the "isochronism" of simple harmonic motion, and it's the same principle Galileo noticed underlying pendulum clocks.

The exact equation of motion for a pendulum contains a sinθ term, which is hard to solve directly. When θ is small, sinθ≈θ (the small-angle approximation) holds, simplifying the equation into the same form as simple harmonic motion and yielding the clean formula T=2π√(L/g). Once the swing angle exceeds roughly 15°, the gap between sinθ and θ becomes significant, and the real period grows longer than this formula predicts.

Both systems are driven by a restoring force proportional to displacement and directed opposite to it. For a spring, that's Hooke's law (F=-kx); for a pendulum under the small-angle approximation, it's the tangential component of gravity (F≈-mg/L·x). Because both share this same structure, both can be described by the same formula, angular frequency ω=√(restoring force constant / inertial term).

No. Mass appears on both sides of the pendulum's equation of motion and cancels out during derivation, so it never appears in the final formula T=2π√(L/g). This is the same property Galileo is said to have confirmed by experimenting with pendulums of different weights.

Since the period is proportional to the square root of the length, doubling the length multiplies the period by √2 (about 1.41 times). A useful shortcut: quadrupling the length exactly doubles the period.
ツールくん

Side Note — Galileo and the Swinging Lamp

A famous story often used to introduce simple harmonic motion involves a young Galileo Galilei watching a swinging chandelier in a cathedral. Using his own pulse as a timer, he is said to have noticed that even as the swing gradually grew smaller, the time for each full swing barely changed. This observation is widely credited as an early step toward the invention of the pendulum clock and the broader mathematical description of oscillation in physics.

Spring-mass systems and pendulums look and move very differently, but mathematically both are governed by the same underlying property: a restoring force proportional to displacement (a linear, Hooke's-law-like relationship). Because of this shared structure, the theory of simple harmonic motion extends far beyond springs and pendulums — to tuning fork vibrations, LC oscillations in AC circuits, and even models of molecular bonds.

Real springs and pendulums gradually lose amplitude to friction, air resistance, and internal material damping — a phenomenon called damped oscillation. The idealized simple harmonic motion modeled by this tool assumes no energy loss. Measuring a pendulum's period to determine the local gravitational acceleration g remains a classic physics classroom experiment, offering a hands-on connection between this formula and real-world measurement.