Simple simulation of a classic pendulumn using Sympy, Numpy e Scipy. Thanks to matplotlib I was able to generate the .gif you can see. I'll try to implement other variants of the pendulumn.
The basic idea is to use the variation principle of least action, that is the following
and this quantity need to be the least possible considering a motion from an instant
where
in the case of
Some examples