Pendulum - N-body pendulum simulator

Governing equation

I consider a \(N\)-body pendulum, where \(N\) objects are rigidly connected with massless rods and the gravitational acceleration \(g\) works in the \(y\) direction. For the sake of convenience, I assume that all objects have the same mass \(m\) and all rods have the same length \(l\).

Equations which describe the motion of this system are derived in this section. Hereafter the objects are distinguished by subscripts (\(\ia, \ib, \ic\)), which take \(0, 1, \cdots, N - 1\).

On the Cartesian coordinate, the position of the \(\ia\)-th object is given by

\[\posvec,\]

where \(\pos_{\ia} = \pos_{\ia} \left( t \right)\) is the rotational angle measured from the \(x\) axis, and \(\vel_{\ia} = \vel_{\ia} \left( t \right)\) is its time derivative:

\[\vel_{\ia} = \tder{\pos_{\ia}}{t}.\]

Their motions are governed by the Euler-Lagrange equation:

\[\tder{}{t} \pder{L}{\vel_{\ia}} - \pder{L}{\pos_{\ia}} = 0_{\ia} \,\, \left( N \text{-dimensional zero vector} \right),\]

where \(L = L \left( \pos_{\ia}, \vel_{\ia} \right)\) is the Lagrangian of the system with the basic variables \(\pos_{\ia}\): generalised coordinate and \(\vel_{\ia}\): its time derivative.

In this project, I consider the contributions of the kinetic energy \(T = T \left( \pos_{\ia}, \vel_{\ia} \right)\) and the potential energy \(U = U \left( \pos_{\ia} \right)\) to describe the Newtonian mechanics:

\[L \equiv T - U = \sum_{\ia = 0}^{N - 1} T_{\ia} - \sum_{\ia = 0}^{N - 1} U_{\ia}.\]

Also, by assuming that the system is frictionless, the total energy:

\[E \left( \pos_{\ia}, \vel_{\ia} \right) \equiv T + U = \sum_{\ia = 0}^{N - 1} T_{\ia} + \sum_{\ia = 0}^{N - 1} U_{\ia}\]

is conserved:

\[\tder{E}{t} = 0.\]

The following pages are devoted to derive these relations for the \(N\)-body pendulums.