Lagrangian and Hamiltonian Dynamics
Lagrangian and Hamiltonian Dynamics
Lagrangian and Hamiltonian Dynamics
Hamiltonian Dynamics
Chapter 7
Claude Pruneau
Physics and Astronomy
Minimal Principles in Physics
Hero of Alexandria 2nd century BC.
Law governing light reflection minimizes
the path length.
Fermats Principle
Refraction can be understood as the path
that minimizes the time - and Snells law.
Maupertuis (1747)
Principle of least action.
Hamilton (1834, 1835)
Hamiltons Principle
Of all possible paths along which a
dynamical system may move from one
point to another within a specified time
interval (consistent with any constraints),
the actual path followed is that which
minimizes the time integral of the
difference between the kinetic and
potential energy.
Hamiltons Principle
In terms of calculus of variations:
o T U ( )dt
t
1
t
2
}
= 0
The o is a shorthand notation which represents a variation as
discussed in Chap 6.
The kinetic energy of a particle in fixed, rectangular coordinates
is of function of 1
st
order time derivatives of the position
T = T( & x
i
)
The potential energy may in general be a function of both
positions and velocities. However if the particle moves in a
conservative force field, it is a function of the x
i
only.
U = U(x
i
)
Hamiltons Principle (contd)
Define the difference of T and U as the Lagrange
function or Lagrangian of the particle.
L = T U = L(x
i
, & x
i
)
The minimization principle (Hamiltons) may thus be
written:
o L(x
i
, & x
i
)dt
t
1
t
2
}
= 0
Derivation of Euler-Lagrange Equations
Establish by transformation
o L(x
i
, & x
i
)dt
t
1
t
2
}
= 0 o f {y, y'; x}dx = 0
x
1
x
2
}
x t
y
i
(x) x
i
(t )
y
i
'(x) & x
i
(t )
f {y
i
(x), y
i
'(x); x} L(x
i
(t ), & x
i
(t ))
cf
cy
i
d
dx
cf
cy
i
'
= 0
cL
cx
i
d
dt
cL
c& x
i
= 0, i = 1, 2, 3
Lagrange Equations of Motion
L is called Lagrange function or Lagrangian for the
particle.
L is a function of x
i
and dx
i
/dt but not t explicitly (at
this point)
cL
cx
i
d
dt
cL
c& x
i
= 0, i = 1, 2, 3
Example 1: Harmonic Oscillator
Problem: Obtain the Lagrange Equation of motion for
the one-dimensional harmonic oscillator.
Solution:
Write the usual expression for T and U to determine L.
L = T U =
1
2
m& x
2
1
2
kx
2
Calculate derivatives.
cL
cx
= kx
cL
c& x
= m& x
d
dt
cL
c& x
= m&& x
Example 1: Harmonic Oscillator (contd)
Combine in Lagrange Eq.
cL
cx
i
d
dt
cL
c& x
i
= 0, i = 1, 2, 3
m&& x + kx = 0
Example 2: Plane Pendulum
Problem: Obtain the Lagrange Equation of motion for
the plane pendulum of mass m.
u
Solution:
Write the expressions for T and U to determine L.
T =
1
2
m( & x
2
+ & y
2
) =
1
2
I=
2
=
1
2
ml
2
&
u
2
U = mgl(1 cosu)
L = T U =
1
2
ml
2
&
u
2
mgl(1 cosu)
l
Example 2: Plane Pendulum (contd)
Calculate derivatives of L by treating u as if it were a
rectangular coordinate.
cL
cu
=
c
cu
1
2
ml
2
&
u
2
mgl(1 cosu)
= mgl sinu
cL
c
&
u
=
c
c
&
u
1
2
ml
2
&
u
2
mgl(1 cosu)
= ml
2
&
u
d
dt
cL
c
&
u
= ml
2
&&
u
Combine... mgl sinu ml
2
&&
u = 0
u +
g
l
sinu = 0
Remarks
Example 2 was solved by assuming that u
could be treated as a rectangular coordinate
and we obtain the same result as one obtains
through Newtons equations.
The problem was solved by involving kinetic
energy, and potential energy. We did not use
the concept of force explicitly.
Generalized Coordinates
Seek generalization of coordinates.
Consider mechanical systems consisting of a
collection of n discrete point particles.
Rigid bodies will be discussed later
We need n position vectors, I.e. 3n quantities.
If there are m constraint equations that limit the
motion of particle by for instance relating some of
coordinates, then the number of independent
coordinates is limited to 3n-m.
One then describes the system as having 3n-m
degrees of freedom.
Generalized Coordinates (contd)
Important note: if s=3n-m coordinates are required to
describe a system, it is NOT necessary these s
coordinates be rectangular or curvilinear coordinates.
One can choose any combination of independent
parameters as long as they completely specify the
system.
Note further that these coordinates (parameters)
need not even have the dimension of length (e.g. u in
our previous example).
We use the term generalized coordinates to describe
any set of coordinates that completely specify the
state of a system.
Generalized coordinates will be noted: q
1
, q
2
, , q
n
.
Generalized Coordinates (contd)
A set of generalized coordinates whose number equals the
number s of degrees of freedom of the system, and not
restricted by the constraints is called a proper set of generalized
coordinates.
In some cases, it may be useful/convenient to use generalized
coordinates whose number exceeds the number of degrees of
freedom, and to explicitly use constraints through Lagrange
multipliers.
Useful e.g. if one wishes to calculate forces due to constraints.
The choice of a set of generalized coordinates is obviously not
unique.
They are in general (infinitely) many possibilities.
In addition to generalized coordinates, we shall also consider
time derivatives of the generalized coordinates called
generalized velocities.
Generalized Coordinates (contd)
q
1
, q
2
,L , q
s
or {q
i
} i = 1,..., s
& q
1
, & q
2
,L , & q
s
or { & q
i
} i = 1,..., s
Notation:
Transformation
Transformation: The normal coordinates can be
expressed as functions of the generalized coordinates - and
vice-versa.
x
o,i
= x
o,i
(q
1
, q
2
,L , q
s
,t),
o=1,2,...,n
i = 1, 2, 3
= x
o,i
(q
j
,t), j = 1, 2,..., s
Transformation (contd)
Rectangular components of the velocties depend on
the generalized coordinates, the generalized
velocities, and the time.
x
o,i
= & x
o,i
(q
j
, & q
j
,t)
Inverse transformations are noted:
q
j
= q
j
(x
o,i
, t )
& q
j
= & q
j
(x
o,i
, & x
o,i
, t )
There are m=3n-s equations of constraint
f
k
(x
o,i
, t) = 0, k =1, 2,..., m
Example: Generalized coordinates
Question: Find a suitable set of generalized
coordinates for a point particle moving on the surface
of a hemisphere of radius R whose center is at the
origin.
Solution: Motion on a spherical surface implies:
x
2
+ y
2
+ z
2
R
2
= 0, z > 0
Choose cosines as generalized coordinates.
q
1
=
x
R
, q
2
=
y
R
, q
3
=
z
R
q
1
2
+ q
2
2
+ q
3
2
=1
Example: Generalized coordinates (contd)
q
1
,
q
2
,
q
3
do not constitute a proper set of generalized
of coordinates because they are not independent.
One may however choose e.g. q
1,
q
2,
and the
constraint equation
x
2
+ y
2
+ z
2
= R
2
Lagrange Eqs in Gend Coordinates
Of all possible paths along which a dynamical system
may move from one point to another in configuration
space within a specified time interval, the actual path
followed is that which minimizes the time integral of
the Lagrangian for the system.
Remarks
Lagrangian defined as the difference between kinetic and
potential energies.
Energy is a scalar quantity (at least in Galilean relativity).
Lagrangian is a scalar function.
Implies the lagrangian must be invariant with respect to
coordinate transformations.
Certain transformations that change the Lagrangian but leave
the Eqs of motion unchanged are allowed.
E.G. if L is replaced by L+d/dt f(qi,t), for a function with
continuous 2nd partial derivatives. (Fixed end points)
The choice of reference for U is also irrelevant, one can add a
constant to L.
Lagranges Eqs
The choice of specific coordinates is therefore immaterial
L = T( & x
o,i
) U(x
o,i
)
= T(q
j
, & q
j
, t ) U(q
j
, t )
= L(q
j
, & q
j
, t )
Hamiltons principle becomes
o L(q
j
, & q
j
,t )
1
2
}
= 0
x t
y
i
(x) q
i
(t )
y
i
'(x) & q
i
(t )
f {y
i
(x), y
i
'(x); x} L(q
i
(t ), & q
ii
(t ))
cL
cq
i
d
dt
cL
c& q
i
= 0, i = 1, 2,..., s
Lagranges Eqs
s equations
m constraint equations
Applicability:
1. Force derivable from one/many potential
2. Constraint Eqs connect coordinates, may be fct(t)
Lagrange Eqs (contd)
Holonomic constraints
f
k
(x
o,i
, t) = 0, k =1, 2,..., m
Scleronomic constraints
Independent of time
Rheonomic
Dependent on time
Example: Projectile in 2D
Question: Consider the motion of a projectile under
gravity in two dimensions. Find equations of motion in
Cartesian and polar coordinates.
Solution in Cartesian coordinates:
T =
1
2
mv
2
U = mgy
with U = 0 at y = 0.
L = T U =
1
2
mv
2
mgy
cL
cx
d
dt
cL
c& x
= 0
0
d
dt
m& x = 0
&& x = 0
cL
cy
d
dt
cL
c& y
= 0
mg
d
dt
m& y = 0
&& y = g
Example: Projectile in 2D (contd)
In polar coordinates
T =
1
2
m & r
2
+ r
2
&
u
2
( )
U = mgr sinu
with U = 0 at u = 0.
cL
cr
d
dt
cL
c& r
= 0
mr
&
u
2
mgsinu
d
dt
m& r ( )= 0
r
&
u
2
gsinu && r = 0
L = T U =
1
2
m & r
2
+ r
2
&
u
2
( )
mgr sinu
cL
cu
d
dt
cL
c
&
u
= 0
mgr cosu
d
dt
mr
2
&
u
( )
= 0
gr cosu 2r& r
&
u r
2
&&
u = 0
Example: Motion in a cone
Question: A particle of mass m is constrained to move on the
inside surface of a smooth cone of hal-angle a. The particle is
subject to a gravitational force. Determine a set of generalized
coordinates and determine the constraints. Find Lagranges Eqs
of motion.
z
x
y
o
r
u
Solution:
Constraint: z rcoto = 0
2 degrees of freedom only!
2 generalized coordinates.
Example: Motion in a cone (contd)
Choose to eliminate z.
v
2
= & r
2
+ r
2
&
u
2
+ & z
2
= & r
2
+ r
2
&
u
2
+ & r
2
cot
2
o
= & r
2
csc
2
o + r
2
&
u
2
U = mgz
= mgr coto
L = T U =
1
2
mv
2
=
1
2
m & r
2
csc
2
o + r
2
&
u
2
( )
mgr coto
L is independent of u.
cL
cu
= 0 =
d
dt
cL
c
&
u
cL
c
&
u
= constant=mr
2
&
u
mr
2
&
u = mr
2
=
is the angular momentum relative to the
axis of the cone.
z = rcoto
Example: Motion in a cone (contd)
For r: cL
cr
d
dt
cL
c& r
= 0
r r
&
u
2
sin
2
o + gsino coso = 0
Lagranges Eqs with underdetermined multipliers
Constraints that can be expressed as
algebraic equations among the coordinates
are holonomic constraints.
If a system is subject to such equations, one
can always find a set of generalized
coordinates in terms of which Eqs of motion
are independent of these constraints.
Constraints which depend on the velocities
have the form f x
o,i
, & x
o,i
,t
( )
= 0
Non holonomic constraints unless eqs can be
integrated to yield constrains among the coordinates.
Consider
A
i
& x
i
i
+ B = 0 i =1, 2, 3
Generally non-integrable, unless
A
i
=
cf
cx
i
, B
i
=
cf
ct
= 0, f = f (x
i
, t )
One thus has:
cf
cx
i
& x
i
+
cf
ct
i
= 0
Or
df
dt
= 0
Which yields
f (x
i
,t) constant = 0
So the constraints are actually holonomic
Constraints
We therefore conclude that if constraints can be
expressed
cf
k
cq
i
dq
i
+
cf
ct
dt
i
= 0
Constraints Eqs given in differential form can be
integrated in Lagrange Eqs using undetermined
multipliers.
For:
cf
k
cq
i
dq
i
i
= 0
One gets:
cL
cq
j
d
dt
cL
c& q
j
+
k
(t )
cf
k
cq
j
k
= 0
Forces of Constraint
The underdetermined multipliers are the forces of
constraint:
Q
j
=
k
cf
k
cq
j k
cU
cx
i
=
d
dt
cT
c& x
i
, i=1,2,3
cU
cx
i
= F
i
, i=1,2,3
d
dt
cT
c& x
i
=
d
dt
c
c& x
i
1
2
m& x
j
2
j =1
3
|
\
|
.
|
=
d
dt
m& x
i
( )= & p
i
F
i
= & p
i
, i=1,2,3
x
i
= x
i
(q
i
,t )
x
i
=
cx
i
cq
j
& q
j
+
cx
i
ct
j
c& x
i
c& q
j
=
cx
i
cq
j
Generalized momentum
p
j
=
cT
c& q
j
Generalized force defined through virtual work oW
oW = F
i
ox
i
i
oW = F
i
cx
i
cq
j
oq
j
i, j
oW = Q
j
oq
j
j
Q
j
= F
i
cx
i
cq
j
i
|
\
|
.
|
p
j
= m& x
i
c& x
i
c& q
j i
remember
c& x
i
c& q
j
=
cx
i
cq
j
p
j
= m& x
i
cx
i
cq
j i
p
j
= m&& x
i
cx
i
cq
j
+ m& x
i
d
dt
cx
i
cq
j
|
\
|
.
|
i
d
dt
cx
i
cq
j
=
c
2
x
i
cq
k
cq
j
& q
k
+
c
2
x
i
cq
j
ct
k
p
j
= m&& x
i
cx
i
cq
j
i
+ m& x
i
c
2
x
i
cq
k
cq
j
& q
k
i, k
+ m& x
i
c
2
x
i
cq
j
ct
i
Q
j
cT
cq
j
= m& x
i
c& x
i
cq
j i
p
j
= Q
j
+
cT
cq
j
p
j
=
cT
c& q
j
d
dt
cT
c& q
j
|
\
|
.
|
cT
cq
j
= Q
j
=
cU
cq
j
d
dt
cT
c& q
j
|
\
|
.
|
cT
cq
j
= Q
j
=
cU
cq
j
Because U does not depend on & q
j
, one has
d
dt
c T U ( )
c& q
j
|
\
|
.
|
c T U ( )
cq
j
= 0
And with L = T - U,
d
dt
cL
c& q
j
|
\
|
.
|
cL
cq
j
= 0
7.10 Canonical Equations of Motion Hamilton Dynamics
Whenever the potential energy is velocity independent:
j
j
x
L
p
c
c
=
Result extended to define the Generalized Momenta:
j
j
q
L
p
c
c
=
Given Euler-Lagrange Eqs:
0 =
c
c
c
c
j j
q
L
dt
d
q
L
=
j
j j
L q p H
j
p
) , , ( ) , , ( t q q L q p t p q H
k k
j
j j k k
=
whereas the Lagrangian is considered a function of the
generalized coordinates, q
j
, and their time derivative.
To convert from the Lagrange formulation to the
Hamiltonian formulation, we consider:
c
c
+
|
|
.
|
\
|
c
c
+
c
c
=
j
k
k
k
k
dt
t
H
dp
p
H
dq
q
H
dH
But given:
=
j
j j
L q p H
One can also write:
( )
dt
t
L
q d
q
L
dq
q
L
dp q q d p
dL dp q q d p dH
j
k
k
k
k
k k k k
j
k k k k
c
c
|
|
.
|
\
|
c
c
c
c
+ =
+ =
k
p
k
p
dH = & q
k
dp
k
& p
k
dq
k
( )
j
cL
ct
dt
That must also equal:
c
c
+
|
|
.
|
\
|
c
c
+
c
c
=
j
k
k
k
k
dt
t
H
dp
p
H
dq
q
H
dH
We then conclude:
t
L
t
H
p
q
H
q
p
H
k
k
k
k
c
c
=
c
c
=
c
c
=
c
c
Hamilton Equations
Lets now rewrite:
c
c
+
|
|
.
|
\
|
c
c
+
c
c
=
j
k
k
k
k
dt
t
H
dp
p
H
dq
q
H
dH
k
p
k
q
And calculate:
( )
c
c
+ + =
j
k k k k
t
H
p q q p
dt
dH
0 =
Finally conclude:
t
H
dt
dH
c
c
=
If :
0 =
c
c
t
H
H is a constant of motion
If, additionally, H=U+T=E, then E is a conserved quantity.:
Some remarks
The Hamiltonian formulation requires, in general, more
work than the Lagrange formulation to derive the equations
of motion.
The Hamiltonian formulation simplifies the solution of
problems whenever cyclic variables are encountered.
Cyclic variables are generalized coordinates that do not
appear explicitly in the Hamiltonian.
The Hamiltonian formulation forms the basis to powerful
extensions of classical mechanics to other fields e.g. Beam
physics, statistical mechanics, etc.
The generalized coordinates and momenta are said to be
canonically conjugates because of the symmetric nature
of Hamiltons equations.
More remarks
If q
k
is cyclic, I.e. does not appear in the Hamiltonian, then
And p
k
is then a constant of motion.
A coordinate cyclic in H is also cyclic in L.
Note: if q
k
is cyclic, its time derivative q-dot appears explicitly
in L.
No reduction of the number of degrees of freedom in the
Lagrange formulation: still s 2
nd
order equations of motion.
Reduction by 2 of the number of equations to be solved in the
Hamiltonian formulation since 2 become trivial
0 =
c
c
=
c
c
=
k k
k
q
H
q
L
p
k k
p o =
k
k
k
H
q =
o
=
c
c
=
where e
k
is possibly a function of t.
One thus get the simple (trivial) solution:
}
= dt t q
k k
= ) (
The solution for a cyclic variable is thus reduced to a simple
integral as above.
The simplest solution to a system would occur if one could
choose the generalized coordinates in a way they are ALL
cyclic. One would then have s equations of the form :
Such a choice is possible by applying appropriate
transformations this is known as Hamilton-Jacobi Theory.
}
= dt t q
k k
= ) (
Some remarks on the calculus of variation
Hamiltons Principle:
0 ) , , (
2
1
=
}
t
t
k k
dt t q q L
o
Evaluated:
0
2
1
=
|
|
.
|
\
|
c
c
+
c
c
}
t
t
k
k
k
k
dt q
q
L
q
q
L
o o
k
k
k
q
dt
d
dt
dq
q o o o = |
.
|
\
|
=
Where oq
k
and are not independent!
k
q
o
The above integral becomes after integration by parts:
0
2
1
=
|
|
.
|
\
|
c
c
c
c
}
t
t
k
k k
dt q
q
L
dt
d
q
L
o
c
c
k k
q
L
dt
d
q
L
\
|
}
t
t
k
k k
dt H q p
o
Which evaluates to:
0
2
1
=
|
|
.
|
\
|
c
c
c
c
+
}
dt p
p
H
q
q
H
p q q p
j
k
k
k
k
k k k k
o o o o
Consider:
}
=
2
1
2
1
j
k k
j
k k
q
dt
d
p dt q p o o
Integrate by parts:
}
=
2
1
2
1
j
k k
j
k k
dt q p dt q p o o
The variation may then be written:
0
2
1
=
|
|
.
|
\
|
c
c
+
|
|
.
|
\
|
c
c
k
k
k
k k
k
k
dt q
q
H
p p
p
H
q o o
0
2
1
=
|
|
.
|
\
|
c
c
+
|
|
.
|
\
|
c
c
k
k
k
k k
k
k
dt q
q
H
p p
p
H
q o o
k
k
k
k
p
q
H
q
p
H
=
c
c
=
c
c
Hamilton Equations