📈 Nonlinear Oscillations — Duffing Oscillator
Explore the Duffing oscillator: chaotic motion, phase portraits, Poincaré sections, and period-doubling bifurcation diagrams. Interactive nonlinear dynamics.
About this simulation
This simulation numerically integrates the Duffing oscillator, ẍ + δẋ + αx + βx³ = γ·cos(ωt), using a fourth-order Runge–Kutta scheme. With a negative linear stiffness α and positive cubic stiffness β, the system's potential V(x) = ½αx² + ¼βx⁴ forms a double well, giving the oscillator two stable rest points it can hop between under periodic forcing. Depending on the damping δ, forcing amplitude γ and forcing frequency ω, the trajectory can settle into a simple periodic orbit, a period-doubled cycle, or fully chaotic motion — a hallmark example of deterministic chaos in a low-dimensional nonlinear system.
🔬 What it shows
Four linked views of the same trajectory: a phase portrait of position x against velocity ẋ, a Poincaré section that samples (x, ẋ) once per forcing period to reveal the underlying attractor structure, a bifurcation diagram plotting long-run Poincaré points against the forcing amplitude γ, and a time trace of x(t).
🎮 How to use
Drag the α, β, δ, γ and ω sliders to reshape the potential wells, damping and driving. Use the Periodic, Period-2, Chaotic and Hard spring preset buttons to jump straight to characteristic regimes, and press Scan Bifurcation to sweep γ from 0 to 1.5 and plot the resulting bifurcation diagram. Switch between the Phase Portrait, Poincaré Section, Bifurcation and x(t) tabs to change what the main canvas displays.
💡 Did you know?
The Duffing equation was originally derived by Georg Duffing in 1918 to model the hardening-spring behaviour of nonlinear mechanical oscillators, decades before "chaos theory" existed as a field — it later became one of the first textbook systems used to demonstrate period-doubling routes to chaos.
Frequently asked questions
What makes the Duffing oscillator "nonlinear"?
The βx³ term makes the restoring force nonlinear: unlike a simple spring where force is proportional to displacement, here the force grows with the cube of x. Combined with a negative linear term α, this creates a double-well potential where the net restoring force can push the mass toward either of two stable positions instead of a single equilibrium.
Why does the system have two "wells"?
When α is negative and β is positive, the potential energy function V(x) = ½αx² + ¼βx⁴ has a local maximum at x = 0 and two local minima on either side. These minima are the two wells; without forcing, the system would settle into whichever well it started closer to, but periodic forcing can kick it back and forth between them.
What is a Poincaré section and why sample once per period?
A Poincaré section takes a continuous trajectory and records its state only at fixed intervals, here once every forcing period T = 2π/ω. For a purely periodic orbit this produces a single repeating point, for a period-2 cycle it produces two alternating points, and for chaotic motion it produces a scattered, fractal-like cloud of points called a strange attractor.
How does the bifurcation diagram relate to the phase portrait?
The bifurcation diagram is built by fixing all parameters except γ, running the simulation to a steady state for each γ value, and plotting the resulting Poincaré x-coordinates as vertical slices. Where the diagram shows a single point per γ, the phase portrait shows a simple periodic loop; where it fans out into a dense band, the phase portrait shows the tangled, non-repeating trajectory characteristic of chaos.
Why does increasing the forcing amplitude γ lead to chaos?
As γ grows, the energy pumped in each period increases and eventually the trajectory has enough energy to escape one well and cross into the other. Near this transition the system becomes extremely sensitive to initial conditions: two nearly identical starting states diverge exponentially, which is the defining signature of deterministic chaos, visible here as period-doubling cascades leading into broadband, aperiodic motion.
Explore the Duffing oscillator: chaotic motion, phase portraits, Poincaré sections, and period-doubling bifurcation diagrams. Interactive nonlinear dynamics.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install