Play with Pendula
Play with three pendula each of which are very predictable 😉.
Please note that this is identical to one of my earlier Projects . The user interface was changed slightly und the following description was added though.
How does it work?
The system of 3 attached pendula can be described using the following constants :
- The lengths j, k, l (all positive real numbers)
- The masses m, n, o (all positive real numbers)
- The gravitational constant g (a positive real number)
There are many options available for describing mechanical Systems. The most common is Forces. It's possible to describe any mechanical system using forces, unfortunately it is very hard to do so in the case above. In fact it is so hard, it would be totally impractical hence a more sophisticated approach is needed. It is possible to describe the behavior of such a system in a single Lagrange Function. Once the Lagrange Function was formally described, the Euler-Lagrange Equation can be used (with respect to each variable) to find a system of differential equations describing the motion of all pendula.
Doing so results in the following system of differential equations. (Note that the function J has been introduced as a short hand notation).
This is a system of 3 non-linear, non-homogeneous, 2nd order ordinary differential equations (ODEs) and it cannot be solved analytically. In order to obtain a numerical solution the order can be reduced by adding 3 equations describing the fact that the angular velocity of any angle is equal to this angles derivative. The resulting system consists of 6 equations each a first order ODE and can be solved with some Runge-Kutta method . Any of those methods will do but the above simulation uses Euler's method (1st order Runge-Kutta). (Note that Euler's method is less accurate than higher order Runge-Kutta methods).