PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Classical Mechanics

Other simulators in this category — or see all 85.

View category →
Kids

Buoyancy Simulator

Drop objects in water. Float or sink based on density.

Launch Simulator
NewSchool

Bernoulli Flow

Pipe narrows: speed up, pressure down. Continuity + Bernoulli.

Launch Simulator
NewSchool

Hydraulic Press

Pascal: same pressure, large piston → large force. F₂ = F₁·A₂/A₁.

Launch Simulator
NewUniversity / research

Rocket Propulsion

Variable mass: thrust ṁu, Tsiolkovsky Δv, vertical launch with gravity.

Launch Simulator
NewSchool

Angular Momentum

Two masses on a rod: I = 2mr², change r or m and watch ω adjust to keep L constant.

Launch Simulator
NewSchool

Rolling & Sliding Disk

No-slip v = ωR vs sliding: translational vs rotational KE, disk vs hoop inertia.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Classical Mechanics/Forced Oscillator

Forced Oscillator

A forced, damped harmonic oscillator is a fundamental model in classical mechanics that describes how a system, like a mass on a spring, responds when subjected to an external driving force while also experiencing friction. The core equation of motion is the second-order linear differential equation: m * d²x/dt² + b * dx/dt + k * x = F₀ * cos(ω_d * t). Here, m is the mass, b is the damping coefficient, k is the spring constant, F₀ is the amplitude of the driving force, and ω_d is its angular frequency. The simulator solves this equation in real-time, visually plotting the displacement x(t) versus time. Initially, the motion is a superposition of the transient solution—which depends on initial conditions and decays exponentially due to damping—and the steady-state solution, which persists as long as the driving force is applied. The steady-state response is sinusoidal with the same frequency as the driver, ω_d, but with a phase lag φ: x_ss(t) = A(ω_d) * cos(ω_d * t - φ). The key learning outcome is exploring the resonance curve, A(ω_d). The amplitude A peaks sharply when the driving frequency ω_d approaches the system's natural frequency ω₀ = √(k/m), provided damping is light. The simulator allows users to adjust parameters like m, k, b, F₀, and ω_d to observe how each affects the transient behavior, the steady-state amplitude, the sharpness of resonance, and the phase relationship between driver and oscillator. Simplifications include assuming linear damping (viscous drag proportional to velocity) and a perfectly sinusoidal driving force. This model is a cornerstone for understanding phenomena from the tuning of radio circuits to the vibration absorption in mechanical engineering.

Who it's for: Undergraduate physics and engineering students studying classical mechanics, oscillations, and differential equations.

Key terms

  • Damped Harmonic Oscillator
  • Resonance
  • Driving Force
  • Natural Frequency
  • Transient Response
  • Steady State
  • Amplitude
  • Phase Lag

Live graphs

Oscillator & drive

1.5 kg
24 N/m
0.45 N·s/m
2.8 N
3.8 rad/s

Initial conditions

0 m
0 m/s

After transients, amplitude follows the Lorentzian-like resonance curve (inset). Pink marker: current ω and analytic steady amplitude. Compare to half-peak–half-trough estimate from the last ~2 s of x(t).

Shortcuts

  • •Space or Enter — run
  • •R — reset

Measured values

ω₀ = √(k/m)4.0000rad/s
Damping ratio ζ = b/(2√mk)0.0375
Steady amplitude A(ω) (theory)0.96611m
≈ amplitude from last cycles0.00000m
x0.0000m
t0.00s

How it works

A damped harmonic oscillator driven by a sinusoidal force shows transient motion followed by steady oscillations at the drive frequency. The steady-state amplitude versus drive frequency peaks near the natural frequency ω₀ = √(k/m); damping broadens and lowers the peak. The analytic amplitude uses the standard harmonic-steady formula; numerical integration (RK2) shows the same long-time behavior after transients decay.

Key equations

mẍ + bẋ + kx = F₀ cos(ωt)
A = (F₀/m) / √((ω₀² − ω²)² + (bω/m)²) · ω₀² = k/m

Frequently asked questions

Why does the oscillation amplitude eventually become constant, even with damping?
The damping force continuously dissipates energy, but the external driving force does work on the system, inputting energy. After an initial transient period, a balance is reached where the energy input per cycle from the driver exactly equals the energy lost per cycle to damping. This results in a steady-state oscillation with constant amplitude.
What is the difference between the natural frequency and the resonant frequency?
The natural frequency, ω₀ = √(k/m), is the frequency at which the system would oscillate if there were no damping or driving force. The resonant frequency, ω_r, is the driving frequency at which the steady-state amplitude is maximum. For light damping, ω_r is very close to ω₀, but for heavier damping, ω_r is slightly lower than ω₀.
How does increasing the damping affect the resonance curve?
Increasing the damping coefficient (b) broadens the resonance peak and reduces its maximum height. A heavily damped system has a large range of driving frequencies that produce a significant response, but the maximum amplitude at resonance is much smaller. In contrast, light damping produces a very tall, narrow peak, indicating a more selective and dramatic resonance.
Can this model describe a child being pushed on a swing?
Yes, it's an excellent analogy. The swing is the oscillator (with a natural frequency), air resistance provides damping, and the pushes are the periodic driving force. To maximize amplitude (resonance), you must push at the swing's natural frequency. The model simplifies the push to a perfect cosine force, whereas a real push is a brief impulse, but the overall resonance phenomenon is the same.