Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Lecture Notes for PHY 405

Classical Mechanics
From Thorton & Marions Classical Mechanics
Prepared by
Dr. Joseph M. Hahn
Saint Marys University
Department of Astronomy & Physics
October 17, 2004

Chapter 7: Lagrangian & Hamiltonian Dynamics


Problem Set #4
due Tuesday November 1
at start of class
text problems 77, 710, 711, 712, 720. Please derive all
solutionsdont simply show that the texts solutions satisfy your EOM.
Newtons Law F = mp can be problematic at times.
For instance, the resulting EOM can at times be messy in spherical, cylindrical, or other coordinate systems:
F/m = xx
+ yy
+ z
z in Cartesian coordinates
1 d 2
= (
r r 2)
r+
(r ) + z
z in cylindrical coords
r dt
Newtons law requires knowing all the forces acting on a particle. In particular, constraints are in additional forces to be accounted for in F = ma.
Some forces of constraint are easy
ex.: a particle on a flat plane has Fconstraint = +mg
z
However other problems may have constraining forces that are too
complicated or difficult to formulate.
ex.: motion on a curved surface, motion of a bead along a curved wire, etc.
1

Lagrange equations of motion

An alternate approach is to use Lagrangian dynamics,


which is a reformulation of Newtonian dynamics
that can (sometimes) yield simpler EOM.
Another advantage of Lagrangian dynamics is that it can easily account for
the forces of constraint.
Begin by noting that the solution to many physics problems can be solved
by first invoking a minimization principle.
Ex.: in 1657 Fermat postulated that light rays always travel along the path
that requires the least amount of time. From the principle of least time,
one can derive the law of reflection (eg, the angle of reflection at a mirror =
angle of incidence) and Snells law of refraction.
We will derive Langrangian mechanics by invoking Hamiltons Principle
(1834), which asserts that a dynamical system follows the path that minimizes the time integral of the Lagrangian L = T U ,
where T and U are the systems kinetic and potential energies.
Chapter 6 tells us that this integral, sometimes called the action, is
Z t2
J=
L(xi, x i ; t)dt
t1

where the xi(t) with i = 1, 2, . . . , N are the systems trajectories in this


N dimensional problem, and x i(t) are the velocities.
For example, xi(t) could represent the x(t), y(t), z(t) of a single particle.

Hamiltons Principle implies that the action J has a minimum along the
systems trajectory xi(t).
Consequently, each of the trajectories xi (t) obey the EulerLagrange eqns:


d L
L

= 0
xi dt x i
These equations are usually called the Lagrange eqns.
Note that Newtons Law can be recovered from the Lagrange eqns:
Consider the 1D motion of a particle moving in the potential U = U (x):
1
L(x, x)
= T U = mx 2 U (x)
2
L
U
so
=
=F
x
x
d
thus F =
mx = m
x as expected.
dt

Note that the Lagrange EOM are a reformulation of Newtonian mechanics.


They do not introduce any new physics. Rather, they merely provide an
alternate approach to solving physical problems.
Note also that Lagrangian dynamics does not deal with forces,
which are vector quantities;
rather, it deals with energies, which are scalars
(which can also be simpler to formulate).

Generalized coordinates

Suppose your 3D system has N particles,


and there are m equations of constraint. Then this problem has
s = 3N m degrees of freedom
which means that the problem can be described by
s = 3N m generalized coordinates qi where i = 1, 2, . . . , s.
The set of {qi} is the smallest possible set of coordinates that can completely
specify the state of the system.
Note that the qi need not have units of lengththey might instead be some
combination of lengths, energies, angles, dimensionless coordinates, etc.
Note also that the qi, which are known as the generalized velocities,
may or may not have units of length or angle per time.
The Lagrange equations for the generalized coordinates are
 
L
d L

= 0 i=1,2,. . . ,s
qi dt qi

Example 7.5

A pendulum is attached to a massless rim of radius a that rotates at a


constant angular velocity . Obtain the Lagrange equation for mass m.

Fig. 73.

Begin by writing the Lagrangian L = T U .


What is this systems potential energy U ?
We will need ms Cartesian coordinates:
x = a cos t + b sin
y = a sin t b cos

What is T ?
Also need ms velocities:
a sin t + b cos
a cos t + b sin
2 + 2ab (
cos sin t + sin cos t)
x 2 + y 2 = (a)2 + (b)
sin( t)
1
1
2 + 2ab sin( t)]
so T = mv 2 = m[(a)2 + (b)
2
2
1
2 + 2ab sin( t)] mg(a sin t b cos )
and L = m[(a)2 + (b)
2

x
y
so v 2
but right ()

=
=
=
=

What are the generalized coordinates for this system?


The generalized velocities?
We could have written L in terms of x, y and x,
y.

Are the generalized coordinates?

What is the Lagrange equation for this system?


 
L
d L

= 0
dt
L
= mab cos( t) mgb sin
where

L
and
= mb2 + mab sin( t)

 
d L
so
= mb2 + mab( ) cos( t)
dt
thus ab cos( t) gb sin b2 ab( ) cos( t) = 0
a
g
so + sin = 2 cos( t)
b
b
is the EOM.
This is the EOM for a pendulum that is driven
by an external torque (eg, the term on the right).
ie, the simple pendulum is recovered when = 0.
How would you solve the EOM?
Always keep in mind the distinction in the meaning of a partial derivative:
L

and a total derivative:

d
dt

(1)


If you confuse the two, your EOM will be wrong.

(2)

Example 7.7constrained motion

A bead of mass m slides along a parabolic wire where z = cr 2 .


The wire rotates with angular velocity about the vertical axis.
Obtain the systems Lagrange eqns.
Also, how fast should the wire rotate in order to suspend the bead at an
equilibrium at height z > 0.

Fig. 75

The Lagrangian is
L = T U
where U = mgz
1
T = mv 2
2
v = r
r + r + z
z = beads velocity in cylindrical coords
1
so L = m(r 2 + r22 + z 2) mgz
2
Is L written in terms of the systems generalized coordinates?
8

How do I simplify this further using the constraint imposed by the wire?
First note that = ,
and that z = cr 2 , so that z = 2crr and
L =

1
m(r 2 + r2 2 + 4c2 r2r 2) mgcr2
2

What are this systems generalized coordinates?


The Lagrange eqn is

L
r
L
where
r
L
and
r
 
d L
so
dt r
so (1 + 4c2r2)
r
L
d

r dt

= 0
= mr 2 + 4mc2rr 2 2mgcr
= mr + 4mc2r2r
= m
r + 8mc2rr 2 + 4mc2r2r
+ 4c2rr 2 r 2 + 2gcr = 0

is the L EOM.
What is the condition for floating the bead
at some equilibrium height z = cr 2 > 0?
ie, how fast must the wire rotate for centrifugal force to balance gravity?
Since r = 0 and r = 0,
w2 = 2gc
is the angular at which the wire must spin in order to float the bead.

Example 7.9

A disk of mass M is constrained to roll down an inclined plane without


slipping. Solve the Lagrange equations for motion.

Fig. 67

First get the kinetic energy.


Recall from PHY305 that T = Tcenter of mass + Trot = 12 M y 2 + Trot,
where Trot = 12 I 2 is the KE due to the disks rotation,
I = 12 M R2 = disks moment of inertia:
T =

1
1
M y 2 + M R22
2
4

What is U ?
The Lagrangian is then
1
1
L = T U = M y 2 + M R22 + M gy sin
2
4

10

What does the noslip constraint tell us about the coordinates y and ?
What about the velocities?
Tip: put a dot on the disk, and use it to relate y arclength.
y = R and y = R
This allows us to write L in terms of a single generalized coordinate:
3
M R2 2 + M gR sin
4
The Lagrange equation for this system is
 
d L
L

= 0
dt
3
so M gR sin = M R2
2
2g
ie =
sin
3R
2gt

so (t)
=
sin assuming disk starts at rest
3R
gt2
and (t) =
sin
3R
L =

is the solution for the disks motion.

11

Problem Set #5
due Thursday November 10
at start of class
text problems 717, 727, 728, 733.
Exam #2
on Chapter 7 & Problem Sets 4 & 5
Thursday Nov. 17
The Hamiltonian H

Now lets derive another set of equations of motion from the Hamiltonian H.
This is usually obtained from the systems Lagrangian:
L
qj
L
d L
=
= p j
qj
dt qj

begin by defining the generalized momentum pj


the Lagrange Eqn. is then

Example: 1D motion of a single particle:


1
L = mq2 U (q)
2
L
p =
= mq
q
Note that p = the customary mass velocity only when q is a length.
For other systems, p might instead be an angular momentum, or something
else.
Now construct the Hamiltonian H via the following equation:
X
H(pi , qi, t) =
pj qj L(qi , qi, t)
j

where the sum extends over all of the pi & qi .


12

a simple example:
suppose L = L(x, y, x,
y)

L
L
py =
then px =
x
y
and H(px , py , x, y) = pxx + py y L(x, y, x,
y)

But note that H is defined to be a function of the ps and qs,


while L is ordinarily a function of qs and qs!

How do we exchange the qs and qs


for ps and qs?
To write H as a function of the ps and qs, use pj = L/ qj to obtain an
equation for qj in terms of the ps and qs, ie, qj = qj (qi , pi, t).
Then replace each qj appearing in L with the equivalent expression
qj (qi , pi, t) that depends on the ps and qs
this yields the Hamiltonian H(pi , qi, t) in its desired form.

13

Another set of EOMHamiltons equations

To obtain the H EOM, start by calculating the total derivative of H:


X
H(pi, qi , t) =
pj qj L(qi, qi , t)
j

so by Chain Rule, dH =

X  H
j

while derivative of RHS

H
dpj +
dqj
pj
qj

H
dt
t


X
L
L
L
=
qj dpj + pj dqj
dt
dqj
dqj
q

t
j
j
j

L
L
= pj and
= p j ,
qj
qj

X
L
L
so RHS =
qj dpj
dqj
dt
q
t
j
j

Note that

Think of dH as the total change in H that results when you alter the
pj , qj , and t by small, arbitrary displacements dpj , dqj , dt.
Next bring RHSLHS:



  
X  H
H
H L
qj dpj +
+ p j dqj +
+
dt = 0
p
q
t
t
j
j
j
Since the displacements dpj , dqj , dt are arbitrary,
what does that tell us about their coefficients?
Thus we get Hamiltons equations:
H
pj
H
pj =
qj
L
H
=
t
t
The systems H tells you how its ps and qq evolve over time.
qj =

14

Suppose our system has s degrees of freedom,


ie, L is a function of s generalized coordinates.
The L EOM would thus yield s secondorder DEs,
while Hamiltons Eqns would yield 2s firstorder differential eqns.
Hamiltons eqns provide yet another distinct set of EOM that are equivalent
to the Lagrange EOM and Newtons Laws of motion.
Hamiltons equations are especially useful in studies of
nonlinear & chaotic systems.
They are also quite handy when you want to draw a systems phase diagram,
plots of the pi plotted versus the qi ,
and are simply curves of constant H(pi, qi , t).
You will also need to know how to construct H in quantum mechanics,
since H appears in the Schrodinger eqn.

15

The 7 Steps of H

Using Hamiltons Eqns requires 7 steps:


1. Write L(qi, qi, t).
2. get the generalizes momenta
pj =

L
qj

3. Use the above to solve for qj = qj (qi , pi, t).


4. Insert the above into L to express it as L(qi, pi, t).
5. Construct the Hamiltonian
X
H(pi, qi , t) =
pj qj L(qi, pi, t)
j

6. Get Hamiltons Eqns:


H
pj
H
p j =
qj
qj =

7. solve, if possible

16

Example 7.11

Use Hamiltons eqns to solve for the motion of a particle of mass m


that is subject to a springforce F = kr
while constrained to move on a cylinder of radius R.

Fig. 79.

1. obtain L = T U :
1
1
U = kr2 = k(x2 + y 2 + z 2 )
2
2
How is U affected by the constraint?
x2 + y 2 = R2 so U = 12 k(R2 + z 2 ).
The particles KE in cylindrical coordinates is
1
T = m(r 2 + r2 2 + z 2)
2
How does the constraint alter T ?
r = R and r = 0 so T = 12 m(R2 2 + z 2 ).
17

1
1
and L = T U = m(R2 2 + z 2 ) k(R2 + z 2 )
2
2
2. get the generalized momenta:
L
= mR2 = angular momentum

L
pz =
= mz = vertical momentum
z
p =

3. solve for the generalized velocities qi :


p
mR2
pz
and z =
m
=

4. Write L = L(qi, pi, t):


p2
1
p2z
L =

k(R2 + z 2 )
+
2
2mR
2m 2

5. Construct H:
H(pi, qi , t) =

pj qj L(qi, pi, t) = p + pz z L(qi, pi, t)

p2z
1
p2
+
+
k(R2 + z 2 )
=
2
2mR
2m 2

18

6. Get Hamiltons Eqns:


H
H
and p j =
pj
qj
p
H pz
H
=
=
and
z

=
so =
p mR2
pz m
H
while p =
= 0 angular momentum is conserved

H
= kz
and pz =
z
qj =

7. Solve for the motion.


Since p = constant, the particle revolves

with a constant angular velocity = p /mR2 (t) = t.


The equations for the vertical motions is that of a SHO:
p z
k
= z = 02z
m
m
so z(t) = A cos 0 t
z =

19

H conservation

Recall that L = L(qi , qi, t). Thus by the Chain Rule,



X  L
dL
L
L
=
qj +
qj +
dt
qj
qj
t
j
d L
L
=
qj
dt qj
X  d L L  L
dL
=
+
qj +
so
qj
dt
dt

t
j
j
j
X d  L  L
=
qj
+
dt

t
j
j

but the Lagrange eqn is

L
= pj
qj
X d
d X
dH
L
(qj pj L) =
(qj pj L) =
=
dt
dt j
dt
t
j
but

so

thus if L is independent of t H is conserved


when does H = E?

Next, show that H = E under certain circumstances:


L
now suppose
= 0
t
and U = U (qi ) ie, U is independent of t and qi
what kind of system is this?
Also assume that T is a quadratic function of the qs:

N X
N
X
T (qi) =
aj,k qj qk where aj,k = ak,j
j=1 k=1

Examples include:
1
m(x 2 + y 2 + y 2) in Cartesian coords
2
1
or T = m(r 2 + r2 2 + r2 sin2 2) in spherical coords
2
T =

20

quadratic in the generalized velocities?


Is T = 12 m(x 2 + x y + v z)
Now show that H = E in this case:
since H =
=
=

N
X

piqi L

i=1
N
X

i=1
N
X
i=1

L
qi T + U
qi
T
qi T + U
qi

Now calculate
N X
N
X
T

=
aj,k qj qk
qi
qi
j=1

=
=
consequently,

k=1
N
N X
X

j=1 k=1
N
X

aj,k (i,j qk + qj k,i )

ai,k qk +

k=1
N
X
i=1

N
X

aj,i qj = 2

j=1
N X
N
X

T
qi = 2
qi

N
X

ai,k qk since aj,i = ai,j

k=1

ai,k qi qk = 2T

i=1 k=1

and thus H = 2T T + U = E

21

To summarize:
When (i.) L/t = 0 H = constant
But when (i.) L/t = 0
and (ii.) U = U (qi )
P
and (iii.) T = j,k aj,k qj qk H = E = constant
When conditions i., ii., and iii. hold, you can readily obtain the systems
Hamiltonian H by simply writing down the system energy E.
Just make sure that E is written as a function of the ps and qs rather than
the qs and qsyou

still have to eliminate the qs


in favor of the ps.
Nonetheless, using H = E to construct the Hamiltonian can be a bit easier
P
than using the formal definition of H = i piqi L.
Cyclic coordinates

The pair (qk , pk ) are called canonical conjugates


and the transformation from
L(qi, qi , t) H(qi , pi, t) is a canonical transformation.
A coordinate qk that does not appear in L or H is said to be cyclic.
Cyclic coordinates are especially handy in Hamiltons eqns since
pj =

H
=0
qj

the momenta of cyclic coordinates are constants of the motion.

22

Problem 728

A particle of mass m moves in the central forcefield F (r) = k/r 2.


What are the Hamilton EOM?
What coordinate system should I use?
The PE for this system is U (r) = k/r, which recovers F = U/r.
What is the KE in this coordinate system?
The Lagrangian is
1
k
L = T U = m(r 2 + r22) +
2
r
So the systems momenta are
L
= mr
r
L
and p =
= mr2

pr =

so
so

pr
m
p
=
mr2

r =

Can we simply use H = E = T + U to construct the systems Hamiltonian?


What 3 conditions must be met?
(i) is L/t = 0?
(ii) is the system conservative, ie, is U = U (qi )?
(iii) is T quadratic in the qis?

23

p2
k
p2r
+

consequently, we can use H = T + U =


2m 2mr2 r
Hamiltons EOM are
qj =
so r =
and =
and pj =
so pr =
and p =

H
pj
pr
H
=
pr m
p
H
=
which we already knew...
p mr2
H

qj
p2
k
H
=

r
mr3 r2
H

=0

Which coordinate is cyclic? What quantity is then conserved?


Note that these results are consistent with our earlier results for the 2body
problem, upon replacing m and k G(m1 + m2):
p = mr2 = angular momentum ` in Chapter 8
p2
p r
k/m
= 2 3 2
also note that r =
m mr
r
which is the eqn for ms radial acceleration,
which we derived earlier on page 26 of Chapter 8.

24

You might also like