---
title: "Driven Resonance & Phase Lag Interactive Lab | Sandbox Physics"
description: "Do a driven oscillator's largest swing and largest power intake happen at the same frequency? Not quite. With damping, the displacement peaks slightly below the natural frequency. The power absorbed from the drive peaks exactly at the natural frequency, and that is also where the motion lags the drive by a quarter cycle. Wait for the start-up transient to die out before measuring any of them."
canonical_url: "https://sandboxphysics.com/labs/driven-resonance/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/driven-resonance/"
last_modified: "2026-10-22"
---

M064 · Oscillations / frequency response

# Driven Resonance & Phase Lag

**Do a driven oscillator's largest swing and largest power intake happen at the same frequency?** Not quite. With damping, the displacement peaks slightly below the natural frequency. The power absorbed from the drive peaks exactly at the natural frequency, and that is also where the motion lags the drive by a quarter cycle. Wait for the start-up transient to die out before measuring any of them.

A force actuator pushes a mass on a spring and dashpot with a sinusoidal force. Drag the frequency cursor, watch the startup transient fade, and measure amplitude and phase over three complete drive cycles. Sweep nineteen independently simulated runs and compare them with the exact response curve, while tracking drive work, dissipated energy and stored energy.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The mass moves on a horizontal track, attached to a massless spring that obeys Hooke’s law and slowed by linear viscous damping with a positive coefficient. The actuator applies the model’s sinusoidal force directly; it does not move the spring anchor. Scene lengths are rescaled to fit the full computed motion. The actuator, arrows, spring and other hardware are schematic, and collisions and deformation of the spring wire are not simulated. Displacement and absorbed power peak at different frequencies, and the bandwidth shown is the exact half-maximum width of the absorbed-power peak. A three-cycle Fourier measurement can still contain a transient; its residual measures the part of the signal that is not a sinusoid at the drive frequency, not measurement uncertainty. Each scan point waits at least eight nominal decay times, unless that would exceed the 200-second cap. The exact response is the steady state reached after infinite time.

Physics tutorial

## Separate resonance from startup

**Background** A periodic drive keeps feeding energy in while damping takes it out. The motion is a startup transient that dies away plus a steady response at the drive frequency. Amplitude alone misses the phase and the balance of power.

**Why it matters** The theory of forced oscillation follows OpenStax University Physics Volume 1, section 15.6. The Lab builds the response curve the way an experiment would: nineteen independent simulated runs, each measured with a three-cycle Fourier analysis.

Start with the essentials

- **Focus question**: Where is the displacement peak, where is the power peak, and has the measured response settled?
- **One-sentence intuition**: The frequency response depends on which quantity you measure. Wait for the transient to fade, check the projection residual, and compare phase as well as amplitude.

### Core mathematical model

#### Complex frequency response

$$
m\ddot x+c\dot x+kx=F_0\sin(\omega t),\quad A=\frac{F_0}{\sqrt{(k-m\omega^2)^2+c^2\omega^2}}
$$

This exact amplitude belongs to the steady solution reached after infinite time. The actual motion also contains a transient, set by the initial displacement and velocity.

#### Phase and displacement peak

$$
\phi=\operatorname{atan2}(c\omega,k-m\omega^2),\quad\omega_{\mathrm{peak}}=\omega_0\sqrt{1-2\zeta^2}\quad(\zeta<1/\sqrt2)
$$

The displacement lags behind the force. Above the damping threshold shown, the amplitude only falls as the frequency rises from zero. The peak search covers only the displayed scan band, so it can land on the lower edge of the band.

#### Power resonance and its bandwidth

$$
\overline P=\frac{F_0^2c\omega^2}{2[(k-m\omega^2)^2+c^2\omega^2]},\quad\Delta\omega_{P}=\frac cm,\quad Q=\frac{m\omega_0}{c}
$$

Absorbed power peaks at the natural frequency, even when displacement peaks elsewhere. The exact width of the power peak at half its maximum is not the width of the displacement peak at half its height. The bandwidth shown is converted from angular frequency to cycles per second.

#### Three-cycle measurement and energy balance

$$
\widehat A=\sqrt{a_s^2+a_c^2},\quad\widehat\phi=\operatorname{atan2}(-a_c,a_s),\quad E-E_0-W_{\mathrm{drive}}+Q=0
$$

The sine and cosine projections use only the last three complete drive cycles, sampled at 128 evenly spaced phases per cycle. Any startup transient still present distorts the result and shows up in the nonharmonic residual. Drive work and dissipated energy are integrated separately.

### Common difficulties

#### Two different resonance peaks

**Typical misconception** Displacement and absorbed power must peak at the same frequency.

**Better mental model** Increase the damping and find the displacement peak again. Power still peaks at the natural frequency, and with strong damping the displacement curve has no peak above zero frequency at all.

#### Three full cycles can still include a transient

**Typical misconception** Three complete periods automatically measure steady state.

**Better mental model** Measure early and late. The Fourier measurement works at both times, but early on the residual and the phase can show that the startup transient is still there.

#### A bandwidth belongs to one quantity

**Typical misconception** The power bandwidth is the width of the displacement peak at half height.

**Better mental model** The width shown is for absorbed power, and it is exact for this model with viscous damping. It does not carry over to other response curves.

### Run the experiment

1. 01

   #### Watch the startup

   Orbit around the force actuator and step finely to compare the drive force with the velocity. Scrub through the first three drive cycles, then click Measure current frequency, which measures at the end of the run.

   **What to observe:** No measurement is available until a full three-cycle window has passed. Later, the measured amplitude and phase approach the steady reference.

2. 02

   #### Build a response curve

   Click Measure nineteen frequencies, then drag the amplitude cursor across the peak.

   **What to observe:** Each blue point comes from its own independently solved run.

3. 03

   #### Separate amplitude and power

   Increase the damping, find the amplitude peak, and compare the absorbed power at the natural frequency.

   **What to observe:** The displacement peak moves to a lower frequency, while the power peak stays at the natural frequency.

4. 04

   #### Check where the energy goes

   Switch to energy review and, late in the run, compare drive work with dissipated and stored energy. Switching views keeps the scan and the cursor.

   **What to observe:** The drive work can be larger than the energy stored now, because the dashpot keeps removing energy.

Physical conclusion

A response curve is a series of controlled experiments. Its amplitude, phase, residual and energy balance should all tell the same story.

Motion & dynamics · Starter path

## From a falling ball to an orbit

Start by measuring gravity and splitting motion into components. Then add contact forces and collisions, and follow the same laws all the way to an orbit.

[Start here → **Free Fall & Measuring Gravity** Capture a few drops and fit the camera positions to estimate gravitational acceleration. Then add air damping and watch the fit drift from the truth. Observe · 14 min](https://sandboxphysics.com/labs/free-fall/)

1. [1 Free Fall & Measuring Gravity](https://sandboxphysics.com/labs/free-fall/)
2. [2 Projectile Flight Designer](https://sandboxphysics.com/labs/projectile-flight/)
3. [3 Inclined Plane & Friction](https://sandboxphysics.com/labs/inclined-plane/)
4. [4 One-Dimensional Collision Bench](https://sandboxphysics.com/labs/collision-bench/)
5. [5 Mass–Spring Oscillator](https://sandboxphysics.com/labs/mass-spring/)
6. [6 How Orbits Take Shape](https://sandboxphysics.com/labs/orbit/)

[View the full path →](https://sandboxphysics.com/topics/mechanics/#starter-path)
