تماشای ویدئو Physics simulation spring and pendulum از آی-ویدئو
I simulated a simple system consisting of a swinging, massless spring (the blue line) and a weight (the red dot) using Lagrangian mechanics.
Python snippet: https://gist.github.com/Flannelhead/7059673