Just Enough Physics
Chapter 4: Calculated Forces
In this video: I create a numerical model for a mass hanging on a spring using python. Oh, it's a visual model so you can see it too.
Here is the link to the code: https://trinket.io/glowscript/0107e35d76
Bonus: At the end, I made the mass move in 3D - everything works. However, I realized (after going to bed) that it wasn't doing what I had expected. The problem was that the initial position of the mass was directly under the hanging point. This makes the total angular momentum zero - so the only resulting motion must ALSO have zero angular momentum. That means it just moves back and forth (which is still cool).
If you change the initial position of the mass so that it is NOT under the pivot, you can get more circular-like motions.
Remind me in a later chapter to use this as an example when we cover the angular momentum principle.
If you want to support this project, check out my Patreon page:
/ justphysics
If you want to donate: https://www.paypal.me/rhettallain