Simple Harmonic Motion Oscillator

Visualize SHM for a spring or a small-angle pendulum. Graphs for position and velocity over time.

Inputs
T: ω: f₀: Hz
Derived Values
Natural frequency f₀:
Period T₀:
Damping ratio ζ:
From f,m → k: N/m
From f → L (pendulum):
Detuning |fd − f₀|:
Formulas
x(t) = A cos(2π f t)
v(t) = −A · 2π f · sin(2π f t)
Period: T = 1 / f
Spring mode: k = (2π f)² · m ⇔ f = (1/2π)√(k/m)
Pendulum mode (small angle): L ≈ g / (4π² f²)
Animation
Outputs
FAQ & Teaching Notes
Quick Start (Students)

Use presets and watch how position, velocity, and energy change.

  • Press Run with “Spring: A=0.1, f=1” and relate the animation to x(t), v(t).
  • Mark when v(t)=0 and point out turnarounds in the animation.
  • Change A: the period stays the same, peaks get taller (E ∝ A²).
Teacher Tips

Prompt predictions, then validate with the graphs and calculators.

  • Spring: double k or m; use chips (T, ω, f₀) to predict the new period.
  • Pendulum (small): vary L and estimate T from T≈2π√(L/g); mass cancels.
  • Use Phase to show v leads x by ~90°; damping spirals inward.
Common Misconceptions

Amplitude ≠ period; small‑angle pendulum period doesn’t depend on mass.

  • Double A: period stays fixed; energy E grows (~A²); v(t) peaks increase.
  • Pendulum mass change: no period change; only L and g matter (small angle).
Damping & Driving
Damping shrinks amplitude and total energy (Energy tab) and produces inward spirals in Phase. A periodic drive sustains motion; near resonance amplitude grows and phase shifts toward 90°.
Estimating f₀ fast
Spring: f₀=(1/2π)√(k/m). Pendulum (small): f₀≈(1/2π)√(g/L). Use the chips and the Derived Values card to verify against the x(t) plot.
Resonance Activity
Use Driven mode and vary fd around f₀. Sketch amplitude vs fd and discuss how damping reduces the peak and broadens the curve.
What is SHM?
Simple Harmonic Motion is motion under a restoring force proportional to displacement and directed toward equilibrium (F = −kx). The result is sinusoidal motion x(t)=A cos(ωt+φ), where ω depends on system parameters (e.g., ω=√(k/m) for a mass–spring, ω≈√(g/L) for a small‑angle pendulum). It conserves total mechanical energy in the ideal (undamped) case.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.

About This Tool & Methodology

Models simple harmonic motion (mass–spring or pendulum approximations) using SI units to compute period, frequency, displacement, velocity, and acceleration as functions of time.

Learning Outcomes

  • Relate period/frequency to system parameters (m, k, L, g).
  • Understand phase relationships among x, v, a.
  • Practice units and small‑angle approximations where relevant.

Authorship

  • Author: Anish Nath — Follow on X
  • Last updated: 2025-11-19

Trust & Privacy

  • Runs locally in your browser.