Simple Harmonic Motion Simulator — Spring-Mass Oscillator & Damping Interactive

Interactive physics simulator running a spring-mass oscillator on a linear guide, comparing undamped, underdamped, critically damped and overdamped return using adjustable mass, stiffness, initial displacement and viscous damping, with energy-exchange charts, a model-verification bench and a knowledge-check quiz.

← Mathematics in 3D Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Simple Harmonic Motion Simulator

This simulator releases a mass from a chosen displacement on a spring-and-dashpot system constrained to a horizontal guide, then numerically integrates its motion under Hooke's law and viscous damping. Sweep the damping coefficient from zero to see the full range from ideal oscillation through underdamped ringing to a slow, non-oscillating overdamped return.

What the simulator shows

• A real-time 3D view of the fixed anchor and horizontal guide, the helical restoring spring, the sliding mass carriage released from rest, a viscous dashpot piston, and an equilibrium scale with energy bars, with home view, focus-selected-part, auto-rotate, expand and toggleable labels. • Four live sliders: moving mass (0.5 to 4 kg), spring stiffness k (2 to 30 N/m), initial displacement (−1.5 to 1.5 m, released from rest), and viscous damping coefficient b (0 to 8 N·s/m). • Play/pause, single-step and larger-step time controls, plus a playback-speed selector from 0.1x to 60x laboratory speed. • Three actions: restart trial, resume motion, and pause motion. • Ten live metrics: displacement, velocity, acceleration, spring force, damping force, mechanical energy, energy dissipated, the undamped natural period, the damping ratio ζ, and the damped oscillation period (where defined). • A Curves & measurements tab with an energy-exchange chart and a phase-portrait chart, the full model equations, and snapshot measurements. • An Experiments tab with four guided scenarios (ideal oscillator, mass scaling, critical damping, overdamped return), a model-verification bench of independent automated checks, and a timestamped event log with a copyable trial report. • A Learn & assess tab with four guided lessons, a two-question knowledge-check quiz, and a written scope/reference statement linking to OpenStax University Physics.

How stiffness, mass and damping set the response

Hooke's law gives a restoring spring force Fs = −kx that always points back toward equilibrium and vanishes exactly at x = 0, while the dashpot contributes a damping force Fd = −bv opposing whatever velocity the mass currently has. Combined, they produce the governing equation mx″ + bx′ + kx = 0. Without damping, the natural angular frequency is ωn = √(k/m) — so quadrupling the mass exactly doubles the natural period, since period scales with the square root of mass, which the mass-scaling experiment demonstrates directly.

The damping ratio ζ = b / [2√(km)] classifies the response into three regimes: ζ < 1 is underdamped, where the system oscillates with a damped period ωd = ωn√(1−ζ²) while its amplitude decays; ζ = 1 is critically damped, the fastest return to equilibrium without any oscillation at all; and ζ > 1 is overdamped, a slower, still non-oscillating return. A damped oscillation period is only defined for ζ < 1 — the simulator correctly reports it as unavailable at and beyond critical damping, since there's no repeating cycle left to measure.

Reading the energy chart and running experiments

The energy-exchange chart tracks how spring potential energy ½kx² and kinetic energy ½mv² trade off as the mass swings through equilibrium, while their sum — the total mechanical energy E = ½mv² + ½kx² — holds constant when damping is zero and steadily decreases whenever b > 0, with that reduction reported directly as energy dissipated. The equations panel also states the governing differential equation, both force laws, and the natural and damped period/frequency relationships.

The four built-in experiments walk through an undamped ideal oscillator with a verifiable period of 2π/√12 ≈ 1.814 s, a mass-quadrupling comparison that doubles the period, an exactly critically damped return (ζ = 1, m = 1, k = 4, b = 4), and an overdamped case (ζ = 2) that returns more slowly than critical damping without oscillating. The model-verification bench in the Experiments tab independently checks natural frequency, damping-ratio classification and energy relationships against fresh model instances integrated with RK4, leaving your current trial untouched.

Frequently asked questions

Where is the spring force zero in this simulator?

The ideal spring force follows Hooke's law, Fs = −kx, which is exactly zero at the equilibrium position x = 0 — not at maximum displacement, where the restoring force is actually at its largest magnitude. The mass keeps moving through equilibrium because of its momentum, not because a force is still pushing it there.

Does an overdamped system have an oscillation period?

No. An overdamped system (damping ratio ζ greater than 1) returns to equilibrium without ever oscillating, so there is no repeating cycle to measure and no damped period is defined. Only underdamped systems, where ζ is less than 1, have a well-defined damped oscillation period ωd = ωn√(1−ζ²).

Why does quadrupling the mass only double the oscillation period?

The undamped natural period is Tn = 2π/ωn, where ωn = √(k/m). Because mass appears inside a square root, the period scales with the square root of mass rather than mass itself — quadrupling m multiplies √m by 2, so the period exactly doubles, which the built-in mass-scaling experiment lets you verify directly.

What does this spring-mass model not include?

This is a linear Hookean-spring teaching model with a point mass, an ideal viscous damper and a frictionless horizontal guide. It does not model the spring's own mass, mechanical stops, or coil-to-coil contact, and the dynamics are integrated using RK4 with time steps no larger than 0.005 s; the damped period metric is intentionally left unavailable whenever the damping ratio reaches or exceeds 1.

Related tools & guides