Skip to main content

Solving the duffing oscillator

physics
programming
simulation
visualization
Published

January 5, 2021

Here I solve the differential equations for the duffing oscillator with scipy and animate the solution with matplotlib. The oscillator exhibits chaotic behavior.

To see the animation in action, run this code in a Jupyter notebook and prepend the %matplotlib notebook to the first cell.