Skip to main content
Sandbox Physics

Duffing Oscillator Laboratory

Why can the same forcing frequency produce different responses? A nonlinear spring can support more than one stable response to the same drive. Which one you get depends on how the motion started, and in a frequency sweep on whether you came from below or from above. Sweep up and then down, and the response jumps at different places, leaving a band where either response can appear.

A nonlinear spring can sustain two amplitudes under the same drive. Explore hysteresis, phase portraits and motion that repeats every second drive cycle.

Interactive modelDuffing Oscillator Laboratory
Displacement00
Velocity00
Last eight-cycle fundamental00
Retained strobe repetition00
Physical time00
Mechanical energy00
Signed input work00
Viscous dissipation00
Energy balance error00
Half-step displacement change · first four cycles00
Integration step00
Spring force00
Damping force00
Additive force00
Record boundary00
Last eight-cycle nonharmonic RMS00
Last eight-cycle mean00
Centered single-harmonic approximation00
Retained strobes00
Absolute displacement limit00

A spring that remembers the sweep direction

BackgroundA cubic stiffness term makes the frequency depend on the amplitude. With damping and forcing, the same settings can settle into different bounded responses, depending on the history.

Why it mattersBrown University’s Duffing tutorial and York University’s computational physics notes cover cubic restoring forces, phase portraits and forcing. This Lab adds an explicit harmonic projection of the simulated motion, escape from a local well, and a finite frequency sweep in which each run starts from the end state of the previous one.

Focus question
When sweeping up and sweeping down give different results, is that a real stable branch or an effect of the finite recording?
One-sentence intuition
Measure the fundamental, the mean and the nonharmonic residual separately, and compare sweeps that carry the state forward at the same drive phase.

Core mathematical model

Spring and damping forces, and the wells without forcing

Fs=−kx−αx3,Fd=−cx˙,x∗=±−k/α(k<0, α>0)F_s=-kx-\alpha x^3,\quad F_d=-c\dot x,\quad x_*=\pm\sqrt{-k/\alpha}\quad(k<0,\ \alpha>0)

These are the unforced potential minima. A driven mass can move between the wells; the separate potential plot shows their shape.

Equation of motion with a cubic spring

mx¨+cx˙+kx+αx3=F0cos⁡ωtm\ddot x+c\dot x+kx+\alpha x^3=F_0\cos\omega t

The sign of the linear stiffness and the cubic stiffness together decide whether the spring hardens, softens locally or forms a double well.

Potential and energy

U(x)=12kx2+14αx4,E=12mx˙2+U(x)U(x)=\tfrac12kx^2+\tfrac14\alpha x^4,\quad E=\tfrac12m\dot x^2+U(x)

The model uses the full potential, not its quadratic approximation near a minimum.

Single-harmonic amplitude relation

A2[(k−mω2+34αA2)2+(cω)2]=F02A^2\left[\left(k-m\omega^2+\tfrac34\alpha A^2\right)^2+(c\omega)^2\right]=F_0^2

This approximation assumes motion centered on zero and ignores the mean and higher harmonics. It does not say which solutions are stable.

Saddle of the locally softening spring

xb=−k/α(k>0, α<0)x_b=\sqrt{-k/\alpha}\quad(k>0,\ \alpha<0)

Outside this local well the potential falls without limit, so recording stops at the saddle.

Work and heat integrated separately

W˙=F0cos⁡(ωt)x˙,Q˙=cx˙2,E−E0=W−Q\dot W=F_0\cos(\omega t)\dot x,\quad \dot Q=c\dot x^2,\quad E-E_0=W-Q

The drive work, which can be positive or negative, and the heat, which is nonnegative, are integrated along with the motion.

Common difficulties

An approximate solution is not necessarily an attractor

Typical misconceptionEvery solution of the harmonic-balance equation is a stable response you will measure.

Better mental modelThe approximation drops higher harmonics. A simulated release lands in one particular basin and still carries transients.

The memory effect depends on the sweep settings

Typical misconceptionA gap between sweep directions proves an adiabatic bifurcation.

Better mental modelEach point uses only 48 cycles, so the frequency spacing and the settling time can change the result.

Irregular points need stronger evidence

Typical misconceptionA scattered Poincaré record proves chaos.

Better mental modelA finite record that may still contain transients cannot, by sampling alone, establish a positive long-term exponent.

Run the experiment

  1. 01

    Check the linear limit

    Choose Linear resonance and compare the loaded harmonic amplitude with the linear formula. Open Potential, work and dissipation to inspect work and heat.

    What to observe: With the cubic term at zero, the response settles onto the linear result, which is known independently.
  2. 02

    Measure the effect of sweep direction

    Choose Two sustained amplitudes. Compare the independent carriages and the automatically calculated upward and downward sweeps.

    What to observe: Each run starts from the end state of the previous one, at the same drive phase, so the history carries over.
  3. 03

    Compare an open well with a closed one

    Compare Softening spring with Stay in one well, then drag the carriage to change its release.

    What to observe: The softening spring has an edge the cart can escape over, while the quartic double well keeps it confined.
  4. 04

    Record a finite section

    Choose Alternate every cycle. The retained strobes form two groups; compare this finite repetition with Across both wells and its residuals.

    What to observe: The mean, the fundamental and the retained fixed-phase points each describe a different part of the signal.
Something broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy