# softmatter:Lagrangian

The Lagrangian of a dynamical system is defined as the Kinetic Energy T minus the Potential Energy U, or

$\bold L = \bold T -\bold U$.

To acquire equations of motion for a dynamical system, one simply computes the Lagrange Equation,

${\partial{L}\over \partial q_i} = {\mathrm{d} \over \mathrm{d}t}{\partial{L}\over \partial{\dot{q_i}}}.$

for each generalized coordinate qi. When qi = ri (i.e. the generalized coordinates are simply the Cartesian coordinates), Lagrange's equations reduce to Newton's second law.

The n generalized coordinates are the coordinates associated with the n degrees of freedom of the system. For example,

• The rotation angles θ1 and θ2 in a double pendulum system
• The 3N spatial coordinates for N particles in three-dimensional space
• The 6N spatial plus rotational coordinates for N rigid bodies in three-dimensional space
• The θ and φ of a particle confined to the surface of a sphere