
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.