Resonance with a Damped-Driven Mass-Spring System in Python

Photo: Rhett Allain

Physicists like to say that pretty much everything can be modeled as just a mass connected to a spring. I mean, it’s not completely untrue. The mass on a spring appears in lots of different problems. But what about an oscillating mass WITH some type of frictional force? What about a mass-spring with a driving force? This is what we are going to build — in python. It’s going to be awesome.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store