Duffing oscillator, live
A forced nonlinear oscillator integrated in the browser. Change the inputs and watch chaos appear.
The Duffing oscillator is a mass on a spring that stiffens as it stretches, pushed by a periodic force. Small changes in the inputs move it from a steady orbit to chaos.
The page runs a fourth-order Runge-Kutta integration in the browser. It draws the position over time, the phase portrait, the bifurcation diagram and the basins of attraction, and it updates as you change the mass, the spring, the damping or the force.
Built for PME3100 Mechanics I at Poli-USP. The same model in Python produces the written report.