In analytical mechanics, generalized coordinates are a set of parameters used to represent the state of a system in a configuration space. These parameters must uniquely define the configuration of the system relative to a reference state.[1] The generalized velocities are the time derivatives of the generalized coordinates of the system. The adjective "generalized" distinguishes these parameters from the traditional use of the term "coordinate" to refer to Cartesian coordinates.
An example of a generalized coordinate would be to describe the position of a pendulum using the angle of the pendulum relative to vertical, rather than by the x and y position of the pendulum.
Although there may be many possible choices for generalized coordinates for a physical system, they are generally selected to simplify calculations, such as the solution of the equations of motion for the system. If the coordinates are independent of one another, the number of independent generalized coordinates is defined by the number of degrees of freedom of the system.[2] [3]
Generalized coordinates are paired with generalized momenta to provide canonical coordinates on phase space.
Generalized coordinates are usually selected to provide the minimum number of independent coordinates that define the configuration of a system, which simplifies the formulation of Lagrange's equations of motion. However, it can also occur that a useful set of generalized coordinates may be dependent, which means that they are related by one or more constraint equations.
For a system of particles in 3D real coordinate space, the position vector of each particle can be written as a 3-tuple in Cartesian coordinates:
\begin{align} &r1=(x1,y1,z1),\\ &r2=(x2,y2,z2),\\ & \vdots\\ &rN=(xN,yN,zN) \end{align}
Any of the position vectors can be denoted where labels the particles. A holonomic constraint is a constraint equation of the form for particle
f(rk,t)=0
which connects all the 3 spatial coordinates of that particle together, so they are not independent. The constraint may change with time, so time will appear explicitly in the constraint equations. At any instant of time, any one coordinate will be determined from the other coordinates, e.g. if and are given, then so is . One constraint equation counts as one constraint. If there are constraints, each has an equation, so there will be constraint equations. There is not necessarily one constraint equation for each particle, and if there are no constraints on the system then there are no constraint equations.
So far, the configuration of the system is defined by quantities, but coordinates can be eliminated, one coordinate from each constraint equation. The number of independent coordinates is . (In dimensions, the original configuration would need coordinates, and the reduction by constraints means). It is ideal to use the minimum number of coordinates needed to define the configuration of the entire system, while taking advantage of the constraints on the system. These quantities are known as generalized coordinates in this context, denoted . It is convenient to collect them into an -tuple
q(t)=(q1(t), q2(t), \ldots, qn(t))
which is a point in the configuration space of the system. They are all independent of one other, and each is a function of time. Geometrically they can be lengths along straight lines, or arc lengths along curves, or angles; not necessarily Cartesian coordinates or other standard orthogonal coordinates. There is one for each degree of freedom, so the number of generalized coordinates equals the number of degrees of freedom, . A degree of freedom corresponds to one quantity that changes the configuration of the system, for example the angle of a pendulum, or the arc length traversed by a bead along a wire.
If it is possible to find from the constraints as many independent variables as there are degrees of freedom, these can be used as generalized coordinates. The position vector of particle is a function of all the generalized coordinates (and, through them, of time),[4]
rk=rk(q(t)),
and the generalized coordinates can be thought of as parameters associated with the constraint.
The corresponding time derivatives of are the generalized velocities,
q |
=
dq | |
dt |
=(
q |
|
|
n(t))
(each dot over a quantity indicates one time derivative). The velocity vector is the total derivative of with respect to time
vk=
r |
k=
drk | |
dt |
=
n | |
\sum | |
j=1 |
\partialrk | |
\partialqj |
q |
j.
and so generally depends on the generalized velocities and coordinates. Since we are free to specify the initial values of the generalized coordinates and velocities separately, the generalized coordinates and velocities can be treated as independent variables.
A mechanical system can involve constraints on both the generalized coordinates and their derivatives. Constraints of this type are known as non-holonomic. First-order non-holonomic constraints have the form
g(q,
q |
,t)=0,
An example of such a constraint is a rolling wheel or knife-edge that constrains the direction of the velocity vector. Non-holonomic constraints can also involve next-order derivatives such as generalized accelerations.
The total kinetic energy of the system is the energy of the system's motion, defined as
T=
1 | |
2 |
N | |
\sum | |
k=1 |
mk
r |
k ⋅
r |
k,
in which · is the dot product. The kinetic energy is a function only of the velocities, not the coordinates themselves. By contrast an important observation is
r |
k ⋅
r |
k=
n | ||
\sum | \left( | |
i,j=1 |
\partialrk | ⋅ | |
\partialqi |
\partialrk | \right) | |
\partialqj |
q |
|
j,
which illustrates the kinetic energy is in general a function of the generalized velocities, coordinates, and time if the constraints also vary with time, so .
In the case the constraints on the particles are time-independent, then all partial derivatives with respect to time are zero, and the kinetic energy is a homogeneous function of degree 2 in the generalized velocities.
Still for the time-independent case, this expression is equivalent to taking the line element squared of the trajectory for particle,
2 | |
ds | |
k |
=drk ⋅ drk=
n | ||
\sum | \left( | |
i,j=1 |
\partialrk | ⋅ | |
\partialqi |
\partialrk | |
\partialqj |
\right)dqidqj,
and dividing by the square differential in time,, to obtain the velocity squared of particle . Thus for time-independent constraints it is sufficient to know the line element to quickly obtain the kinetic energy of particles and hence the Lagrangian.
It is instructive to see the various cases of polar coordinates in 2D and 3D, owing to their frequent appearance. In 2D polar coordinates,
\left( | ds |
dt |
\right)2=
r |
2+
| |||
r |
2,
in 3D cylindrical coordinates,
\left( | ds |
dt |
\right)2=
r |
2+
| |||
r |
2+
z |
2,
in 3D spherical coordinates,
\left( | ds |
dt |
\right)2=
r |
2+r
| |||
2+r2\sin2\theta
\varphi |
2.
The generalized momentum "canonically conjugate to" the coordinate is defined by
pi=
\partialL | ||||
|
.
If the Lagrangian does not depend on some coordinate, then it follows from the Euler–Lagrange equations that the corresponding generalized momentum will be a conserved quantity, because the time derivative is zero implying the momentum is a constant of the motion;
\partialL | = | |
\partialqi |
d | |
dt |
\partialL | = | |||
|
p |
i=0.
For a bead sliding on a frictionless wire subject only to gravity in 2d space, the constraint on the bead can be stated in the form, where the position of the bead can be written, in which is a parameter, the arc length along the curve from some point on the wire. This is a suitable choice of generalized coordinate for the system. Only one coordinate is needed instead of two, because the position of the bead can be parameterized by one number,, and the constraint equation connects the two coordinates and ; either one is determined from the other. The constraint force is the reaction force the wire exerts on the bead to keep it on the wire, and the non-constraint applied force is gravity acting on the bead.
Suppose the wire changes its shape with time, by flexing. Then the constraint equation and position of the particle are respectively
f(r,t)=0, r=(x(s,t),y(s,t))
which now both depend on time due to the changing coordinates as the wire changes its shape. Notice time appears implicitly via the coordinates and explicitly in the constraint equations.
The relationship between the use of generalized coordinates and Cartesian coordinates to characterize the movement of a mechanical system can be illustrated by considering the constrained dynamics of a simple pendulum.[5] [6]
A simple pendulum consists of a mass hanging from a pivot point so that it is constrained to move on a circle of radius . The position of the mass is defined by the coordinate vector measured in the plane of the circle such that is in the vertical direction. The coordinates and are related by the equation of the circle
f(x,y)=x2+y2-L2=0,
f |
(x,y)=2x
x |
+2y
y |
=0.
Now introduce the parameter, that defines the angular position of from the vertical direction. It can be used to define the coordinates and, such that
r=(x,y)=(L\sin\theta,-L\cos\theta).
Notice that the force of gravity acting on the mass is formulated in the usual Cartesian coordinates,
F=(0,-mg),
The virtual work of gravity on the mass as it follows the trajectory is given by
\deltaW=F ⋅ \deltar.
The variation can be computed in terms of the coordinates and, or in terms of the parameter,
\deltar=(\deltax,\deltay)=(L\cos\theta,L\sin\theta)\delta\theta.
\deltaW=-mg\deltay=-mgL\sin(\theta)\delta\theta.
Notice that the coefficient of is the -component of the applied force. In the same way, the coefficient of is known as the generalized force along generalized coordinate, given by
F\theta=-mgL\sin\theta.
To complete the analysis consider the kinetic energy of the mass, using the velocity,
v=(x |
,
y |
)=(L\cos\theta,L\sin\theta)
\theta |
,
T=
1 | |
2 |
mv ⋅ v=
1 | |
2 |
m(
x |
| |||
2)=
1 | |
2 |
m
| |||
L |
2.
D'Alembert's form of the principle of virtual work for the pendulum in terms of the coordinates and are given by,
d | |
dt |
\partialT | ||||
|
-
\partialT | |
\partialx |
=Fx+λ
\partialf | |
\partialx |
,
d | |
dt |
\partialT | ||||
|
-
\partialT | |
\partialy |
=Fy+λ
\partialf | |
\partialy |
.
m\ddot{x}=λ(2x), m\ddot{y}=-mg+λ(2y), x2+y2-L2=0,
Using the parameter, those equations take the form
d | |
dt |
\partialT | ||||
|
-
\partialT | |
\partial\theta |
=F\theta,
mL2\ddot{\theta}=-mgL\sin\theta,
\ddot{\theta}+
g | |
L |
\sin\theta=0.
This shows that the parameter is a generalized coordinate that can be used in the same way as the Cartesian coordinates and to analyze the pendulum.
The benefits of generalized coordinates become apparent with the analysis of a double pendulum.For the two masses, let define their two trajectories. These vectors satisfy the two constraint equations,
f1(x1,y1,x2,y2)=r1 ⋅ r1-
2 | |
L | |
1 |
=0
f2(x1,y1,x2,y2)=(r2-r1) ⋅ (r2-r1)-
2 | |
L | |
2 |
=0.
Now introduce the generalized coordinates that define the angular position of each mass of the double pendulum from the vertical direction. In this case, we have
r1=(L1\sin\theta1,-L1\cos\theta1), r2=(L1\sin\theta1,-L1\cos\theta1)+(L2\sin\theta2,-L2\cos\theta2).
The force of gravity acting on the masses is given by,
F1=(0,-m1g), F2=(0,-m2g)
\deltaW=F1 ⋅ \deltar1+F2 ⋅ \deltar2.
The variations can be computed to be
\deltar1=(L1\cos\theta1,L1\sin\theta1)\delta\theta1, \deltar2=(L1\cos\theta1,L1\sin\theta1)\delta\theta1+(L2\cos\theta2,L2\sin\theta2)\delta\theta2
Thus, the virtual work is given by
\deltaW=-(m1+m2)gL1\sin\theta1\delta\theta1-m2gL2\sin\theta2\delta\theta2,
F | |
\theta1 |
=-(m1+m2)gL1\sin\theta1,
F | |
\theta2 |
=-m2gL2\sin\theta2.
Compute the kinetic energy of this system to be
T=
1 | |
2 |
m1v1 ⋅ v1+
1 | |
2 |
m2v2 ⋅ v2=
1 | |
2 |
(m1+m2)L
2 | |
1 |
+
1 | |
2 |
m2L
2 | |
2 |
+m2L1L2\cos(\theta2-\theta
|
|
2.
Euler–Lagrange equation yield two equations in the unknown generalized coordinates given by[7]
(m1+m2)L
2\ddot{\theta} | |
1+m |
2L1L2\ddot{\theta}2\cos(\theta2-\theta1)+m2L1L
2\sin(\theta | |
1-\theta |
2)=-(m1+m2)gL1\sin\theta1,
m2L
2\ddot{\theta} | |
2+m |
2L1L2\ddot{\theta}1\cos(\theta2-\theta1)+m2L1L
2\sin(\theta | |
2-\theta |
1)=-m2gL2\sin\theta2.
The use of the generalized coordinates provides an alternative to the Cartesian formulation of the dynamics of the double pendulum.
For a 3D example, a spherical pendulum with constant length free to swing in any angular direction subject to gravity, the constraint on the pendulum bob can be stated in the form
f(r)=x2+y2+z2-l2=0,
where the position of the pendulum bob can be written
r=(x(\theta,\phi),y(\theta,\phi),z(\theta,\phi)),
in which are the spherical polar angles because the bob moves in the surface of a sphere. The position is measured along the suspension point to the bob, here treated as a point particle. A logical choice of generalized coordinates to describe the motion are the angles . Only two coordinates are needed instead of three, because the position of the bob can be parameterized by two numbers, and the constraint equation connects the three coordinates so any one of them is determined from the other two.
The principle of virtual work states that if a system is in static equilibrium, the virtual work of the applied forces is zero for all virtual movements of the system from this state, that is, for any variation . When formulated in terms of generalized coordinates, this is equivalent to the requirement that the generalized forces for any virtual displacement are zero, that is .
Let the forces on the system be be applied to points with Cartesian coordinates, then the virtual work generated by a virtual displacement from the equilibrium position is given by
\deltaW=
m | |
\sum | |
j=1 |
Fj ⋅ \deltarj.
Now assume that each depends on the generalized coordinates then
\deltarj=
\partialrj | |
\partialq1 |
\delta{q}1+\ldots+
\partialrj | |
\partialqn |
\delta{q}n,
\deltaW=
m | |
\left(\sum | |
j=1 |
Fj ⋅
\partialrj | |
\partialq1 |
\right)\delta{q}1+\ldots+
m | |
\left(\sum | |
j=1 |
Fj ⋅
\partialrj | |
\partialqn |
\right)\delta{q}n.
The terms
Fi=
m | |
\sum | |
j=1 |
Fj ⋅
\partialrj | |
\partialqi |
, i=1,\ldots,n,
Fi=
m | |
\sum | |
j=1 |
Fj ⋅
\partialvj | ||||
|
, i=1,\ldots,n,
In order for the virtual work to be zero for an arbitrary virtual displacement, each of the generalized forces must be zero, that is
\deltaW=0 ⇒ Fi=0,i=1,\ldots,n.