where M is a mass matrix and q is the vector of generalized coordinates that describe the particles' positions. For example, the vector q may be a 3N Cartesian coordinates of the particle positions r k, where k runs from 1 to N ; in the absence of constraints, M would be the 3N x 3N diagonal square matrix of the particle masses. The vector f represents the generalized forces and the scalar V (q) represents the potential energy, both of which are functions of the generalized coordinates q.