This program simulates the movement of a pendulum with a free frictionless support on the x-coordinate. See the following image:
To calculate the path of the masses i defined an ODE with the equations that define the Lagrangian. We have two masses the support
Therefore we have the velocitie for the particle one is
Then computing the Euler-Lagrange equations:
After that we only have to rename the variables 