Skip to main content
Sandbox Physics

M069 · Vibration design

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.

In a three-dimensional scene, a cart rides on a spring with a cubic term, a dashpot and a force actuator, set up as a hardening spring, a locally softening spring or a double well. Drag the cart to choose the basin it starts in, record phase portraits and samples at a fixed drive phase, and compare the measured fundamental with a single-harmonic approximation. Then sweep the frequency up and down, with each run starting from where the last one ended.

Interactive modelDuffing Oscillator Laboratory
Signed spring force along motion0 N0\,N
Acceleration along motion0 m/s20\,\mathrm{m/s^2}
Instantaneous actuator power0 W0\,W
Instantaneous dissipated power0 W0\,W
Acquired time0 s0\,\mathrm{s}
Primary displacement0 m0\,\mathrm{m}
Primary velocity0 m s−10\,\mathrm{m\,s^{-1}}
Mechanical energy0 J0\,\mathrm{J}
Integrated signed actuator work0 J0\,\mathrm{J}
Independent viscous dissipation0 J0\,\mathrm{J}
Independent energy balance defect0 J0\,\mathrm{J}
Position change with half step · first four cycles0 m0\,\mathrm{m}
Actual integration step0 ms0\,\mathrm{ms}
Model domain / record statusReady\text{Ready}
Retained eight-cycle fundamental amplitude00
Nonharmonic residual RMS00
Acquired mean displacement00
Approximate centered harmonic amplitudes00
Acquired retained strobes00
Continuation frequency records00
Continuation status00
Absolute displacement domain limit00

Physics tutorial

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 measured motion, escape from a local well, and a finite frequency sweep in which each run starts from the end state of the previous one.

Start with the essentials

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)

Green outlines mark the potential minima without forcing that lie inside the recording range. The drive can carry the mass away from them.

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 always positive, 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

    Look at the 3D force vectors, acquire the full record for Linear benchmark and compare the harmonic amplitude. Switch to the energy view to follow the actuator’s work and the 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 Hardening spring and run the full sweep up and down.

    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 Local softening with Double-well 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 Irregular double-well record, acquire the full record and check the residuals.

    What to observe: The mean, the fundamental and the retained fixed-phase points each describe a different part of the signal.
FeedbackSomething 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