Literature

A many-body system [Go] (Video)

Assume particles of mass $m$ on an elastic (massless) rod that can undergo longitudinal displacements and let $\eta_i$ be the displacement of particle $i$ from its position.

The kinetic energy of the system is

$$ T = \frac{1}{2} \sum_i m \dot{\eta}_i^2. $$

The potential energy is the sum of the potential energies of each elastic part (spring) connecting neighbouring particles

$$ V = \frac{1}{2} \sum_i k (\eta_{i+1} - \eta_i)^2. $$

The Lagrangian of the system is

$$ L(\eta_i, \dot{\eta}_i) = T-V = \frac{1}{2} \sum_i \left[ m \dot{\eta}i^2 - k (\eta{i+1} - \eta_i)^2 \right]. $$

The Lagrangian is also written as

$$ L(\eta_i, \dot{\eta}_i) = \frac{1}{2} \sum_i a \left[ \frac{m}{a}\dot{\eta}i^2 - k a \left(\frac{\eta{i+1} - \eta_i}{a}\right)^2 \right] $$

where $a$ is the separation between particles.