Sie sind auf Seite 1von 197

Solutions to the Exercises

in
Essentials of Hamiltonian Dynamics
John H. Lowenstein
Preface
This electronic book contains solutions to all of the exercises included in
Essentials of Hamiltonian Dynamics (Cambridge University Press, 2012). I
am providing it free of charge to authorized instructors via the publishers
website, with the hope that it will enhance the pedagogical value of the
textbook. In this solutions book, references to formulas, gures, and citations
in the textbook are prefaced with the initials EHD.
The page numbers and subjects of the exercise solutions are listed at the
beginning of each chapter. Those requiring computer assistance have been
prepared as Mathematica

notebooks, and this is indicated in the lists by the


notation (M). Those based on traditional methods of mathematical analysis
have been prepared as LaTeX documents and are denoted by (L).
The presence of exercises and illustrative examples requiring the use of
mathematical software (not necessarily Mathematica) is a special feature of
the textbook. Students who wish quickly to get up to speed with Mathemat-
ica will nd that the latter comes equipped with excellent documentation. In
addition, they may nd useful a brief downloadable manual which I prepared
as a supplementary resource for readers of the textbook.
One advantage of the electronic format is that updates can be provided
when needed. Please email your suggestions for improvements and correc-
tions to me at john.lowenstein@nyu.edu. An Errata le will be maintained
on the Cambridge University Press website so that confusing errors in the
textbook can quickly be brought to the attention of instructors and their
students.
John H. Lowenstein
CONTENTS
Chapter 1 Fundamentals of classical dynamics 2
Chapter 2 The Hamiltonian formalism 35
Chapter 3 Integrable systems 62
Chapter 4 Canonical perturbation theory 104
Chapter 5 Order and chaos in Hamiltonian systems 116
Chapter 6 The swing-spring 155
Solutions to the Exercises Essentials of Hamiltonian Dynamics
1
Chapter 1 Fundamentals of classical dynamics
CONTENTS
1.1 Simple pendulum separatrix (L) 3
1.2 Simple pendulum plots (M) 5
1.3 Simple pendulum period (L) 6
1.4 Simple pendulum, E > g (L) 7
1.5 Morse potential (M, L) 8
1.6 Elastic pendulum (L) 21
1.7 Cycloid (L, M) 22
1.8 Bead on a rotating loop (M) 26
1.9 Chaotic bead on a loop (M) 27
1.10 Independence of top integrals (L) 29
1.11 Symmetric top orbits (L) 30
L = LaTeX document, M= Mathematica notebook
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 2
Exercise 1.1 Simple pendulum separatrix
For the separatrix solution,
E = g, (1)
and, from (EHD:1.16),
E =
1
2
p
2

g cos . (2)
Combining (1) and (2), we get
p
2

= 2g(1 + cos ) = 4g

1 + cos )
2

= 4g cos
2

2
.
Thus we get (EHD:1.17),
p

= 2

g cos

2
.
We now want to obtain (t), given
(0) = 0,

(0) = 2

g,
E = E(0) =
1
2

(0)
2
g cos (0) = 2g g = g.
Thus we are on the separatrix, and so we can insert (EHD:1.17) into the
equation of motion (only the plus sign is relevant) to obtain
d
dt
= 2

g cos

2
.
Solving for dt,
dt =
1
2

g
d
cos(/2)
. (3)
We can integrate (3) to obtain t as a function of :
t =
1

g

2
0
sec d =
1

g
ln

tan(

4
+

4
)

.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 3
Exponentiating both sides gives
tan(

4
+

4
) = e

g t
,
which we can solve for :
(t) = 4 tan
1
(e

g t
) .
For large t, (t) approaches . To obtain the asymptotic behavior, we
Taylor-expand the inverse-tangent function to get
(t) 4e

g t
, for t .
For long times, the pendulum rises toward the unstable equilibrium point at
= , slowing down forever and never reaching the true vertical.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 4
Exercise 1.2 Simple Pendulum Plots
Formulas (EHD:1.19) and (EHD:1.20)
Here the variable t is the time, multiplied by g to make it dimensionless. The period period[k] is defined
similarly.
In[1]:= theta@k_, t_D := 2 ArcSin@k JacobiSN@t, k^2DD
In[2]:= period@k_D := 4 EllipticK@k^2D
Plot of theta[k,t] for various k in the interval (0,1)
Plot@Table@theta@.1 * j, tD, 8j, 1, 9<D, 8t, 0, 10<D
2 4 6 8 10
-2
-1
1
2
Plot of theta[k,t] for one oscillation period, adjustable k
Manipulate@Plot@theta@k, tD, 8t, 0, period@kD<D, 8k, 0, 1<D
k
0.99
2 4 6 8 10 12
-2
-1
1
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 5
Exercise 1.3 Simple pendulum period
The period of a simple pendulum is given by (EHD:1.20),
T = 4
1

g
K(k
2
), k
2
=
E + g
2g
.
To determine its asymptotic behavior for k 0, 1, we refer to EHD reference
[3], Chap. 17.
Behavior near E = g
The elliptic K function has a Taylor expansion about k
2
= 0 in the form of
a hypergeometric series,
K(k
2
) =

2
F(
1
2
,
1
2
; 1; k
2
) =

2

1 +

1
2

2
k
2
+

1 3
2 4

2
k
4
+

and so the period behaves as


T =
2

1 +
1
4
k
2
+ O(k
4
)

For k
2
0, this tends to the period of a simple harmonic oscillator with
frequency

g.
Behavior near E = g
For asymptotically small 1 k
2
, the K function behaves as (from [3])
K(k
2
)
1
2
ln
16
1 k
2
.
Thus the period blows up logarithmically as one approaches the separatrix.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 6
Exercise 1.4 Simple pendulum, E > g
From (EHD:1.18), we have
d
dt
=

2(E + g cos ), E > g,


and hence
dt =
d

2(E + g cos )
.
Introducing
= sin

2
, k =

2g
E + g
we get
dt =
k

g
d
(1 k
2

2
)(1
2
)
.
Dening t
0
such that (t
0
) = 0, we integrate to get
t t
0
=
k

g
F(sin
1
(sin

2
|k
2
).
This can be inverted to obtain
(t) = 2 sin
1

sn(

g(t t
0
)/k, k
2
)

.
The time T during which goes from 0 to 2 corresponds to a half-period
of the sn function (i.e. 2K(k
2
), not 4K(k
2
)),and so
T =
2k

g
K(k
2
) =

8
E + g
K

2g
E + g

.
The asymptotic behaviors are:
T , E g,
T

8
E
K(0) =

2
E
, E .
As expected, the period blows up as one approaches the separatrix motion,
and the large-E formula coincides with the period of a rotor with uniform
angular frequency

E.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 7
Exercise 1.5 Morse Potential
We make the potential energy function dimensionless by dividing by V
0
potentialV@x_D := Exp@-2 xD - 2 Exp@-xD
Plot of potentialV for various a in the interval (0,1]
Plot@Table@potentialV@.1 * j * xD, 8j, 1, 10<D, 8x, -10, 10<, PlotRange 8-1, 1<D
-10 -5 5 10
-1.0
-0.5
0.5
1.0
Contour plot of the dimensionless Hamiltonian
ham@x_, p_D := p^2 2 + potentialV@xD
ContourPlot@ham@x, pD, 8x, -1, 5<, 8p, -2, 2<, ContourShading False,
Contours 20, ContourStyle 8Black, Thickness@.003D<D
-1 0 1 2 3 4 5
-2
-1
0
1
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 8
Calculation of x(t) for E < 0
Energy conservation gives us the rst-order dierential equation
E =
1
2
m x
2
+ V
0
_
e
2x
2e
x
_
,
from which we get
x =
_
2V
0
m
_
1 +
E
V
0
(1 e
x
)
2
_
.
Introducing
u = e
x
, =
|E|
V
0
, b =
_
m
2V
0

2
,
the dierential equation becomes
du
dt
= b
1
u
_
1 (1 u)
2
. (4)
The zeros of the quadratic polynomial under the square root sign are the
turning points of the negative-E orbit, located at
u
0
= 1

1 , u
1
= 1

1 .
We solve (4) for dt and integrate, assuming that x = 0 (i.e. u = 1) and
x > 0 (i.e. u < 0) at t = 0:
t = b
_
u
1
du

_
1 (1 u

)
2
=
i

ln
_
u
1
_
i(u )

+
_
1 (1 u)
2
__

1
e
i
_
,
where
=

b
, e
i
=

+ i

1 .
To solve for u, we isolate the square root:
_
1 (1 u)
2
) =
i(u )

+
_
1

ue
i(t)
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 9
Squaring both sides, we nd that the u independent terms cancel. The
remaining terms, divided by u, reduce to a linear equation for u, with the
solution
u(t) =

1 +

1 sin(t )
.
The turning points u
0
and u
1
correspond to the argument of the sine function
reaching

2
and

2
, respectively. The period of the oscillatory motion is twice
the travel time between the turning points, i.e.
T =
2

=
2

_
m
2|E|
.
Thanks to the symmetry properties of the sine function, the solution u(t)
given above can be extended to arbitrary real t.
Calculation of x(t) for E > 0
The calculation follows closely the pattern for negative energy. This time,
we set
=
E
V
0
,
and evaluate
t = b
_
u
1
du

_
1 + (1 u

)
2
.
This leads to the formula for u,
u =

+ 1 cosh(t + ) 1
,
where
cosh =

1 + .
Now there is only one turning point, at
u
1
= 1 +

+ 1,
where the argument of the hyperbolic cosine vanishes. The orbit comes in
from innity, turns around at x =
1
ln u
1
, and goes back to innity. The
formula for u(t) can be extended to arbitrary negative time, thanks to the
symmetry of the hyperbolic cosine function.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 10
Calculation of x(t) for E = 0
Following the same pattern as for nonzero energy, we evaluate
t = b
_
u
1
du

u
3/2
(2 u)
1/2
= b
_
_
2 u
u
1
_
.
Solving for u, we get
u =
_
1 +
t
b
+
t
2
2b
2
_
1
,
so that
x(t) =
1
ln
_
1 +
t
b
+
t
2
2b
2
_
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 11
Numerical integration
We will do three numerical integrations, all starting at x=0,
dx
dt
>0, for t=0. The energy values are E= -V
0
/2, 0, 2 V
0
.
Runge-Kutta formula
RK4step@g_, z_D := Module@8k1, k2, k3, k4<,
k1 = g@zD * dt;
k2 = g@z + k1 2D * dt;
k3 = g@z + k2 2D * dt;
k4 = g@z + k3D * dt;
z + Hk1 + 2 * k2 + 2 * k3 + k4L 6D
E= -V
0
/2
f@x_D := Sqrt@0.5 - H1 - E^H-xLL^2D
halfperiod = N@3 Pi 4D Sqrt@2.D H* This is the time of the forward turning point *L
3.33216
dt = halfperiod 10000; x = x0 = 0;
orbit = Join@880, 0<<, Table@x = RK4step@f, xD; 8n * dt, x<, 8n, 1, 10000<DD;
ListPlot@orbit, PlotStyle 8Black, Thickness@.003D<, Joined TrueD
0.5 1.0 1.5 2.0 2.5 3.0
0.2
0.4
0.6
0.8
1.0
1.2
halfperiod = -N@ Pi 4D Sqrt@2.D H* This is the time of the backward turning point *L
-1.11072
dt = halfperiod 10000; x = x0 = 0;
orbit = Join@880, 0<<, Table@x = RK4step@f, xD; 8n * dt, x<, 8n, 1, 10000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 12
ListPlot@orbit, PlotStyle 8Black, Thickness@.003D<, Joined TrueD
-0.8 -0.6 -0.4 -0.2
-1.0
-0.8
-0.6
-0.4
-0.2
Comparison with the exact formula
Plot@Log@2 H1 + Sqrt@1 2D Sin@t Sqrt@2.D - Pi 4.DLD,
8t, -halfperiod 3, halfperiod<, PlotStyle 8Red, Thickness@.003D<D
-1 1 2 3
-0.5
0.5
1.0
orbit@@10001, 2DD - Log@2 H1 + Sqrt@1 2D Sin@t Sqrt@2.D - Pi 4.DLD . t halfperiod
2.80971 10
-10
+ 3.60221 10
-9

Note that the pointwise accuracy can be improved by using a non-uniform dt , especially reducing its size as one
approaches the turning points.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 13
Extension to arbitrary t
Plot@Log@2 H1 + Sqrt@1 2D Sin@t Sqrt@2.D - Pi 4.DLD,
8t, -20, 20<, PlotStyle 8Red, Thickness@.003D<D
-20 -10 10 20
-0.5
0.5
1.0
E=2 V
0
Integrate@u^H-1L H1 + e - H1 - uL^2L^H-1 2L, uD
Log@uD - LogBe + u + e e - H-2 + uL u F
e
f@x_D := Sqrt@3 - H1 - E^H-xLL^2D
dt = .001; x = x0 = 0;
orbit = Join@880, 0<<, Table@x = RK4step@f, xD; 8n * dt, x<, 8n, 1, 10000<DD;
ListPlot@orbit, PlotStyle 8Black, Thickness@.003D<, Joined TrueD
2 4 6 8 10
2
4
6
8
10
12
14
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 14
Comparison with the exact formula
Plot@Log@HSqrt@3.D Cosh@t Sqrt@2.D + Log@Sqrt@3.D + Sqrt@2DDD - 1L 2D,
8t, 0, 10<, PlotStyle 8Red, Thickness@.003D<D
2 4 6 8 10
2
4
6
8
10
12
14
orbit@@10001, 2DD - Log@HSqrt@3.D Cosh@t Sqrt@2.D + Log@Sqrt@3.D + Sqrt@2DDD - 1L 2D . t 10
6.39488 10
-14
E=0
f@x_D := Sqrt@2 E^H-xL - E^H-2 xLD
dt = .001; x = x0 = 0;
orbit = Join@880, 0<<, Table@x = RK4step@f, xD; 8n * dt, x<, 8n, 1, 10000<DD;
ListPlot@orbit, PlotStyle 8Black, Thickness@.003D<, Joined TrueD
2 4 6 8 10
1
2
3
4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 15
Comparison with the exact formula
Plot@Log@1 + t + t^2 2D, 8t, 0, 10<, PlotStyle 8Red, Thickness@.003D<D
2 4 6 8 10
1
2
3
4
orbit@@10001, 2DD - NLog@1 + t + t^2 2D . t 10
-1.5099 10
-14
Perturbed system
The Hamiltonian is now
1
2
p
2
+ e
-2 H1+e sin tL x
-2 e
-H1+e sin tL x
,
which is no longer conserved. We need to use the full equations of motion,
x

=
!H
!p
= p, p

= -
!H
!x
= 2 (1 + e sin t) ( e
-2 H1+e sin tL x
- e
-H1+e sin tL x
) ,
with initial conditions appropriate for E = 0: x(0)=0, x

(0) = 1.
f@8x_, p_, theta_<D := 8p, 2 H1 + epsilon * Sin@10 * thetaDL
HE^H-2 H1 + epsilon * Sin@10 * thetaDL xL - E^H-H1 + epsilon * Sin@10 * thetaDL xLL, 1<
The Runge-Kutta integration step is the same as before (now z will be interpreted as a 3-vector):
RK4step@g_, z_D := Module@8k1, k2, k3, k4<,
k1 = g@zD * dt;
k2 = g@z + k1 2D * dt;
k3 = g@z + k2 2D * dt;
k4 = g@z + k3D * dt;
z + Hk1 + 2 * k2 + 2 * k3 + k4L 6D
There are a number of numerical experiments which might be of interest here. We will concentrate on trying to
find evidence that the perturbation can produce complicated multiple bounces within the potential well, followed
eventually by escape. We will be interested in the sensitivity of this phenomenon to the choice of initial conditions.
The value of 0.5 for the perturbation amplitude was found by trial and error to be suitable for our investigation.
dt = .001; epsilon = .5;
x(0)=0, p(0)=1/2
z = 80, 1 2, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 10000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 16
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<D
20 40 60 80 100
-0.3
-0.2
-0.1
0.1
0.2
0.3
0.4
x(0)=0, p(0)=3/4
z = 80, 3 4, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 10000<DD;
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<D
20 40 60 80 100
-0.4
-0.2
0.2
0.4
0.6
0.8
x(0)=0, p(0)=9/10
z = 80, 9 10, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 10000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 17
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<D
20 40 60 80 100
10
20
30
40
50
60
70
x(0)=0, p(0)=95/100
z = 80, 95 100, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 12000<DD;
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<, PlotRange AllD
20 40 60 80 100 120
5
10
15
x(0)=0, p(0)=95/100
z = 80, 94 100, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 25000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 18
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<, PlotRange 8-.6, 5<D
50 100 150 200 250
1
2
3
4
5
x(0)=0, p(0)=12/10
z = 80, 12 10, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 8000<DD;
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<, PlotRange AllD
20 40 60 80
2
4
6
8
10
12
x(0)=0, p(0)=14/10
z = 80, 14 10, 0<;
orbit = Join@880, 0<<, Table@Do@z = RK4step@f, zD, 810<D; 8z@@3DD, z@@1DD<, 8n, 1, 5000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 19
ListPlot@orbit, PlotStyle 8Black, PointSize@.002D<, PlotRange AllD
10 20 30 40 50
2
4
6
8
10
12
14
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 20
Exercise 1.6 Elastic pendulum
Lagrangian
L(x, y, x, y) =
m
2
( x
2
+ y
2
)
k
2

x
2
+ y
2
l
0

2
mgy.
EulerLagrange equations
d
dt
L
x

L
x
= m x + k

x
2
+ y
2
l
0

x
2
+ y
2
= 0,
d
dt
L
y

L
y
= m y + k

x
2
+ y
2
l
0

x
2
+ y
2
+ mg = 0.
Canonical momenta
p
x
=
L
x
= m x, p
y
=
L
y
= m y.
Hamiltonian
H(x, y, p
x
, p
y
) = xp
x
+ yp
y
L(x, y, x, y)
=
1
2m
(p
2
x
+ p
2
y
) +
k
2

x
2
+ y
2
l
0

2
+ mgy
Hamiltons equations
x =
H
p
x
=
p
x
m
,
y =
H
p
y
=
p
y
m
,
p
x
=
H
x
= k

x
2
+ y
2
l
0

x
2
+ y
2
p
y
=
H
y
= k

x
2
+ y
2
l
0

x
2
+ y
2
mg.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 21
Exercise 1.7 Cycloid
To simplify the algebra, we write the cycloid equation as
x = f(y),
with derivative
f

(y) =

2a y
y
.
Choosing y as the generalized coordinate, the Lagrangian takes the form
L =
m
2
( x
2
+ y
2
) mgy =
m
2
(1 + f

(y)
2
) y
2
mgy,
which simplies to
ma y
2
y
mgy.
Introducing
p
y
=
2ma y
y
,
the Hamiltonian is
H =
yp
2
y
4ma
+ mgy,
with equations of motion
y =
y p
y
2ma
, p
y
= mg
p
2
y
4ma
.
The accompanying Mathematica notebook contains the numerical explo-
ration of the descent time (quarter-period) as a function initial height. It
appears that the descent time is independent of the initial height. This re-
sult is easy enough to obtain analytically, using energy conservation,
E =
ma y
2
y
+ mgy.
Solving for y gives
dy
dt
= y =

g
a

y(
E
mg
y),
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 22
so that
dt =

a
g
dy

y(
E
mg
y)
.
Integrating over one-quarter of a period,
T
4
=

a
g
E
mg
0
dy

y(
E
mg
y)
=

a
g

1
0
d
(1 )
=

a
g
.
This is clearly independent of the initial condition.
If, instead of y, one happened to choose the arc length s as the generalized
coordinate, then the relation
s =

1 + f

(y)
2
y =

2a
y
y
implies that
y(s) =
s
2
8a
.
The Hamiltonian is then
H =
p
2
s
2m
+ mgy(s) =
p
2
s
2m
+
mg
8a
s
2
,
namely that of a simple harmonic oscillator with energy-independent period
T = 4

a
g
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 23
Numerical calculation of cycloid descent times
h@y_D := a * ArcCos@Ha - yL aD + Sqrt@2 a y - y^2D
a = 1.0;
cycloid =
ListPlot@Table@8h@k 1000D, k 1000<, 8k, 0, 2000<D, Joined True, AspectRatio AutomaticD
0.5 1.0 1.5 2.0 2.5 3.0
0.5
1.0
1.5
2.0
Calculation and plot of y(t) for 9 different initial values y(0)
RK4step@z_D := Hk1 = f@zD * dt;
k2 = f@z + k1 2D * dt;
k3 = f@z + k2 2D * dt;
k4 = f@z + k3D * dt;
z + Hk1 + 2 * k2 + 2 * k3 + k4L 6L
f@8y_, p_<D := 8y * p 2, -1 - p^2 4<
dt = Pi 2000.; p0 = 0.; t0 = 0;
For@n = 1, n 9, n++, y0 = n 5.;
t = t0; z = z0 = 8y0, p0<;
tbl@nD = Join@88t0, z0<<, Table@t = t + dt; z = RK4step@zD; 8t, z@@1DD<, 82000<DDD
ListPlot@8tbl@1D, tbl@2D, tbl@3D, tbl@4D, tbl@5D, tbl@6D, tbl@7D, tbl@8D, tbl@9D<,
PlotStyle PointSize@.002DD
0.5 1.0 1.5 2.0 2.5 3.0
0.5
1.0
1.5
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 24
Zooming in on the endpoint
ListPlot@8tbl@1D, tbl@2D, tbl@3D, tbl@4D, tbl@5D, tbl@6D, tbl@7D, tbl@8D, tbl@9D<,
PlotRange 882.5, N@PiD<, 80, .2<<, PlotStyle PointSize@.002DD
2.5 2.6 2.7 2.8 2.9 3.0 3.1
0.00
0.05
0.10
0.15
0.20
2 Ex1-7.nb
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 25
Exercise 1.8 Bead on a Rotating Circle
Hamiltonian in dimensionless units
In[3]:= ham@h_, q_, p_D := p^2 2 - Cos@qD - h 2 Sin@qD^2
Contoup plot of ham[q,p] with adjustable parameter h = w
2
/g
In[4]:= Manipulate@ContourPlot@ham@h, q, pD, 8q, -2 Pi, 2 Pi<,
8p, -3, 3<, ContourShading False, ContourStyle BlackD, 8h, 0, 3<D
Out[4]=
h
1.2
-6 -4 -2 0 2 4 6
-3
-2
-1
0
1
2
3
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 26
Exercise 1-9 Chaotic bead on a loop
Calculation of q
e
(t) - q
0
(t) for e = 0.001 and 0 b t b 200
f@8theta_, ptheta_, tau_<D :=
8ptheta, -Sin@thetaD + H157 200L H1 + Sin@tauD 2L * Sin@2 thetaD, 1<
RK4step@g_, z_D := Module@8k1, k2, k3, k4<,
k1 = g@zD * dt;
k2 = g@z + k1 2D * dt;
k3 = g@z + k2 2D * dt;
k4 = g@z + k3D * dt;
z + Hk1 + 2 * k2 + 2 * k3 + k4L 6D
dt = .01;
epsilon = .001;
z0 = 8-1, 0, 0<;
z1 = 8-1, epsilon, 0<;
tbl =
Table@z0 = RK4step@f, z0D; z1 = RK4step@f, z1D; 8z0@@3DD, z0@@1DD - z1@@1DD<, 820000<D;
ListPlot@tbl, Joined True, PlotRange AllD
50 100 150 200
-1.0
-0.5
0.5
1.0
1.5
2.0
We see that the separation between the initially nearby orbits is O(1) after a time of about 100.
Separation time t as a function of initial displacement e
t@epsilon_D := Module@8z0 = 8-1, 0, 0<, z1 = 8-1, epsilon, 0<, n<,
For@n = 1, n < 10^8, n++,
z0 = RK4step@f, z0D;
z1 = RK4step@f, z1D;
If@Abs@z0@@1DD - z1@@1DDD 1, Break@DDD;
z0@@3DDD
t@.001D H* Compare with plot above *L
94.74
t@.0001D
139.12
t@.00001D
202.21
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 27
t@.000001D
256.27
ListPlot@Table@8r 5., t@10^H-r 5.LD<, 8r, 15, 50<D, Joined -> TrueD
4 5 6 7 8 9 10
50
100
150
200
250
300
The function t[epsilon]is increasing roughly proportional to Log[epsilon] as epsilon tends to zero.
High precision calculations
precision = 40;
set@x_D := SetPrecision@x, precisionD
$MinPrecision = precision;
dt = set@1 100D;
epsilon = set@1 1000D;
z0 = set@8-1, 0, 0<D;
z1 = set@8-1, epsilon, 0<D;
tbl =
Table@z0 = RK4step@f, z0D; z1 = RK4step@f, z1D; 8z0@@3DD, z0@@1DD - z1@@1DD<, 820000<D;
ListPlot@tbl, Joined True, PlotRange AllD
50 100 150 200
-1.0
-0.5
0.5
1.0
1.5
2.0
The results are stable with respect to increasing the precision. The sensitivity to initial conditions is not due to
round-off error, but rather is a property of the (presumably chaotic) dynamics,
2 Ex1-9.nb
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 28
Exercise 1.10 Independence of top integrals
The dependence of the three integrals of the motion, H, p

, p

requires
the simultaneous vanishing of all the 3 3 minors of the matrix of partial
derivatives, whose rows are the respective gradient vectors,

H = ( p

, 0, 0,

,

,

),

= (0, 0, 0, 0, 1, 0),

= (0, 0, 0, 0, 0, 1).
The only nontrivial equations are

0 1 0
0 0 1

=

= 0,

0 1 0
0 0 1

= p

= I

= 0.
Thus the three integrals are independent everywhere except on a bound-
ary manifold of dimension < 6, hence of measure zero. On the boundary
manifold, the motions are characterized by constant (absence of nutation).
Since

=
p

cos
I

sin
2

,

=
(p

cos p

) cos
I

sin
2

+
p

I
r
,
these motions also have constant precession and spin rates.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 29
Exercise 1-11 Symmetric top orbits
Function definitions
f@u_D := Hu - u1L * Hu - u2L * Hu - u3L
a := Module@8c0, c1<,
c0 = u1 + u2 + u3 + u1 * u2 * u3;
c1 = u1 * u2 + u1 * u3 + u2 * u3 + 1;
H1 2L * HSqrt@c0 + c1D + Sqrt@c0 - c1DLD
b := Module@8c0, c1<,
c0 = u1 + u2 + u3 + u1 * u2 * u3;
c1 = u1 * u2 + u1 * u3 + u2 * u3 + 1;
H1 2L * HSqrt@c0 + c1D - Sqrt@c0 - c1DLD
RK4step@g_, 8t_, z_<D := Module@8k1, k2, k3, k4<,
k1 = g@8t, z<D * dt;
k2 = g@8t + dt 2, z + k1 2<D * dt;
k3 = g@8t + dt 2, z + k2 2<D * dt;
k4 = g@8t + dt, z + k3<D * dt;
8t + dt, z + Hk1 + 2 * k2 + 2 * k3 + k4L 6<D
phidot@u_D := Hb - a * uL H1 - u^2L
f@8t_, 8u_, phi_<<D :=
8If@EvenQ@Floor@t halfperiodDD, 1, -1D * Re@Sqrt@f@uDDD,
phidot@uD<
u3=1.1
u1 = .2; u2 = .8; u3 = 1.1;
steps = 40;
y = y0 = 80, 8u1 + .0000001, N@PiD<<;
halfperiod = Re@NIntegrate@1 Sqrt@f@uDD, 8u, u1, u2<DD;
dt = halfperiod steps;
cycles = 4;
data = Table@80, 0<, 82 * cycles * steps<D;
For@k = 0, k < cycles, k++,
y@@2, 1DD = u1 + .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@2 * k * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
y@@2, 1DD = u2 - .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@H2 * k + 1L * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 30
thetatable = Table@8Hk - 1L * dt, data@@k, 1DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@thetatable, Joined True, PlotStyle 8Black, Thickness@.003D<D
5 10 15 20 25 30
0.2
0.4
0.6
0.8
1.0
1.2
1.4
phitable = Table@8Hk - 1L * dt, data@@k, 2DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@phitable, Joined True, PlotStyle 8Black, Thickness@.003D<D
5 10 15 20 25 30
5
10
15
20
Note that precession rate f

is always positive, increasing and decreasing in synchrony with the nutation.


u3=1.4
u1 = .2; u2 = .8; u3 = 1.4;
steps = 40;
y = y0 = 80, 8u1 + .0000001, N@PiD<<;
halfperiod = Re@NIntegrate@1 Sqrt@f@uDD, 8u, u1, u2<DD;
dt = halfperiod steps;
cycles = 4;
data = Table@80, 0<, 82 * cycles * steps<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 31
For@k = 0, k < cycles, k++,
y@@2, 1DD = u1 + .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@2 * k * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
y@@2, 1DD = u2 - .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@H2 * k + 1L * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
D
thetatable = Table@8Hk - 1L * dt, data@@k, 1DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@thetatable, Joined True, PlotStyle 8Black, Thickness@.003D<D
5 10 15 20 25
0.2
0.4
0.6
0.8
1.0
1.2
1.4
phitable = Table@8Hk - 1L * dt, data@@k, 2DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@phitable, Joined True, PlotStyle 8Black, Thickness@.003D<D
5 10 15 20 25
2
4
6
8
10
12
14
Note that the precession rate is always nonnegative, decreasing to zero once every nutation period. This corre-
sponds to the cusp in the plot shown in EHD Figure 1.18 (b).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 32
u3=4.0
u1 = .2; u2 = .8; u3 = 4.0;
steps = 40;
y = y0 = 80, 8u1 + .0000001, N@PiD<<;
halfperiod = Re@NIntegrate@1 Sqrt@f@uDD, 8u, u1, u2<DD;
dt = halfperiod steps;
cycles = 4;
data = Table@80, 0<, 82 * cycles * steps<D;
For@k = 0, k < cycles, k++,
y@@2, 1DD = u1 + .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@2 * k * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
y@@2, 1DD = u2 - .0000001;
For@n = 1, n steps, n++,
theta = ArcCos@y@@2, 1DDD;
phi = y@@2, 2DD;
data@@H2 * k + 1L * steps + nDD = 8theta, phi<;
y = RK4step@f, yDD;
D
thetatable = Table@8Hk - 1L * dt, data@@k, 1DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@thetatable, Joined True, PlotStyle 8Black, Thickness@.003D<D
2 4 6 8 10 12
0.2
0.4
0.6
0.8
1.0
1.2
1.4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 33
phitable = Table@8Hk - 1L * dt, data@@k, 2DD<, 8k, 1, 2 * cycles * steps<D;
ListPlot@phitable, Joined True, PlotStyle 8Black, Thickness@.003D<D
2 4 6 8 10 12
1
2
3
4
5
6
Note that the precession changes direction twice each nutation period, corresponding to the looping behavior
shown in EHD Figure 1.18 (c).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 1 34
Chapter 2 The Hamiltonian formalism
CONTENTS
2.1 Jacobi identity (L) 36
2.2 Canonical transformation (L) 37
2.3 Another canonical transformation (L) 38
2.4 Time-dependent canonical transformations (L) 39
2.5 Angular momentum Poisson brackets (L) 42
2.6 Normal modes of a triatomic molecule (L, M) 43
2.7 Linear triatomic molecule (M) 47
2.8 Normal modes with degeneracy (L) 50
2.9 Stability test for the collinear Lagrange points (M) 51
2.10 Stability test for the Lagrange points L
4
and L
5
(M) 58
2.11 Linear stability test (L) 60
2.12 Harmonic attraction in corotating frame (M) 61
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 35
Exercise 2.1 Jacobi identity
The simplest solution is simply to expand the terms of the Jacobi identity
using the denition of the Poisson bracket,
[F, G] =
F
q
k
G
p
k

F
p
k
G
q
k
,
with summation over k from 1 to n understood. Once the parentheses have
been removed by distributing the derivatives, there are 24 terms, which can
be seen to cancel in pairs.
The messy algebra can be avoided by properly dening the Posson bracket
as a Mathematica function, and showing that the left-hand side of the Jacobi
identity evaluates to zero. This is a little tricky, since lots of Mathematica
expressions evaluate to zero without having anything to do with the Jacobi
identity. For example, if your denition of the Poisson bracket is not proper,
so that it always evaluates to zero, then the Jacobi identity will also evaluate
to zero.
A more elegant derivation is possible using (EHD:2.1). Then, writing
k
for /
k
,
[A, [B, C]] =
k
A
kl

l
(
m
B
mn

n
C)
=
kl

mn
(
k
A
l

m
B
n
C +
k
A
l

n
C
m
B)
Using the (anti)symmetry properties of
kl

mn
with respect to interchanges
of indices, the last equation can be rewritten as
[A, [B, C]] =
kl

mn
(
k
A
l

m
B
n
C
k
B
l

n
C
m
A).
Since the second term diers from the rst by a minus sign and a cyclic
permutation A B C A, we get complete cancellation when we sum
over cyclic permutations to form the Jacobi identity.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 36
Exercise 2.2 Canonical transformation
The trick is to rewrite the transformation equation for P(q, p) as
p = 5 + P cos q.
Since the right-hand side is a function of the variables q, P, we can seek to
express it as the q-derivative of a generating function of type 2. The choice is
dictated by the set of mixed variables: if these were p, P, we would introduce
a generating function of type 4 instead. Thus
p = 5 + P cos q =

q
F
2
(q, P),
which can be integrated immediately to yield
F
2
(q, P) = 5q + P sin q + G(P),
where the constant of integration G(P) is an arbitrary function of P.
The second transformation equation is then obtained by dierentiating
F
2
with respect to P:
Q =
F
2
P
= sin q + G

p 5
cos q

As a check, one readily veries the canonical Poisson bracket relation,


[Q, P] = 1.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 37
Exercise 2.3 Another canonical transformation
The trick is to rewrite the transformation equation for Q(q, p, t) as
q = Q
2
e
2t
sec
2
p.
Since the right-hand side is a function of the variables p, Q, t, we can seek to
express it as minus the p-derivative of a generating function of type 3. The
choice is dictated by the set of mixed variables: if these were p, P, t, we would
introduce a generating function of type 4 instead. Thus
q = Q
2
e
2t
sec
2
p =

p
F
3
(q, P, t).
The integration is immediate:
F
3
(p, Q, t) = Q
2
tan p e
2t
+ G(Q, t),
where the constant of integration is an arbitrary smooth function of Q and
t. We get the other transformation equation by dierentiating with respect
to Q:
P =
F
3
Q
= 2Qtan p e
2t
+
G
Q
P = 2q
1/2
e
t
sin p +
G
Q
(q
1/2
e
t
sec p, t)
The second term can be replaced with any smooth function of q
1/2
sec p
and t without destroying the Poisson bracket relation
[Q, P] = 1.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 38
Exercise 2.4 Time-dependent canonical transformations
Before getting into the details of this technically demanding exercise, let
us discuss briey an important notational issue, namely the overloading of
symbols. Consider, for example, a canonical transformation from coordi-
nates q, p to new coordinates Q, P. In the textbook, it is not unusual to
nd the symbol Q being used in two dierent mathematical roles: sometimes
as an independent variable, sometimes as a function Q(q, p, t). Usually the
meaning is clear from the context, so that when a partial derivative Q/p
j
appears in a formula, we have no doubt that Q is being treated as a function
of q
1
, . . . , q
n
, p
1
, . . . , p
n
, t, and so the derivative should be taken with all the
variables in the list except p
j
held xed. Now suppose we add another possi-
ble coordinate system, such as q
1
, . . . , q
n
, P
1
, . . . , P
n
. Do we want to overload
the symbol Q with another interpretation, namely as Q(q, P, t)? Now Q/t
is ambiguous, since the notation does not specify whether to hold q, p or q, P
xed.
There are various solutions to the overloading problem. The most straight-
forward is to reject overloading altogether, introducing distinct names for all
the functions involved, for example
Q
k
= e
k
(q, p, t) =
F
2
P
k
(q, P, t) , P
k
= f
k
(q, p, t), p
k
=
F
2
q
k
(q, P, t)
and insisting that both sides of an equation should be expressed in terms
of the same system of coordinates. Let us see what this looks like in the
derivation of (EHD:2.11) for type-2 generating functions. The relations to
be proved take the form
e
k
t
(q, p, t) =

e
k
(q, p, t),

F
2
t
(q, P, t)

Pf(q,p,t)

,
and the analogous equation with e
k
replaced by f
k
. To demonstrate the
method, we will consider only the rst of these.
Following the pattern of the proof in the textbook, we rst work on the
left-hand side:
e
k
t
(q, p, t) =

2
F
2
tP
k
(q, P, t)
Pf(q,p,t)

e
k
p
l
(q, p, t)

2
F
2
tq
k
(q, P, t)
Pf(q,p,t)
.
(5)
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 39
Here we have left the nal expression as an explicit function of the variables
q, p, t.
Now we turn to the right-hand side, applying the denition of the Poisson
bracket:

e
k
(q, p, t),

F
2
t
(q, P, t)

Pf(q,p,t)

=
e
k
q
l
(q, p, t)

2
F
2
tP
j
(q, P, t)
Pf(q,p,t)
f
j
p
l
(q, p, t)
e
k
p
l
(q, p, t)

2
F
2
tq
l
(q, P, t)
Pf(q,p,t)
(6)
e
k
p
l
(q, p, t)

2
F
2
tP
j
(q, P, t)
Pf(q,p,t)
f
j
q
l
(q, p, t)
We notice that, within the sum of the rst and third terms of this last
expression, is the elementary Q, P Poisson bracket,
e
k
q
l
(q, p, t)
f
j
p
l
(q, p, t)
e
k
p
l
(q, p, t)
f
j
q
l
(q, p, t) = [e
k
(q, p, t), f
j
(q, p, t)] =
kl
.
Inserting this into (6) and summing over l, we get precisely the righthand
side of (5).
The approach adopted in the textbook is quite dierent: the overload-
ing of symbols is maintained, but partial derivatives with respect to the two
coordinate systems are distinguished from one another. In this way, the
expressions are unambiguous, even when the sets of arguments are not writ-
ten explicitly. Let us now apply the same technique to the verication of
(EHD:2.11) with F = F
1
(q, Q, t). Clearly, we now associate the symbol
with the coordinate set q, p, t, and

with the set q, Q, t. In the proof, we
will exploit the identities
P
j
=

F
1

Q
j
, p
j
=

F
1

q
j
, (7)
as well as the canonical Poisson bracket relations for Q, P.
The left-hand side of the Q
k
/t identity becomes
Q
k
t
=

Q
k

Q
k
p
l

p
l

t
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 40
Since Q
k
and t are independent variables in the mixed coordinate scheme,
the quantity

Q
k

t
vanishes. Inserting the formula for p
l
in (7), we get
Q
k
t
=
Q
k
p
l

2
F
1

t

q
l
(8)
Now we turn to the right-hand side of the identity, applying the denition
of the Poisson bracket to obtain

Q
k
,

F
1

=
Q
k
q
l

2
F
1

t

Q
m
Q
m
p
l

Q
k
p
l

2
F
1

t

q
l

Q
k
p
l

2
F
1

t

Q
m
Q
m
q
l
.
We note that the sum of the rst and third terms by virtue of the canonical
Poisson bracket relation
[Q
k
, Q
m
] = 0,
and hence we are left with

Q
k
,

F
1

=
Q
k
p
l

2
F
1

t

q
l
. (9)
The right-hand sides of (8) and (9) are identitical, and hence we have the
desired identity of the left-hand sides.
The corresponding identity for P
k
follows the same pattern:
P
k
t
=

P
k

P
k
p
l

p
l

t
=

2
F
1

t

Q
k

P
k
p
l

2
F
1

t

q
l
.

P
k
,

F
1

2
F
1

t

Q
m
[P
k
, Q
m
]
P
k
p
l

2
F
1

t

q
l
.
Inserting
[P
k
, Q
m
] =
km
and summing over m, we get the desired equality of the respective right-hand
sides.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 41
Exercise 2.5 Angular momentum Poisson brackets
We calculate the Poisson bracket of L
2
x
+L
2
y
+L
2
z
with L
x
. Using linearity,
[L
2
x
+ L
2
y
+ L
2
z
, L
x
] = [L
2
x
, L
x
] + [L
2
y
, L
x
] + [L
2
z
, L
x
]. (10)
But
[L
2
x
, L
x
] = 2 [L
x
, L
x
] L
x
= 0 by antisymmetry,

L
2
y
, L
x

= 2 L
y
[L
y
, L
x
] = 2 L
y
L
z
,
[L
2
z
, L
x
] = 2 L
z
[L
z
, L
x
] = 2 L
z
L
y
.
Hence (10) vanishes. The Poisson commutation relations with L
y
and L
z
are
completely analogous.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 42
Exercise 2.6 Normal modes of a triatomic molecule
We begin by calculating the matrix

C = C:

C =

0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0

k
1
0 0 0
0 k
2
0 0
0 0 (1
3
)/(
1

2
) 1/
2
0 0 1/
2
(1
1
)/(
2

3
)

0 0 (1
3
)/(
1

2
) 1/
2
0 0 1/
2
(1
1
)/(
2

3
)
k
1
0 0 0
0 k
2
0 0

The calculation of the eigenvalue equation is straightforward:


det(

C 1
4
) =

0 (1
3
)/(
1

2
) 1/
2
0 1/
2
(1
1
)/(
2

3
)
k
1
0 0
0 k
2
0

.
=

1/
2
(1
1
)/(
2

3
)
0 0
k
2
0

k
1

0 (1
3
)/(
1

2
) 1/
2
1/
2
(1
1
)/(
2

3
)
k
2
0

Expanding the 3 3 determinants gives (EHD:2.20). This is a quadratic


equation for
2
, with the solution

2
=
b
2

1
2

b
2
4c,
where
b = k
1
1
3

2
+ k
2
1
1

3
, c =
k
1
k
2

3
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 43
Using the relation
2
= 1
1

3
, it is easy to show
b
2
> b
2
4c =

k
1
1
3

2
k
2
1
1

2
+
4k
1
k
2

2
2
> 0.
We conclude that the equation has two real, negative solutions for
2
, hence,
up to sign, two pure imaginary solutions for .
For the remainder of this exercise, we turn to the accompanying Mathe-
matica notebook.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 44
Calculation of the eigenvectors
The eigenvectors can be obtained by solving the matrix relation
( C

- l
i
1
4
) e
i
=0
for the respective eigenvalues l= l
i
, i=1,2,3,4. We solve simultaneously the 2nd, 3rd, and 4th rows
of the matrix equation, the 1st row being redundant.
matrixM = 880, -lambda, -1 mu2<, 8-k1, 0, -lambda<, 80, -k2, 0<<;
invM = Inverse@matrixMD
::
lambda mu2
k1
, -
1
k1
, -
lambda
2
mu2
k1 k2
>, :0, 0, -
1
k2
>, :-mu2, 0,
lambda mu2
k2
>>
v = -8H1 - mu1L Hmu2 mu3L, 0, -lambda<;
invM.v
:-
lambda
3
mu2
k1 k2
-
lambda H1 - mu1L
k1 mu3
, -
lambda
k2
,
lambda
2
mu2
k2
+
1 - mu1
mu3
>
psi@lambda_D := :-
lambda
3
mu2
k1 k2
-
lambda H1 - mu1L
k1 mu3
, -
lambda
k2
,
lambda
2
mu2
k2
+
1 - mu1
mu3
, 1>
b = k1 H1 - mu3L Hmu1 mu2L + k2 H1 - mu1L Hmu2 mu3L;
c = k1 k2 Hmu1 mu2 mu3L;
lam@1D = I b 2 - 1 2 b^2 - 4 c ;
lam@2D = I b 2 + 1 2 b^2 - 4 c ;
lam@3D = -I b 2 - 1 2 b^2 - 4 c ;
lam@4D = -I b 2 + 1 2 b^2 - 4 c ;
eigvec@1D = psi@lam@1DD psi@lam@3DD.matrixC.psi@lam@1DD ;
eigvec@2D = psi@lam@2DD psi@lam@4DD.matrixC.psi@lam@2DD ;
eigvec@3D = psi@lam@3DD psi@lam@3DD.matrixC.psi@lam@1DD ;
eigvec@4D = psi@lam@4DD psi@lam@4DD.matrixC.psi@lam@2DD ;
Simplify@matrixK.psi@lambdaDD
9Ilambda
2
mu1 mu2 Ik2 - k2 mu1 + lambda
2
mu2 mu3M +
k1 I-lambda
2
mu2 H-1 + mu3L mu3 - k2 H-1 + mu1 + mu3LMM Hk1 k2 mu1 mu2 mu3L, 0, 0, 0=
CollectAIlambda
2
mu1 mu2 Ik2 - k2 mu1 + lambda
2
mu2 mu3M +
k1 I-lambda
2
mu2 H-1 + mu3L mu3 - k2 H-1 + mu1 + mu3LMM Hmu1 mu2^2 mu3L, lambdaE
lambda
4
-
k1 k2 H-1 + mu1 + mu3L
mu1 mu2
2
mu3
+
lambda
2
Ik2 mu1 mu2 - k2 mu1
2
mu2 - k1 mu2 H-1 + mu3L mu3M
mu1 mu2
2
mu3
This vanishes by virtue of the eigenvalue equation. Hence we have verified directly the eigenvector property, and so
we can replace matrixC.psi[lam[j]] by -lam[j] omega.psi[lam[j]]in the orthogonality formulas.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 45
Orthogonality relations
The diagonal quantities psi[lam[i]].omega.psi[lam[i]]all vanish because of the antisymmetry of omega .
FullSimplify@psi@lam@1DD.omega.psi@lam@2DD . mu2 1 - mu1 - mu3D
0
FullSimplify@psi@lam@1DD.omega.psi@lam@4DD . mu2 1 - mu1 - mu3D
0
FullSimplify@psi@lam@2DD.omega.psi@lam@3DD . mu2 1 - mu1 - mu3D
0
Normalization conditions
FullSimplify@- lambda psi@-lambdaD.omega.psi@lambdaDD
-
1
k1 k2
2
mu3
2
2 lambda
2
Ik2
2
H-1 + mu1L
2
+ lambda
4
mu2
2
mu3
2
+ k2 mu3 I-2 lambda
2
H-1 + mu1L mu2 + k1 mu3MM
Collect@
FullSimplify@%36 * k1 * k2^2 * mu1 * mu3^2 lambda^2 . lambda^4 -b lambda^2 - cD, lambdaD
-2 Ik2
2
H-1 + mu1L
2
mu1 - k1 k2 mu2 mu3 + k1 k2 mu1 mu3
2
M -
2 lambda
2
I-k2 H-1 + mu1L mu1 mu2 mu3 + k1 mu2 H-1 + mu3L mu3
2
M
Inserting these expressions into eigvec[i], i=1,2,3,4, gives the normalized eigenvectors.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 46
Exercise 2.7 Linear triatomic molecule
mu1 = mu3 = 1 4; mu2 = 1 2;
k1 = k2 = k;
a1 = a2 = a;
omega = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<;
matrixC = 88k1, 0, 0, 0<, 80, k2, 0, 0<,
80, 0, H1 - mu3L Hmu1 mu2L, -1 mu2<, 80, 0, -1 mu2, H1 - mu1L Hmu2 mu3L<<
88k, 0, 0, 0<, 80, k, 0, 0<, 80, 0, 6, -2<, 80, 0, -2, 6<<
MatrixForm@omegaD
0 0 1 0
0 0 0 1
-1 0 0 0
0 -1 0 0
MatrixForm@matrixCD
k 0 0 0
0 k 0 0
0 0 6 -2
0 0 -2 6
tildeC = omega.matrixC; MatrixForm@tildeCD
0 0 6 -2
0 0 -2 6
-k 0 0 0
0 -k 0 0
Collect@Det@tildeC - lambda IdentityMatrix@4DD, lambdaD
32 k
2
+ 12 k lambda
2
+ lambda
4
SolveA32 k
2
+ 12 k lambda
2
+ lambda
4
0, lambdaE
::lambda -2 k >, :lambda 2 k >, :lambda -2 2 k >, :lambda 2 2 k >>
matrixK = tildeC - lambda IdentityMatrix@4D
88-lambda, 0, 6, -2<, 80, -lambda, -2, 6<, 8-k, 0, -lambda, 0<, 80, -k, 0, -lambda<<
matrixM = 880, -lambda, -1 mu2<, 8-k1, 0, -lambda<, 80, -k2, 0<<;
invM = Inverse@matrixMD
::
lambda
2 k
, -
1
k
, -
lambda
2
2 k
2
>, :0, 0, -
1
k
>, :-
1
2
, 0,
lambda
2 k
>>
v = -8H1 - mu1L Hmu2 mu3L, 0, -lambda<;
invM.v
:-
3 lambda
k
-
lambda
3
2 k
2
, -
lambda
k
, 3 +
lambda
2
2 k
>
psi@lambda_D := :-
3 lambda
k
-
lambda
3
2 k
2
, -
lambda
k
, 3 +
lambda
2
2 k
, 1>
Collect@Simplify@matrixK.psi@lambdaD k1 k2 mu2D, lambdaD
932 k
2
+ 12 k lambda
2
+ lambda
4
, 0, 0, 0=
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 47
lam@1D = I Sqrt@4 kD;
lam@2D = I Sqrt@8 kD;
lam@3D = -I Sqrt@4 kD;
lam@4D = -I Sqrt@8 kD;
MatrixForm@Simplify@Table@psi@lam@iDD.matrixC.psi@lam@jDD, 8i, 1, 4<, 8j, 1, 4<DDD
0 0 16 0
0 0 0 32
16 0 0 0
0 32 0 0
eigvec@1D = psi@lam@1DD 4
:-

2 k
, -

2 k
,
1
4
,
1
4
>
eigvec@2D = psi@lam@2DD Sqrt@32D
:

2 k
, -

2 k
, -
1
4 2
,
1
4 2
>
eigvec@3D = psi@lam@3DD 4
:

2 k
,

2 k
,
1
4
,
1
4
>
eigvec@4D = psi@lam@4DD Sqrt@32D
:-

2 k
,

2 k
, -
1
4 2
,
1
4 2
>
MatrixForm@Simplify@Table@eigvec@iD.matrixC.eigvec@jD, 8i, 1, 4<, 8j, 1, 4<DDD
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
Initial value problem
We use formula (EHD:2.17). Once we have determined xi(t) = (q1(t),q2(t),p1(t),p2(t)), the coordinates x1(t), x2(t),
x3(t) will be given by the transformation equations
x2=x1+a + q1, x3=x2 + a + q2
and the center-of-mass condition, mu1 x1 + mu2 x2 + mu3 x3 =0 , which implies
4 x1 + 5 a + 3 q1 + 2 q2 =0.
Initially, q1=0=q2, dq1/dt=-v0, dq2/dt=0,
and so xi = (q1,q2,p1,p2) is given by
xi0 = 80, 0, -3 v0 16, -v0 16<;
The coefficients in (EHD:2.17) are given by
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 48
coef = Table@eigvec@iD.matrixC.xi0, 8i, 1, 4<D
:-
v0
4
,
v0
4 2
, -
v0
4
,
v0
4 2
>
8q1, q2< = coef@@3DD eigvec@1D@@81, 2<DD E^Hlam@1D tL +
coef@@1DD eigvec@3D@@81, 2<DD E^Hlam@3D tL +
coef@@4DD eigvec@2D@@81, 2<DD E^Hlam@2D tL +
coef@@2DD eigvec@4D@@81, 2<DD E^Hlam@4D tL
:-

-2 k t
v0
8 k
+

2 k t
v0
8 k
-

-2 2 k t
v0
8 2 k
+

2 2 k t
v0
8 2 k
,
-

-2 k t
v0
8 k
+

2 k t
v0
8 k
+

-2 2 k t
v0
8 2 k
-

2 2 k t
v0
8 2 k
>
(q1,q2) = (-v0/ 16 k ) ( sin( 4 k t) + sin ( 8 k t )/ 2 ,
sin( 4 k t) - sin ( 8 k t )/ 2 )
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 49
Exercise 2.8 Normal modes with degeneracy
The case of degenerate eigenvalues of the matrix

C = C is handled
using essentially the same technique which we use for ordinary scalar products
in a vector space. According to the discussion of EHD, Section 2.10, all of
the vectors with eigenvalue (assumed to be pure imaginary) are orthogonal
to all of the vectors with any eigenvalue dierent from :

C = ,

C = , = = C = 0.
Let H
()
be the m-dimensional subspace of vectors with eigenvalue .
We wish to construct an orthonormal basis for these subspaces. The rst
step is easy: choose arbitrary vectors
()
1
H
()
and
()
1
H
()
such
that

()
1
C
()
1
= 1, (11)
renormalizing if necessary.
Next, we want to select
()
2
H
()
such that

()
2
C
()
1
= 0. (12)
Suppose H
()
is linearly independent of
()
1
. We can then take

()
2
= ( C
()
1
)
()
1
.
It is easy to check, using (11) that this vector satises (12).
To construct
()
2
, we choose H
()
linearly independent of
()
1
and
set

()
2
= (
()
1
C )
()
1
.
Before proceeding to the analogous construction of
()
3
and
()
3
, we
normalize
()
2
and
()
2
such that their C-scalar-product is unity.
From here on, we repeat the process until a complete orthonormal basis
has been constructed.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 50
Exercise 2.9 Stability of the collinear Lagrange points
In[5]:= ham@x_, y_, px_, py_D := px^2 2 + py^2 2 -
w^2 mu Sqrt@Hx + mu - 1L^2 + y^2D - w^2 H1 - muL Sqrt@Hx + muL^2 + y^2D + w px y - w py x
Lagrange points on the X axis
In[6]:= f@x_, mu_D :=
x Hx + muL^2 Hx + mu - 1L^2 - HSign@x + muD H1 - muL Hx + mu - 1L^2 + Sign@x + mu - 1D mu Hx + muL^2L
In[7]:= Manipulate@Plot@f@x, muD, 8x, -1.2, 1.6<, PlotRange 8-2, 2<D, 8mu, 10^H-4L, 1 2<D
Out[7]=
mu
0.25
-1.0 -0.5 0.5 1.0 1.5
-2
-1
1
2
L
1
(-mu < x < 1-mu)
f1@x_, mu_D := x Hx + muL^2 Hx + mu - 1L^2 - H1 - muL Hx + mu - 1L^2 + mu Hx + muL^2
FindRoot@f1@x, 0.1D 0, 8x, 0.5<D
8x 0.609035<
We expand the Hamiltonian about the equilibrium point at x=x1+u, y=v, px=pu, py=w x1 + pv, keeping only the
quadratic terms in u,v,pu,pv
Simplify@HNormalSeries@ham@x1 + r u, r v, r pu, w x1 + r pvD, 8r, 0, 2<D -
NormalSeries@ham@x1 + r u, r v, r pu, w x1 + r pvD, 8r, 0, 1<DL . r 1D
h :=
1
2
pu
2
+ pv
2
- 2 pv u w + 2 pu v w + w
2
v
2
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
+
Hmu + x1L
2
Hmu + x1L
4
-
mu Hmu + x1L
2
Hmu + x1L
4
+ 2 u
2
-
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
-
Hmu + x1L
2
Hmu + x1L
4
+
mu Hmu + x1L
2
Hmu + x1L
4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 51
Now we specialize to -mu<x<1-mu
SimplifyBh . : H-1 + mu + x1L
2
-x1 - mu + 1, Hmu + x1L
2
x1 + mu>F
1
2
Ipu
2
+ pv
2
- 2 pv u w + 2 pu v w +
II2 u
2
- v
2
M w
2
I2 mu
4
- H-1 + x1L
3
+ mu
3
H-4 + 6 x1L + mu
2
I6 - 9 x1 + 6 x1
2
M +
mu I-4 + 9 x1 - 6 x1
2
+ 2 x1
3
MMM IH-1 + mu + x1L
3
Hmu + x1L
3
MM
Let
k := -
2 mu
4
- H-1 + x1L
3
+ mu
3
H-4 + 6 x1L + mu
2
I6 - 9 x1 + 6 x1
2
M + mu I-4 + 9 x1 - 6 x1
2
+ 2 x1
3
M
H-1 + mu + x1L
3
Hmu + x1L
3
x1 := x . FindRoot@f1@x, muD 0, 8x, 0.5 - mu<D
Plot@k, 8mu, 0, 1<D
0.2 0.4 0.6 0.8 1.0
5
6
7
8
ham1@u_, v_, pu_, pv_D := H1 2L Hpu^2 + pv^2 L + w Hpu v - u pvL - Hk 2L w^2 H2 u^2 - v^2L
Clear@kD
matrixC := 88-2 k w^2, 0, 0, -w 2<, 80, k w^2, w 2, 0<, 80, w 2, 1, 0<, 8-w 2, 0, 0, 1<<;
MatrixForm@matrixCD
-2 k w
2
0 0 -
w
2
0 k w
2
w
2
0
0
w
2
1 0
-
w
2
0 0 1
omega = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<; MatrixForm@omegaD
0 0 1 0
0 0 0 1
-1 0 0 0
0 -1 0 0
Det@omega.matrixC - lambda IdentityMatrix@4DD
lambda
4
+
lambda
2
w
2
2
- k lambda
2
w
2
+
w
4
16
+
k w
4
4
- 2 k
2
w
4
b := H-k + 1 2L;
c := -2 k^2 + k 4 + 1 16
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 52
Simplify@H-k + 1 2L^2 - 4 H-2 k^2 + k 4 + 1 16LD
k H-2 + 9 kL
Plot@8b + Sqrt@b^2 - 4 cD, b - Sqrt@b^2 - 4 cD<, 8mu, 0, 1 2<D
0.1 0.2 0.3 0.4 0.5
-30
-20
-10
10
L
2
(x > 1-mu)
f2@x_, mu_D := x Hx + muL^2 Hx + mu - 1L^2 - H1 - muL Hx + mu - 1L^2 - mu Hx + muL^2
h :=
1
2
pu
2
+ pv
2
- 2 pv u w + 2 pu v w + w
2
v
2
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
+
Hmu + x1L
2
Hmu + x1L
4
-
mu Hmu + x1L
2
Hmu + x1L
4
+ 2 u
2
-
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
-
Hmu + x1L
2
Hmu + x1L
4
+
mu Hmu + x1L
2
Hmu + x1L
4
SimplifyBh . : H-1 + mu + x1L
2
x1 + mu - 1, Hmu + x1L
2
x1 + mu>F
1
2
pu
2
+ pv
2
- 2 pv u w + 2 pu v w +
I-2 u
2
+ v
2
M w
2
I4 mu
3
+ H-1 + x1L
3
+ mu
2
H-6 + 9 x1L + mu I4 - 9 x1 + 6 x1
2
MM
H-1 + mu + x1L
3
Hmu + x1L
3
k :=
4 mu
3
+ H-1 + x1L
3
+ mu
2
H-6 + 9 x1L + mu I4 - 9 x1 + 6 x1
2
M
H-1 + mu + x1L
3
Hmu + x1L
3
x1 := x . FindRoot@f2@x, muD 0, 8x, 2<D
FindRoot@f2@x, .1D 0, 8x, 3<D
8x 1.2597<
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 53
Plot@k, 8mu, 0, 1 2<D
0.1 0.2 0.3 0.4 0.5
2.0
2.5
3.0
3.5
4.0
ham2@u_, v_, pu_, pv_D := H1 2L Hpu^2 + pv^2 L + w Hpu v - u pvL - Hk 2L w^2 H2 u^2 - v^2L
Clear@kD
matrixC := 88-2 k w^2, 0, 0, -w 2<, 80, k w^2, w 2, 0<, 80, w 2, 1, 0<, 8-w 2, 0, 0, 1<<;
MatrixForm@matrixCD
-2 k w
2
0 0 -
w
2
0 k w
2
w
2
0
0
w
2
1 0
-
w
2
0 0 1
omega = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<; MatrixForm@omegaD
0 0 1 0
0 0 0 1
-1 0 0 0
0 -1 0 0
Det@omega.matrixC - lambda IdentityMatrix@4DD
lambda
4
+
lambda
2
w
2
2
- k lambda
2
w
2
+
w
4
16
+
k w
4
4
- 2 k
2
w
4
b := H-k + 1 2L;
c := -2 k^2 + k 4 + 1 16
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 54
Plot@8b + Sqrt@b^2 - 4 cD, b - Sqrt@b^2 - 4 cD<, 8mu, 0, 1 2<D
0.1 0.2 0.3 0.4 0.5
-15
-10
-5
5
L
3
( x < -mu)
Clear@k, x1D
f3@x_, mu_D := x Hx + muL^2 Hx + mu - 1L^2 + H1 - muL Hx + mu - 1L^2 + mu Hx + muL^2
h :=
1
2
pu
2
+ pv
2
- 2 pv u w + 2 pu v w + w
2
v
2
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
+
Hmu + x1L
2
Hmu + x1L
4
-
mu Hmu + x1L
2
Hmu + x1L
4
+ 2 u
2
-
mu H-1 + mu + x1L
2
H-1 + mu + x1L
4
-
Hmu + x1L
2
Hmu + x1L
4
+
mu Hmu + x1L
2
Hmu + x1L
4
SimplifyBh . : H-1 + mu + x1L
2
-x1 - mu + 1, Hmu + x1L
2
-x1 - mu>F
1
2
pu
2
+ pv
2
- 2 pv u w + 2 pu v w +
I2 u
2
- v
2
M w
2
I4 mu
3
+ H-1 + x1L
3
+ mu
2
H-6 + 9 x1L + mu I4 - 9 x1 + 6 x1
2
MM
H-1 + mu + x1L
3
Hmu + x1L
3
k := -
4 mu
3
+ H-1 + x1L
3
+ mu
2
H-6 + 9 x1L + mu I4 - 9 x1 + 6 x1
2
M
H-1 + mu + x1L
3
Hmu + x1L
3
x1 := x . FindRoot@f3@x, muD 0, 8x, -1<D
FindRoot@f3@x, .1D 0, 8x, -1<D
8x -1.04161<
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 55
Plot@k, 8mu, 0, 1 2<D
0.1 0.2 0.3 0.4 0.5
1.1
1.2
1.3
1.4
1.5
ham2@u_, v_, pu_, pv_D := H1 2L Hpu^2 + pv^2 L + w Hpu v - u pvL - Hk 2L w^2 H2 u^2 - v^2L
Clear@kD
matrixC := 88-2 k w^2, 0, 0, -w 2<, 80, k w^2, w 2, 0<, 80, w 2, 1, 0<, 8-w 2, 0, 0, 1<<;
MatrixForm@matrixCD
-2 k w
2
0 0 -
w
2
0 k w
2
w
2
0
0
w
2
1 0
-
w
2
0 0 1
omega = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<; MatrixForm@omegaD
0 0 1 0
0 0 0 1
-1 0 0 0
0 -1 0 0
Det@omega.matrixC - lambda IdentityMatrix@4DD
lambda
4
+
lambda
2
w
2
2
- k lambda
2
w
2
+
w
4
16
+
k w
4
4
- 2 k
2
w
4
b := H-k + 1 2L;
c := -2 k^2 + k 4 + 1 16
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 56
Plot@8b + Sqrt@b^2 - 4 cD, b - Sqrt@b^2 - 4 cD<, 8mu, 0, 1 2<D
0.1 0.2 0.3 0.4 0.5
-4
-2
2
All 3 collinear Lagrange points are unstable (since their eigenvalues are real with opposite
signs).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 57
Exercise 2.10 Linear stability of the Lagrange points L
4
and L
5
Exercise 2.10 Linear stability of the Lagrange points L
4
and L
5
Hamiltonian
Hamiltonian for a mass-0 particle in the S-J co-rotating frame of reference (S and J on the x-axis, center-of-mass at the
origin):
hamK = u^2 2 + v^2 2 + n * u * y - n * v * x -
m1 Sqrt@Hx + m2 * l Hm1 + m2LL^2 + y^2D - m2 Sqrt@Hx - m1 * l Hm1 + m2LL^2 + y^2D
u
2
2
+
v
2
2
- n v x + n u y -
m2
I-
l m1
m1+m2
+ xM
2
+ y
2
-
m1
I
l m2
m1+m2
+ xM
2
+ y
2
Here u and v are the momenta canonically conjugate to x and y, respectively. The velocities are given by Hamilton's
eqns.: x

= u + ny, y

= v - nx . At a stationary point (a,b), the momenta are thus u= -nb, v=na .


Hamiltonian in relative coordinates in neighborhood of the Lagrangian stationary point
Here the parameter s is introduced to keep track of powers of q1,q2,p1,p2.
hamK1 = ExpandAll@
hamK . 8x a + l * s * q1, y b + l * s * q2, u n * l * s * p1 - n * b, v n * l * s * p2 + n * a<D
-
1
2
a
2
n
2
-
b
2
n
2
2
- a l n
2
q1 s - b l n
2
q2 s +
1
2
l
2
n
2
p1
2
s
2
+
1
2
l
2
n
2
p2
2
s
2
- l
2
n
2
p2 q1 s
2
+
l
2
n
2
p1 q2 s
2
-
m2
a
2
+ b
2
+
l
2
m1
2
Hm1+m2L
2
-
2 a l m1
m1+m2
+ 2 a l q1 s -
2 l
2
m1 q1 s
m1+m2
+ 2 b l q2 s + l
2
q1
2
s
2
+ l
2
q2
2
s
2
-
m1
a
2
+ b
2
+
l
2
m2
2
Hm1+m2L
2
+
2 a l m2
m1+m2
+ 2 a l q1 s +
2 l
2
m2 q1 s
m1+m2
+ 2 b l q2 s + l
2
q1
2
s
2
+ l
2
q2
2
s
2
Exploit simplifying identity
hamK1 =
SimplifyBhamK1 . :a
2
+ b
2
+
l
2
m2
2
Hm1 + m2L
2
+
2 a l m2
m1 + m2
l^2, a
2
+ b
2
+
l
2
m1
2
Hm1 + m2L
2
-
2 a l m1
m1 + m2
l^2>F
1
2
-a
2
n
2
- b
2
n
2
- 2 a l n
2
q1 s - 2 b l n
2
q2 s + l
2
n
2
p1
2
s
2
+ l
2
n
2
p2
2
s
2
-
2 l
2
n
2
p2 q1 s
2
+ 2 l
2
n
2
p1 q2 s
2
-
2 m2
l J2 Ha q1 + b q2L s + l J1 -
2 m1 q1 s
m1+m2
+ q1
2
s
2
+ q2
2
s
2
NN
-
2 m1
l J2 Ha q1 + b q2L s + l J1 +
2 m2 q1 s
m1+m2
+ q1
2
s
2
+ q2
2
s
2
NN
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 58
Taylor series to degree 2
hamK1 = SimplifyANormal@Series@hamK1, 8s, 0, 2<DD .
9Hl^2L^H1 2L l, Hl^2L^H-1 2L l^H-1L, a Hl 2L * Hm1 - m2L Hm1 + m2L,
b l * Sqrt@3D 2, n
2
Hm1 + m2L l^-3=E
1
8 l
2
-
4 l I3 m1
2
+ 5 m1 m2 + 3 m2
2
M
m1 + m2
+ l Jm1 J4 p1
2
+ 4 p2
2
- 8 p2 q1 + q1
2
+ 8 p1 q2 - 6 3 q1 q2 - 5 q2
2
N + m2
J4 p1
2
+ 4 p2
2
- 8 p2 q1 + q1
2
+ 8 p1 q2 + 6 3 q1 q2 - 5 q2
2
NN s
2
Introduce parameter k and collect terms
hamK1 = Collect@ExpandAll@hamK1 * l * m^H-1L . 8m2 m - m1, m1 m 2 + 2 m k Sqrt@3D 9<D, sD
-
11 l
8 m
-
2 k
2
l
27 m
+
l p1
2
2 m
+
l p2
2
2 m
-
l p2 q1
m
+
l q1
2
8 m
+
l p1 q2
m
-
k l q1 q2
m
-
5 l q2
2
8 m
s
2
Diagonalization of the quadratic Hamiltonian
hamK2 =
p1
2
2
+
p2
2
2
- p2 q1 +
q1
2
8
+ p1 q2 - k q1 q2 -
5 q2
2
8
;
The quadratic Hamiltonian hamK2 may be written
1
2
rCr , where r=(q1,q2,p1,p2) and
c = 881 4, -k, 0, -1<, 8-k, -5 4, 1, 0<, 80, 1, 1, 0<, 8-1, 0, 0, 1<<;
Hamilton's equations take the form r

=Cr, where C=WC, W=


0 0
0 0
1 0
0 1
-1 0
0 -1
0 0
0 0
.
cbar = 880, 1, 1, 0<, 8-1, 0, 0, 1<, 8-1 4, k, 0, 1<, 8k, 5 4, -1, 0<<;
Eigenvalue equation for eigen-frequencies
Det@cbar - lambda * IdentityMatrix@4DD
27
16
- k
2
+ lambda
2
+ lambda
4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 59
Exercise 2.11 Linear stability test
The Hamiltonian
H(q
1
, q
2
, p
1
, p
2
) =
1
2
(p
2
1
+p
2
2
+
2
1
q
2
1
+
2
2
q
2
2
) +p
1
q
2
can be written as
H() =
1
2
C , = (q
1
, q
2
, p
1
, p
2
),
where
C =

2
1
0 0 0
0
2
2
0
0 1 0
0 0 0 1

.
To determine stability, we must examine the solutions of the eigenvalue
equation
det( C 1
4
) = 0,
where is (EHD:1.13) and 1
4
is the dimension-4 identity matrix. Evaluating
the determinant, we have

1 0
0 0 1

2
1
0 0
0
2
2

2
1
0
0
2
2

1 0

2
1
0
0

= 0,
hence

4
+
2
(
2
1
+
2
2
) +
2
1
(
2
2

2
) = 0.
This is a quadratic equation for
2
with the solution

2
=
1
2
(
2
1
+
2
2
)
1
2

(
2
1
+
2
2
)
2
4
2
1
(
2
2

2
)
The argument of the square root is always greater than or equal to the
non-negative expression (
2
1

2
2
)
2
, and so
2
must be real. The equilibrium
is stable if and only if the two solutions for
2
are both negative, i.e. if and
only if
|| <
2
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 60
Exercise 2.12 Harmonic attraction in corotating frame
ham@x1_, x2_, p1_, p2_D := 1 2 Hp1^2 + p2^2L + k 2 HHx1 - rL^2 + x2^2L + w Hp1 x2 - x1 p2L
HNormalSeries@ham@k r Hk - w^2L + s u, s v, s pu, w k r Hk - w^2L + s pvD, 8s, 0, 2<DL . s 1
1
2
Ipu
2
+ pv
2
+ k u
2
+ k v
2
- 2 pv u w + 2 pu v wM -
k r
2
w
2
2 Ik - w
2
M
matrixC = 88k, 0, 0, -w<, 80, k, w, 0<, 80, w , 1, 0<, 8-w, 0, 0, 1<<;
MatrixForm@matrixCD
k 0 0 -w
0 k w 0
0 w 1 0
-w 0 0 1
tildeC = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<.matrixC;
MatrixForm@tildeCD
0 w 1 0
-w 0 0 1
-k 0 0 w
0 -k -w 0
Collect@Det@tildeC - lambda IdentityMatrix@4DD, lambdaD
k
2
+ lambda
4
- 2 k w
2
+ w
4
+ lambda
2
I2 k + 2 w
2
M
This is a quadratic equation for lambda
2
, with solutions -Hw0 - wL
2
, -Hw0 + wL
2
, where w0= k . Thus, for w!w0,
lambda= (w-w0), (w+w0). The equilibrium is always stable.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 2 61
Chapter 3 Integrable systems
CONTENTS
3.1 Projectile motion (L) 63
3.2 Two gravitational centers in the plane (L) 64
3.3 Annihilating the Hamiltonian (L) 66
3.4 Sawtooth potential action-angle coordinates (L) 67
3.5 Action-angle coordinates for a non-smooth potential (L) 69
3.6 Commuting Hamiltonian ows (L) 71
3.7 Free particle Hamilton-Jacobi generating function (L) 72
3.8 Action-angle coordinates for a free particle in 2D (L) 73
3.9 Free particle in a circular stadium (L) 76
3.10 Fast track for the spherical pendulum (L) 77
3.11 Angle coordinates for the spherical pendulum (L) 79
3.12 Toda model canonical transformation (L) 80
3.13 Toda model non-canonical transformation (L) 81
3.14 Toda model commuting integrals (L) 82
3.15 Toda model period lattice, actions, and frequencies (M) 83
3.16 Liouville-Arnold approach to a familiar system (L) 89
3.17 Integrable model with two degrees of freedom (L) 93
3.18 Hyperboloidal pendulum (L) 95
3.19 Conical pendulum (L) 99
3.20 Combined Coulomb and uniform electric elds (L) 102
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 62
Exercise 3.1 Projectile motion
This is a simple exercise illustrating the use of the Hamilton-Jacobi strat-
egy in a familiar problem with one degree of freedom. The Hamiltonian
is
H(z, p) =
p
2
2m
+ mgz.
We want to transform to new phase-space coordinates Q and P such that
P = H(z, p).
To do this we rearrange the terms of the last equation so that the right-
hand side is a function of p and P, which can then be written in terms of a
generating function of type 4:
z =
1
mg

P
p
2
2m

=
F
4
p
(p, P).
This can be integrated immediately to give
F
4
(p, P) =
p
3
6m
2
g

pP
mg
,
plus an arbitrary function of P, which we choose to be zero. The transfor-
mation equation for Q is now obtained by dierentiating F
4
with respect to
P:
Q =
F
4
P
=
p
mg
.
Hamiltons equations for Q and P are particularly simple, since the new
Hamiltonian is simply P:

Q = 1,

P = 0,
so that
Q(t) = Q(0) + t, P(t) = P(0).
We obtain z(t) by inverting the canonical transformation:
z(t) =
P(t)
mg

g
2
Q(t)
2
=
1
mg

p(0)
2
2m
+ mgz(0)

g
2
(
p(0)
mg
+ t)
2
= z(0) +
p(0)
m
t +
1
2
gt
2
This is just the familiar equation for projectile motion from elementary me-
chanics.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 63
Exercise 3.2 Two gravitational centers in the plane
Derivation of the Hamiltonian
We begin with the Lagrangian, which in rectangular coordinates is
L =
1
2
( x
2
+ y
2
) +

1
_
(x c)
2
+y
2
+

2
_
(x +c)
2
+y
2
.
We make the substitutions
x = c cosh cos , x = c sinh cos

c cosh sin ,
y = c cosh sin , y = c sinh sin

+c cosh cos ,
to obtain
L =
c
2
2
(cosh
2
cos
2
)(

2
+
2
) +

1
c(cosh cos )
+

2
c(cosh + cos )
.
The canonical momenta are dened as
p

=
L

= c
2
(cosh
2
cos
2
)

,
p

=
L

= c
2
(cosh
2
cos
2
) .
The Hamiltonian is constructed as
H =

p

+ p

L,
where all quantities are expressed as functions of , , p

, p

. Thus
H(, , p

, p

) =
p
2

+p
2

2c
2
(cosh
2
cos
2
)


1
c(cosh cos )


2
c(cosh + cos )
=
1
c
2
(cosh
2
cos
2
)
_
1
2
(p
2

+p
2

) 1 c(cosh + cos )
2
c(cosh cos )
_
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 64
Integrability
To establish integrability, we seek a quantity K which Poisson-commutes
with H. If the denominator factor were not present, the solution would be a
familiar one used for a number of simple examples of separable models where
the Hamiltonian splits into pieces dependent on dierent sets of variables.
Thus if
H

(, , p

, p

) +H

1
(, p

) +H

2
(, p

),
we can choose H

1
or H

2
as the second conserved quantity, since both are
independent of H

and commute with it. Our strategy in the present case is


inspired by this method, but requires some extra work. Our choice for K is
K =
p
2

2
c(
1
+
2
) cosh c
2
H cosh
2
=
p
2

2
+c(
1

2
) cos c
2
H cos
2

Then
[K, H] = [
p
2

2
c(
1
+
2
) cosh ,
1
c
2
(cosh
2
cos
2
)
]c
2
H (cosh
2
cos
2
)
c
2
H[cosh
2
,
1
c
2
(cosh
2
cos
2
)
p
2

2
]. (13)
Since for any smooth function f,
[p
2

, f(cosh
2
)] = [p
2

, cosh
2
]f

(cosh
2
),
we easily verify that the terms on the righthand side of (13) cancel.
Separability
On M
H,K
, we have
p

(, H, K) =
_
2(c
2
H cosh
2
+c(
1
+
2
) cosh +K),
p

(, H, K) =
_
2(c(
1

2
) cos c
2
H cos
2
K).
which establishes separability. The Hamilton-Jacobi generating function
takes the form
W(, , H, K) =
_

0
d

, H, K) +
_

0
d p

, H, K)
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 65
Exercise 3.3 Annihilating the Hamiltonian
We make a canonical transformation with a time-dependent generating
function F
3
(P,

Q, t), so that the new Hamiltonian is
K(

Q,

P, t) = P
1
(

Q,

P, t) +
F
3
t
(P(

Q,

P),

Q, t).
Our aim is to choose F
3
so that K vanishes identically. Direct integration
gives
F
3
(P,

Q, t) = P
1
t + any t-independent function of P,

Q.
The simplest choice of the arbitrary function is zero, but this does not pro-
vide a true transformation of coordinates. The obvious next choice is the
generating function of the identity, giving
F
3
(P,

Q, t) = P
1
t
n

k=1
P
k

Q
k
,
hence the transformation

P
k
= P
k
, k = 1, . . . , n,

Q
k
= Q
k
, k = 2, . . . , n,

Q
1
= Q
1
t
This is clearly a well dened transformation of coordinates which, by con-
struction, has a Hamiltonian which vanishes identically, so that all Q
k
and
P
k
are conserved.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 66
Exercise 3.4 Sawtooth potential action-angle coordinates
The particle moves on the x axis with Hamiltonian
H(x, p) =
p
2
2m
+V (x),
where
V (x) = U|x|/, x , V (x + 2) = V (x)
Since the Hamiltonian is time-independent with a homogeneous quadratic
kinetic energy term, the Hamiltonian is the total energy E, and the latter is
conserved. Clearly action-angle variables are appropriate only for the range
0 < E < U, since for E = 0 the particle is xed at one of the minima of
the potential energy, for E = U it is either xed at a maximum or traveling
on a noncompact separatrix orbit connecting two maxima, and for E >
U, the motion is unbounded. For given E in the range 0 < E < U, the
phase manifold has innitely many connected components, one for each of the
intervals (2n1) < x < (2n+1) n = 0, 1, 2, . . .. We will deal explicitly
here only with n = 0; the treatment of the others is strictly analogous.
For xed enegy E, the phase-space orbit is a topological circle consisting
of the two parabolic arcs
x =

2mU
(2mE p
2
),

2mE p

2mE,
glued together at their endpoints. The action J is the area enclosed by the
orbit, namely
J =
1

_

2mE

2mE
x dp =
2
3mU
(2mE)
3/2
.
Inverting this relation gives the Hamiltonian for action-angle coordinates,
H(J) =
1
2m
(
3mUJ
2
)
2/3
.
To nd the angle coordinate, we construct a generating function S(p, J) of
type 4, so that
x(p, J) =
S
p
(p, J) =

2mU
_
(3mUJ/2)
2/3
p
2
_
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 67
We integrate to get
S(p, J) =
_
p

2H(J)
dp

x(p

, J).
The angle coordinate conjugate to J is then,for the positive-x part of the
contour of integration,
=
S
J
=

2
_
3mUJ
2
_
1/3
_
p

2mH(J)
dp

=

2
_
3mUJ
2
_
1/3 _
_
2mH(J) p
_
.
On this part of the contour, goes from 0 to . On the negative-x part of
the contour, the analogous calculation gives
= +

2
_
3mUJ
2
_
1/3 _
_
2mH(J) +p
_
.
Over the full contour, the angle increases by 2, while S(p, J) increases by
2J.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 68
Exercise 3.5 Action-angle coordinates for a
non-smooth potential
p
e
r
f
e
c
t
l
y

r
e
f
l
e
c
t
i
n
g

w
a
l
l
fixed points
0
a 2a
p
x
The accompanying gure is a sketch of the phase portrait. Within the
slice 0 < x < 2a, the constant-energy orbits have equations
p
2
2m
A(x a)
2
= E Aa
2
,
hence describe hyperbolic arcs centered at x = a, p = 0. The extensions of
these orbits for x 2a satisfy
p =

2mE
hence are horizontal half-lines. When an orbit hits the wall at x = 0, the
momentum p jumps instantaneously from

2mE to

2mE, corresponding
to perfectly elastic reection. The points on the p = 0 axis with x 2a are
all xed points.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 69
For E < Aa
2
, the orbits are (nonsmooth) topological circles consisting
of hyperbolic arcs and instantaneous momentum jumps at x = 0. Although
stricly speaking the conditions of the Liouville-Arnold theorem are not met,
we can still introduce action-angle variables using the same procedures as in
other models with one degree of freedom. First, we dene the action J as
the area enclosed by an orbit of constant energy, divided by 2. Specically
J(E) =
1

xmax(E)
0
p(x, E) dx,
where
x
max
(E) = a

a
2
E/A, p(x, E) =

2m(E A(a
2
(x a)
2
).
Introducing a new integration variable z = xa and the dimensionless energy
variable
=
E
Aa
2
,
the action integral reduces to
J(E) =
a
2

2mA

1
1

z
2
(1 ) dz
=
a
2

mA
2


1
2
ln
1 +

The oscillation period for such a closed orbit is given by


T =
2
dE/dJ
= 2
dJ
dE
=

2mA

1
1
dz

z
2
(1 )
As the energy E approaches the peak of the potential energy curve, namely
Aa
2
, the relative energy approaches unity, and the period blows up as
T

2mAln(1 ), 1.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 70
Exercise 3.6 Commuting Hamiltonian flows
The notation
g
t
i
i
= e
t
i
[,F
i
]

corresponds to a formal power series


g
t
i
i
= + t
i
[, F
i
] +
t
2
i
2!
[[, F
i
], F
i
] +
t
3
i
3!
[[[, F
i
], F
i
], F
i
] +
With suciently stringent bounds on , F
i
, and their derivatives of all orders,
one can in principle enforce the convergence of the series for suciently small
t
i
. Assuming that such conditions are satised, not only for g
t
i
i
, but also
for the quantities g
t
i
i
g
t
j
j
, we shall show that for F
i
and F
j
with vanishing
Poisson bracket, g
t
i
i
and g
t
j
j
commute as operators.
We wish to show that, if [F
i
, F
j
] = 0, then
g
t
i
i
g
t
j
j
g
t
j
j
g
t
i
i
= 0
Expanding in power series,
g
t
i
i
g
t
j
j
=

r,s
t
r
i
t
s
j
F
ij
rs
(),
it will be sucient to show that, for all r, s,
F
ij
rs
() = F
ji
sr
().
Explicitly,
F
ij
rs
() =
1
r!s!
[[[, F
j
], F
j
], F
j
], F
i
], F
i
], F
i
],
with r appearances of F
i
and s appearances of F
j
in the multiple Poisson
bracket. The Jacobi identity implies, for arbitrary A,
[A, F
j
], F
i
] = [[A, F
i
], F
j
] + [A, [F
j
, F
i
]] = [[A, F
i
], F
j
].
Hence, in the expression for F
ij
rs
(), the F
i
s can be commuted all the way to
the left, so that F
ij
rs
() is seen to be equal to F
ji
sr
().
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 71
Exercise 3.7 Free particle Hamilton-Jacobi
generating function
We write the generating function (EHD:3.12) out in full:
S(q
1
, q
2
, L, H) = L
_
tan
1
q
2
q
1
cos
1
_
L
|q|

2H
__

_
2H|q|
2
L
2
where |q| =
_
q
2
1
+q
2
2
. We also write out p
1
and p
2
in terms of the same
variables, by solving simultaneously the equations
H =
1
2
(p
2
1
+p
2
2
), L = q
1
p
2
p
1
q
2
to obtain
p
1
=
Lq
2
|q|
2

2H q
1
|q|

1
L
2
2H|q|
2
p
2
=
Lq
1
|q|
2

2H q
2
|q|

1
L
2
2H|q|
2
Using the standard dierentiation formulas
d
dx
tan
1
x =
1
1 +x
2
,
d
dx
cos
1
x =
1

1 x
2
,
we obtain, in straightforward fashion,
S
q
i
= p
i
, i = 1, 2,
S
L
= tan
1
q
2
q
1
cos
1
_
L
|q|

2H
_
= s,
S
H
=
_
2H|q|
2
L
2
2H
= t.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 72
Exercise 3.8 Action-angle coordinates for a free particle in 2D
Calculation of J
1
On the path
1
,
2
= 0, so that t = 0 and s increases from 0 to 2. The
contour is just the circle centered at the origin with radius b =
L

2H
. Thus
J
1
=
1
2

2
0
|p| |q| ds =
1
2

2
0

2H b ds = L.
Calculation of J
2
On the path
2
,

1
= 0, s =
s
t
t, 0 t t.
The contour, parametrized by t, is given by
q
1
= |q| cos (q) = b cos

s
t
t

2H t sin

s
t
t

,
q
2
= |q| sin (q) =

2H t cos

s
t
t

+ b sin

s
t
t

.
Moreover, the momentum vector is
(p
1
, p
2
) =

2H

sin

s
t
t

, cos

s
t
t

Dierentiating q
1
and q
2
with respect to t and inserting into
J
2
=
1
2

t
0

p
1
dq
1
dt
+ p
2
dp
2
dt

dt,
we get, in agreement with (EHD:3.15),
J
2
= Ls + 2Ht.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 73
Generating function
For our calculation of S, we concatenate the circular arc b(cos s

, sin s

), 0
s

s and the straight-line path, tangent to the circle |q| = b, fromb(cos s, sin s)
to (q
1
, q
2
). The circular part produces a contribution |p| |q| s = Ls, while the
second yields |p| |p|t = 2Ht
S = Ls + 2Ht,
in accord with (EHD:3.16).
On the M

H,L
, the generating function takes the form
S(q
1
, q
2
, J
1
, J
2
) = J
1
((q)cos
1
_
J
1
|q|
_
2H(J
1
, J
2
)
_

_
2H(J
1
, J
2
)|q|
2
J
2
1
Most of the details in verifying the derivatives can be found in the solution
to Exercise 3.7. The only additional ingredients are the formulas for
i
=
H
J
i
following (EHD:3.15). Putting these together gives us
S
q
i
= p
i
,
S
J
i
=
i
, i = 1, 2.
Numerical study of H(J
1
, J
2
)
The accompanying gure, generated with the help of the Mathematica func-
tion ContourPlot, shows the contours of constant J
2
in the J
1
, K plane,
where K = 2a
2
H. The red parabola is the boundary of the allowed region in
the energy-momentum diagram of EHD, Figure 3.9. Each contour is a graph
showing how the energy varies with J
1
for a xed value J
2
. Note that the
rescaling of H was necessary in order to assign meaningful numerical values.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 74
.
.
-4 -2 0 2 4
0
2
4
6
8
10
1
.
4
2
.
8
4
.
2
5
.
6
7
.
0
8
.
4
9
.
8
1
1
.
2
1
2
.
6
1
4
.
0
1
5
.
4
1
6
.
8
0
J
1
2a
2
H
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 75
Exercise 3.9 Free particle in a circular stadium
q
2
q
1
b
|q|
| q
|
2

-

b2
=


2
H

t
q
s

2
H

t
/
2
2
H

t/2
a
3
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 76
Exercise 3.10 Fast track for the spherical pendulum
The separability is expressed directly in the relations
p

= L, 0 < 2,
p

=
_
2E
L
2
sin
2

2 cos , 0 < ,
and the curves displayed in EHD, Figure 3.16. According to the fast-track
construction of action-angle coordinates, we rst dene the actions
J
1
= p

= L, J
2
=
1
2
_
p

d.
To evaluate the J
2
integral, we make the usual substitution u = cos to
obtain
J
2
=
1

_
u
2
u
1
du
_
f(u)
1 u
2
,
where u
1
and u
2
are roots of the cubic polynomial
f(u) = 2(1 u
2
)(E u) L
2
.
The transformation to action-angle coordinates is generated by the func-
tion
S(, , J
1
, J
2
) = J
1
+
_
p

(, J
1
, E(J
1
, J
2
))d
As usual, the generating function is specically designed to give
S

= p

,
S

= p

.
Rather than explicitly inverting the action formulas to extract E(J
1
, J
2
),
we skip to the easier task of calculating the angle variables,

1
=
S
J
1
= +
_
dp

dL
d +
__
dp

dE
d
_
dE
dJ
1

2
=
S
J
2
=
__
dp

dE
d
_
dE
dJ
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 77
The trick is that it is much easier to calculate the partial derivatives of
E(J
1
, J
2
) than to calculate the function itself.
From (EHD 3.21),
dE
dJ
1
=
J
2
L
_
J
2
E
_
1
=

T
,
dE
dJ
2
=
_
J
2
E
_
1
=
2
T
,
where
= 2L
_
u
2
u
1
du
(1 u
2
)
_
f(u)
, T = 2
_
u
2
u
1
du
_
f(u)
.
Inserting these formulas and once again expressing the integrals in terms of
u = cos , we end up with the transformation equations (EHD:3.23) and
(EHD:3.24).
We note that the above is almost certainly the most ecient construc-
tion of the action-angle variables in this model (as it is for other separable
systems). There was no need for Hamilton-Jacobi theory or Arnolds ow
coordinates to get the job done.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 78
Exercise 3.11 Angle coordinates for the spherical pendulum
For p

> 0, we have from (EHD3.22)

1
=

T
t +s,
2
=
2
T
t,
where, from (EHD:3.18), (EHD:3.19), and (EHD:3.20),
t =
_
u
2
u
du

_
f(u

)
+
T
2
, s =

2

_
u
2
u
Ldu

(1 u
2
)
_
f(u

)
.
Thus

1
= +
_
u
2
cos
du
_
f(u)
_

T

L
1 u
2
_
,

2
= +
2
T
_
u
2
u
du
_
f(u)
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 79
Exercise 3.12 Toda model canonical transformation
Since the X
i
depend only on the mutually commuting x
i
, they also com-
mute with each other. The analogous argument shows that the P
i
also com-
mute with each other. In addition
[X
1
, P
1
] = [x
1
, p
1
] [x
3
, p
1
] = 1, [X
2
, P
1
] = [x
2
, p
1
] [x
3
, p
1
] = 0,
[X
3
, P
1
] = [x
3
, p
1
] = 0,
[X
1
, P
2
] = [x
1
, p
2
] [x
3
, p
2
] = 0, [X
2
, P
2
] = [x
2
, p
2
] [x
3
, p
2
] = 1,
[X
3
, P
2
] = [x
3
, p
2
] = 0,
[X
1
, P
3
] = [x
1
, p
1
+p
2
+p
3
] [x
3
, p
1
+p
2
+p
3
] = 0,
[X
2
, P
3
] = [x
2
, p
1
+p
2
+p
3
] [x
3
, p
1
+p
2
+p
3
] = 1 1 = 0,
[X
3
, P
3
] = [x
3
, p
1
+p
2
+p
3
] = 1,
Thus all the fundamental Poisson-bracket relations hold, and so the trans-
formation is canonical.
Let us construct a type-2 generating function F
2
(x
1
, x
2
, x
3
, P
1
, P
2
, P
3
), so
that
p
i
(x, P) =
F
2
x
i
(x, P), i = 1, 2, 3.
From the second row of (EHD:3.25), we have
p
1
= P
1
, p
2
= P
2
, p
3
= P
3
P
1
P
2
,
and so direct integration gives, as the simplest solution,
F
2
(x, P) = x
1
P
1
+x
2
P
2
+x
3
(P
3
P
1
P
2
).
The remaining equations of (EHD:3.25) are obtained by dierentiation:
X
1
=
F
2
P
1
= x
1
x
3
, X
2
=
F
2
P
2
= x
2
x
3
,
X
3
=
F
2
P
3
= x
3
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 80
Exercise 3.13 Toda model non-canonical transformation
Since [x

, p

] = 8

3[x, p] = [x, p], the transformation is not canonical.


However the equations of motion using the Hamiltonian H

and variables
x

, y

, p

x
, p

y
, t imply, and are implied by, the equations of motion obtained
from H using variables x, y, p
x
, p
y
and the rescaled time . Thus, the graphs
of orbits, phase portraits, etc. coincide after a simple rescaling of the axes.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 81
Exercise 3.14 Toda model commuting integrals
We write
H =
1
2
(p
2
x
+p
2
y
)+
1
24
(b+c3), K =
p
x
2
(p
2
x
3p
2
y
)
p
x
8
c+
1
16
(p
x
b

3p
y
a),
where
a = e
2y
_
e
2

3x
e
2

3x
_
, b = e
2y
_
e
2

3x
+e
2

3x
_
, c = e
4y
.
Applying the denition of the Poisson bracket, we have
[H, K] =
1
16
(p
2
x
p
2
y
)
b
x

1
8
p
x
p
y
(
b
y
+
c
y
)
1
192
c
b
x
+
1
8
p
x
p
y
c
y
+
1
384
b
b
x

3
192
a(
b
y
+
c
y
)
1
16
p
2
x
b
x
+

3
8
p
x
p
y
a
x

1
16
p
x
p
y
b
y

3
16
p
2
y
a
y
.
Inserting
a
x
= b,
a
y
= 2y,
b
x
= 2

3a,
b
y
= 2y,
c
x
= 0,
c
y
= 4c.
we get separate cancellation of the terms proportional to ap
2
x
, ap
2
y
, bp
x
p
y
, cp
x
p
y
, ac, ab.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 82
Exercise 3.15 Toda model period lattice, action variables, and
oscillation frequencies
Toda integrals
In[2]:= intH@8x_, y_, px_, py_<D :=
H1 2L Hpx^2 + py^2L + H1 12L Exp@2 yD Cosh@c1 xD + H1 24L Exp@-4 yD - 1 8
In[3]:= intK@8x_, y_, px_, py_<D :=
H1 2L * px Hpx^2 - 3 py^2L - H1 8L * px Exp@-4 yD +
H1 16L * Exp@2 yD H2 px Cosh@c1 xD - c1 py Sinh@c1 xDL
Phase space velocity fields
In[5]:= fH@8x_, y_, px_, py_<D :=
:px, py, -
1
12
c1
2 y
Sinh@c1 xD,
1
6
I
-4 y
-
2 y
Cosh@c1 xDM>
In[6]:= fK@8x_, y_, px_, py_<D := :
1
8
I-
-4 y
+ 12 px
2
- 12 py
2
+
2 y
Cosh@c1 xDM,
-3 px py -
1
16
c1
2 y
Sinh@c1 xD,
1
16
c1
2 y
Hc1 py Cosh@c1 xD - 2 px Sinh@c1 xDL,
1
8

-4 y
I-4 px +
6 y
H-2 px Cosh@c1 xD + c1 py Sinh@c1 xDLM>
Commutation of velocity fields
We show that the Hamiltonian flows generated by H and K commute, in the sense that
[ H, K ] = f
H
W f
K
= 0 .
In[7]:= omega = 880, 0, 1, 0<, 80, 0, 0, 1<, 8-1, 0, 0, 0<, 80, -1, 0, 0<<;
In[8]:= Simplify@fH@8x, y, px, py<D.omega.fK@8x, y, px, py<D . c1 2 Sqrt@3DD
Out[8]= 0
Submanifold M
h,k
(where h = 1, k = -1)
We construct an !
2
covering of the sub-manifold using the 1-parameter groups (Hamiltonian flows) generated by H
and K, namely by integrating the ODE's (x=(x, y, p
x
, p
y
))
dx
dt
= f
H
HxL ,
dx
ds
= f
H
HxL
By the Liouville-Arnol'd Thm., this !
2
covering should project onto a torus, so that we can look for a 2D lattice of
points (t, s) which project onto the same point as (0,0), and such that x(s,t), connected to x(0,0) by the flows is in fact
equal to x(0,0). We shall test this by a numerical experiment, using RK4 to integrate the flows .
We choose as our initial point x(0,0) = (0,0,1,1).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 83
ODE integrator
In[9]:= RK4step@f_, dt_, z_D := Module@8k1, k2, k3, k4<, k1 = f@zD * dt;
k2 = f@z + k1 2D * dt;
k3 = f@z + k2 2D * dt;
k4 = f@z + k3D * dt;
z + Hk1 + 2 * k2 + 2 * k3 + k4L 6D
Calculation of x(s,t)
We construct a numerical approximation to x(s, t) on the sqauare 0 b s, t b 5. At each lattice point of a 100100 grid
covering the square, we calculate the 4-vector x(s, t) by integrating the flow ODEs with RK4step. We then define
the function over the whole square by using Mathematicas function ListInterpolation.
In[31]:= xiArray = Table@80, 0, 0, 0<, 8100<, 8100<D;
xi = xiArray@@1, 1DD = 80, 0, 1., 1.<;
dt = ds = .0001;
c1 = 2 Sqrt@3.D;
For@t = 1, t 100, t++,
If@t > 1,
Do@xi = RK4step@fH, dt, xiD, 8500<D;
xiArray@@1, tDD = xiD;
eta = xi;
For@s = 2, s 100, s++,
Do@eta = RK4step@fK, ds, etaD, 8500<D;
xiArray@@s, tDD = etaDD;
In[44]:= xiInterp = ListInterpolation@xiArray, 881, 100<, 81, 100<, 81, 4<<D
Out[44]= InterpolatingFunction@881., 100.<, 81., 100.<, 81., 4.<<, <>D
To define x(s, t) properly, we need to rescale and offset s and t.
In[69]:= xi@s_, t_D := Table@xiInterp@20 * s + 1, 20 * t + 1, iD, 8i, 1, 4<D
We now plot the contours x(s,t)=0, y(s,t)=0, p
x
Hs, tL = 1, p
y
(s,t)=1. Where all four contours intersect, we have points
of the period lattice. By eye, we choose (nonuniquely) e
1
to have its endpoint near (60,40) and e
2
to have its endpoint
near (30,65). We can home in on these points using the rootfinding function FindRoot .
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 84
In[60]:= For@i = 1, i 4, i++, xiPlot@iD = ContourPlot@xiInterp@s, t, iD, 8s, 1, 100<,
8t, 1, 100<, PlotRange If@i 2, 8-.0005, 0.0005<, 8.9995, 1.0005<D,
ContourShading False, PlotPoints 200, ContourStyle BlackDD;
Show@Table@xiPlot@iD, 8i, 1, 4<D, PlotRange 880, 100<, 80, 100<<D
Out[61]=
0 20 40 60 80 100
0
20
40
60
80
100
In[72]:= 8.05 * Hs1 - 1L, .05 * Ht1 - 1L< .
FindRoot@8xiInterp@s1, t1, 1D 0, xiInterp@s1, t1, 2D 0<, 8s1, 60<, 8t1, 40<D
Out[72]= 82.81035, 1.85786<
In[73]:= xi@2.810349336741001`, 1.857859015565531`D
Out[73]= 9-1.17961 10
-16
, -1.60982 10
-15
, 1.00001, 1.0001=
In[74]:= 8.05 * Hs2 - 1L, .05 * Ht2 - 1L< .
FindRoot@8xiInterp@s2, t2, 1D 0, xiInterp@s2, t2, 2D 0<, 8s2, 30<, 8t2, 65<D
Out[74]= 81.52273, 3.15019<
In[75]:= xi@1.5227291408346673`, 3.150188958883042`D
Out[75]= 93.8641 10
-16
, 8.32667 10
-17
, 1.00001, 1.00015=
Precision calculation of the lattice points
We can sharpen up these results using Newtons method with 100-digit precision and no interpolation.
In[85]:= Clear@xiD
In[86]:= ptcalc@8s_, t_<, n_D := Module@8ds = s n, dt = t n<,
xi = 80, 0, 1, 1<;
c1 = SetPrecision@2 Sqrt@3D, 100D;
Do@xi = RK4step@fH, dt, xiD, 8n<D;
Do@xi = RK4step@fK, ds, xiD, 8n<D;
xiD
In[91]:= steps = 10000; u = SetPrecision@8281035 100000, 185786 100000<, 100D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 85
In[92]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[94]= 82.810355880393483559364179097502488615765325275416036134049407614997719175098194558,
1.8578559139458896262846031867635177690915659172700836152151386852391877190686616005<
In[95]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[97]= 82.8103558803925291007504009426657449713292322832350534362197383715,
1.8578559139250087431234808299009033176859706492286017520343692332<
In[98]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[100]= 82.81035588039252910075039350446974168715493918471,
1.85785591392500874312346330739211829682626220229<
In[101]:= ptcalc@u, stepsD
Out[101]= 90. 10
-31
, 0. 10
-31
, 1.000000000000013844677465829710, 0.999999999999942934780780421699=
In[102]:=
steps = 10000; u = SetPrecision@8152273 100000, 315019 100000<, 100D;
In[103]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[105]= 81.52273790665976858425541782364623666318571557295951473191957630344881197474509378876358
,
3.15018425389170771955854847297911447100926176419678222948277589540479438556987115419259
<
In[106]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[108]= 81.5227379066590388570547911715632383468182284673221498753886482093098548030,
3.1501842538554520914406248415758987974679903610616097737151754909005034481<
In[109]:= xi = ptcalc@u, stepsD;
mx = Inverse@Transpose@8fK@xiD@@81, 2<DD, fH@xiD@@81, 2<DD<DD;
u -= mx.xi@@81, 2<DD
Out[111]= 81.5227379066590388570547785656691694937829146398574102434889608,
3.1501842538554520914406013010044729895842581148550310871452094<
e
1
=(2.8103558803925291,1.857855913925009), e
2
=(1.522737906659039,3.150184253855452)
In[112]:= ptcalc@u, stepsD
Out[112]= 91.5234494178845 10
-36
, 2.6817359659656 10
-36
,
1.0000000000000004347331192410185761989679680814242,
0.9999999999999997582752828523560534102958171461401=
Action calculation
In[113]:= fIH@8xi_, eta_<D := Hfh = fH@xiD; 8fh, xi@@83, 4<DD.fh@@81, 2<DD<L
In[114]:= fIK@8xi_, eta_<D := Hfk = fK@xiD; 8fk, xi@@83, 4<DD.fk@@81, 2<DD<L
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 86
In[123]:= Jcalc@8s_, t_<, n_D := Module@8ds = s n, dt = t n<,
psi = 880, 0, 1, 1<, 0<;
c1 = N@2 Sqrt@3DD;
Do@psi = RK4step@fIH, dt, psiD, 8n<D;
Do@psi = RK4step@fIK, ds, psiD, 8n<D;
psi@@2DD N@2 PiDD
In[124]:= steps = 10000; u = 82.8103558803925291, 1.857855913925009<;
xi = Jcalc@u, stepsD
Out[125]= -0.41701688977966833`
In[126]:= steps = 10000; u = 81.522737906659039, 3.150184253855452<;
xi = Jcalc@u, stepsD
Out[127]= 0.18047663892103705`
J
1
= - 0.41701688977966833, J
2
=0.18047663892103705
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 87
Calculation of the oscillation frequencies
We shall calculate the respective increases in
1
and
2
when the state with
s = 0, t = 0 evolves in time to s = 0, t = . The ratios
i
/, i = 1, 2 will be
the frequencies
i
which we seek. To accomplish this, we expand the vector
(0, ) in terms of the lattice vectors e
1
and e
22
which we have just determined
numerically:

1
2

e
1
+

2
2

e
2
Dividing through by /(2), this becomes

0
2

=
1
e
1
+
2
e
2
Solving for the frequencies, and setting e
i
= (e
i1
, e
i2
), we get

e
11
e
21
e
12
e
22

0
2

We substitute the numerical values for the lattice vectors to obtain

1
= 1.5882250671214557,
2
= 2.93121858807908.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 88
Exercise 3.16 Liouville-Arnol'd approach to a familiar system
Commutation of L and H
L = q
1
P
2
q
2
P
1
, H =
1
2
(p
2
1
+ p
2
2
+
2
q
2
1
+
2
q
2
2
)
We evaluate the Poisson bracket using the elementary brackets for q
1
, q
2
, p
1
, p
2
,
linearity, and the distributive property over ordinary products. Thus, for ex-
ample,
[q
1
p
2
,
1
2
p
2
1
] =
1
2
p
2
[q
1
, p
2
1
] = p
1
p
2
[q
1
, p
1
] = p
1
p
2
.
Hence
[L, H] = p
1
p
2

2
q
1
q
2
p
1
p
2
+
2
q
1
q
2
= 0.
Independence of L and H
Dependence requires the simultaneous vanishing of the 2 2 minors of the
rectangular array of partial derivatives of H and L:
_
H
q
1
H
q
2
H
p
1
H
p
2
L
q
1
L
q
2
L
p
1
L
p
2
_
=
_

2
q
1

2
q
2
p
1
p
2
p
2
p
1
q
2
q
1
_
Calculating all the minors gives the set of equations
q
1
p
1
+ q
2
p
2
= 0,
p
1
p
2
+
2
q
1
q
2
= 0,
p
2
2

2
q
2
1
= 0,
p
2
1

2
q
2
2
= 0.
These are easily seen to be equivalent to
p
1
= q
2
, p
2
= q
1
.
In conguration space, the orbits of this sub-manifold are circles of radius
_
[L[/. The explicit dependence of H on L is obtained from
L = (q
2
1
+ q
2
2
), H =
2
(q
2
1
+ q
2
2
) = [L[.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 89
Liouville-Arnold analysis
The analysis is analogous to that of the free particle in the plane. The
conguration-space orbits are obtained by integrating Hamiltons equations,
q
i
= p
i
, p
i
=
2
q
i
, i = 1, 2,
with the solution
q
i
(t) = q
i
(0) cos t +
1

p
i
(0) sin t,
p
i
(t) = p
i
(0) cos t q
i
(0) sin t
For xed L and H, these are a family of ellipses conned to the annular
region
r

[q[ r
+
,
where r

can be calculated using the perpendicularity of the radius and


velocity vectors at [q[ = r, r = r

:
[L[ = r[p[ = r

2H
2
r
2
,
so that r satises

2
r
4
2Hr
2
+ L
2
= 0,
with the positive solutions
r

=
1

_
H
_
H
2
/
2
L
2
As in the free-particle examples, the annular region is covered without
overlap by the outgoing pieces of the orbits, starting at [q[ = r

and ending
at [q[ = r
+
. If we glue this to a copy of this region covered by the incoming
pieces of the orbits, we obtain a complete, non-redundant representation of
the points of the manifold /
H,L
. The two pieces, /
+
H,L
and /

H,L
, are
glued at both boundaries, [q[ = r

, to form a topological torus.


We now want to introduce ow coordinates s and t generated by the two
conserved quantities L and H. The time evolution has already been made
explicit above. The motions generated by L are also well known to us: they
are rotations about the origin. For a given point of /
+
H,L
, specied by
coordinates q
1
, q
2
, p
1
, p
2
, with p
1
and p
2
considered as functions of q
1
, q
2
, L,
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 90
and H, we dene the corresponding ow coordinates as follows. First, we
select a representative point
0
with
q
10
= r

, q
20
= 0, p
10
= 0, p
20
=
_
2H
2
r
2

.
. We then calculate s and t such that

0
= e
s[,L]
e
t[,H]
.
Explicitly,
_
_
_
_
r

0
0
_
2H
2
r
2

_
_
_
_
=
_
_
_
_
cos s sin s 0 0
sin s cos s 0 0
0 0 cos s sin s
0 0 sin s cos s
_
_
_
_

_
_
_
_
cos t 0
1

sin t 0
0 cos t 0
1

sin t
1

sin t 0 cos t 0
0
1

sin t 0 cos t
_
_
_
_
_
_
_
_
q
1
q
2
p
1
p
2
_
_
_
_
Of the four equations equivalent to this matrix relations, we will use the
following pair to solve for s and t:
r
1
cos s = q
1
cos t
p
1

sin t, (14)
r
1
sin s = q
2
cos t
p
2

sin t (15)
To isolate the t dependence, we take the sum of the squares:
r
2

=
1

2
(H +
1
2
(
2
[q[
2
[p[
2
) cos(2t) (q p) sin(2t).
The explicit p dependence can be eliminated using the identities
[p[
2
= 2H
2
[q[
2
, (q p)
2
= [q[
2
[p[
2
L
2
.
This gives
r
2

=
1

2
(H + Acos(2t + )),
where
A =

H
2

2
L
2
, = cos
1
_

2
[q[
2
H
A
_
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 91
But by denition
2
r
2

= H A, and so we get
cos(2t + ) = 1,
hence
t =
1

2


2
_
. (16)
To solve for s, we substitute (16) into (14) and (15) :
r
1
cos s = q
1
sin

2

p
1

cos

2
, (17)
r
1
sin s = q
2
sin

2

p
2

cos

2
, (18)
from which it follows
r

(q
2
cos s q
1
sin s) = r

[q[ cos(s + ) =
L

cos

2
,
where the angle is dened by
q = (q
1
, q
2
) = ([q[ sin , [q[ cos ).
Inserting
cos

2
=
1 + cos
2
=
A +
2
[q[
2
H
2A
=

2
([q[
2
r
2

)
2A
,
we get, nally,
s = + cos
1
_
L([q[
2
r
2

)
2r

[q[A
_
.
The nal step of the Liouville-Arnold analysis is to relate the ow co-
ordinates to action-angle variables. But this is trivial, since both s and t
are already periodic, with periods 2 and 2/, respectively. Thus we can
simply dene

1
= s,
2
= t,
with the conjugate actions
J
1
= L, J
2
=
H

and new Hamiltonian

H(J
1
, J
2
) = J
2
.
We note that a far simpler description would have been possible if we had
taken as our two commuting integrals H
i
=
1
2
(p
2
i
+
2
q
2
i
), i = 1, 2.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 92
Exercise 3.17 Integrable model with two degrees of freedom
(a) Conservation of F
We wish to show
[F, H] = [2I
1
+ I
2
, 2( + )I
1
+ I
2
+ (4I
2
1
+ 2I
1
I
2
) cos(
1
2
2
)] = 0.
Since F commutes with I
1
and I
2
, we have
[F, H] = (4I
2
1
+ 2I
1
I
2
)[F, cos(
1
2
2
)]
= (4I
2
1
+ 2I
1
I
2
)
_
2

2
_
cos(
1
2
2
) = 0.
(b) Canonical transformation (, I) (, L)
We introduce a type-2 generating function F
2
(
1
,
2
, L
1
, L
2
) such that the
rst two conditions are satised,

1
=
F
2
L
1
=
2
,
2
=
F
2
L
2
=

1
2

2
.
Integrating, we get
F
2
=
2
L
1
+ (

1
2

2
)L
2
+ S(
1
,
2
).
We easily see that the third condition is satised with S = 0:
F = 2
F
2

1
+
F
2

2
= 2
_
L
2
2
_
+ L 1 L
2
= L
1
.
In addition, we have
I
1
=
F
2

1
=
L
2
2
.
The new Hamiltonian is obtained by substitution:
K(, L) = L
1
+ L
2
+ L
1
L 2 cos(2
2
).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 93
(c) Torus structure
Set K = E and L
1
= f to get
E = f + L
2
( + f cos(2
2
)),
so that
L
2
=
E f
+ f cos(2
2
)
For values of E and f satisfying
E f ,= 0, [f[ < [

[,
L
1
and L
2
are smooth, 2-periodic functions of
1
and
2
, respectively, and
hence the manifold /
E,f
has the topological structure of a 2-torus.
(d) Energy and oscillation frequencies
The actions are calculated by integrating under the curves L
1
(
1
) and L
2
(
2
):
J
1
=
1
2
_
2
0
L
1
(
1
)d
1
= L
1
= f,
J
2
=
1
2
_
2
0
L
2
(
2
)d
2
= E J
1
4G(J
1
, 2),
where
G(J, ) =
_

0
d
+ J cos
.
Thus
E(J
1
, J
2
) = J
1
+
4J
2
G(J
1
, 2)
.
The frequencies are obtained by dierentiating E with respect to the actions:

1
=
E
J
1
=
4J
2
G(J
1
, 2)
2
G
J
1
(J
1
, 2),

2
=
E
J
2
=
4
G(J
1
, 2)
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 94
Exercise 3.18 Hyperboloidal pendulum
(a) Lagrangian
Dierentiating the coordinate equations,
x = a sinh cos ,
y = a sinh sin ,
z = a cosh ,
we have for the velocity components,
x = a (cosh cos

sinh sin

),
y = a (cosh sin

+ sinh cos

),
z = a sinh

,
Setting ma
2
= 1 and = g/a, the Lagrangian takes the form
L =
m
2
x x mgz
=
1
2
(cosh
2
+ sinh
2
)

2
+
1
2
sinh
2

2
cosh
(b) Momenta and Hamiltonian
p

=
L

= sinh
2


, p

=
L

= (cosh
2
+ sinh
2
)

,
H =

p

+

p

L
=
1
2
_
p
2

cosh
2
+ sinh
2

+
p
2

sinh
2

_
+ cosh
(c) Constants of the motion
The relevant time evolution equations are
=
H

= 0,

H =
H
t
= 0.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 95
These show that p

and H are constant. According to the Liouville-Arnold


theorem, with the given assumptions, the manifold /
E,L
is a 2-dimensional
torus.
(d) ODE for u
For H = E, p

= L, we have the rst-order (in t) ordinary dierential equa-


tion for the motion:
E =
1
2
(cosh
2
+ sinh
2
)

2
+
1
2
L
2
sinh
2

+ cosh
Following the pattern used for the spherical pendulum, we introduce
u = cosh , u = sinh

,
so that

2
=
u
2
u
2
1
,
u
2
=
f(u)
2u
2
1
,
where
f(u) = 2(E u)(u
2
1) L
2
.
Since f(1) = L
2
and f(u) 2u
3
for u , we can sketch the function
f(u) in the physical region u 1. We see that u oscillates periodically
f(u)
u
u
1
u
-L
2
1
2
0
between the second and third roots of f(u), u
1
and u
2
, hence is bounded in
. Since is an angle, the motion as a whole is bounded.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 96
(e) Period and azimuthal shift
The period is twice the time it takes to go from u = u
1
to u = u
2
:
= 2
_
u
2
u
1
du
u
= 2
_
u
2
u
1
du

2u
2
1
f(u)
.
During one period, the azimuthal angle increases by
=
_
dt
d
dt
= 2
_
u
2
u
1
du
d
du
= 2L
_
u
2
u
1
du
u
2
1

2u
2
1
f(u)
.
(f) Example with L = 0
Intuitively, the answer is very simple. With the given initial conditions, the
motion will remain in the plane y = 0, with the x coordinate oscillating
periodically between a sinh
0
and a sinh
0
. It is the hyperbolic analogue
of a simple pendulum (motion on the arc of a hyperbola instead of on the
arc of a circle).

/2 3/2 2 /2 3/2 2
0
0
(t) (t)
t
t
The description in terms of the coordinates and is not so simple,
thanks to coordinate singularities. First, consider the time dependence of

:

=
L
sinh
2

=
L
u
2
1
.
At the initial point, with u = u
2
= cosh
0
, the denominator is positive, and
so L = 0. As long as the denominator is positive, the angle is constant and
equal to zero. However, at t = /2, the orbit reaches the turning point at u =
u
1
= 1, and so

becomes indeterminate. From our intuitive understanding
of the orbit, we know how to extend the solution past t = /2: as the particle
traverses the z axis in the xz plane, changes from 0 to . It then remains
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 97
constant at until the return passage through the z axis, when it returns to
the value 0. This is shown in the accompanying gure.
As for the time evolution, we have, for L = 0,

2
=
u
2
u
2
1
=
2(u u
2
)
2u
2
1
.
This is a nonsingular function which vanishes at the turning points. However,
is only well dened for 0 (like the radial coordinate r in spherical polar
coordinates), and so

must change sign at t = (n + 1/2), n = 0, 1, . . .. The
behavior of is sketched in the accompanying gure.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 98
Exercise 3.19 Conical pendulum
(a) Hamiltons equations
r =
H
pr
=
pr
m
,

=
H
p

= 0,

=
H
p

=
p

mr
2

p
r
=
H
r
=
p
2

mr
3
sin
2

mg cos ,
p

=
H

=
p
2

cos
mr
2
sin
3

+ mgr sin
p

=
H

= 0.
From the equations of motion in (a), and p

are constant. Since H has no


explicit time dependence, it also is constant.
(b) Eective 1D motion
Consider an orbit for which H = E, p

= L, and =
0
. Then the denition
of H gives
E =
1
2
m r
2
+
L
2
2mr
2
sin
2

0
+ mgr cos
0
. (19)
This is the energy equation for a one-dimensional system with coordinate r
restricted to positive values and a potential energy function
V
e
(r) =
a
r
2
+ br, a =
L
2
2msin
2

0
, b = mg cos .
This function is concave upward with a minimum V
0
= (2
2/3
+2
1/3
)a
1/3
b
2/3
at r = r
0
= (2a/b)
1/3
.
The radial motion is found by integrating (19), considered as a rst-order
ODE for r.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 99
(i) For E > V
0
, r
2
=
2
m
(E V
e
(r)) is positive between two neighboring
zeroes r
1
and r
2
of the righthand side, and so there is an oscillatory solution
between those extreme values. In the r, p
r
plane (with E, L,
0
xed) the
orbit is topologically equivalent to a circle. Having found r(t), one can then
directly integrate the equations of motion for (t) and p

(t). During one


period
r
of the r motion, the azimuth increases by , which is generically
incommensurate with 2, so that over time the orbit covers quasiperiodically
the portion r
1
r r
2
of the cone =
0
in conguration space. Similarly,
during each time interval of length
r
, the physically irrelevant coordinate
p

advances an amount p

, corresponding to an average velocity of p

/
r
along the p

axis.
(ii) For E < V
0
, E V
e
is strictly negative, and so there are no solutions to
(19).
(iii) For E = V
0
, we have r(t) = r
0
for all t, while and p

increase at
uniform rates. In conguration space, the orbit is a circle of radius r
0
sin
0
in a plane parallel to the x, y plane, at a distance r
0
cos
0
above it. The orbit
is a helix in the 3-dimensional x, y, p

subspace of phase space.


(c) Independence of the integrals
The integrals are functionally independent if all minors of the rectangular
matrix of partial derivatives,
F
i

j
, F
i
= , p

, H,
j
= r, , , p
r
, p

, p

, vanish.
_
F
i

j
_
=
_
_
_
_
_
_
_
_
0 0 p
r
1 0 p

0 0 0
0 0
pr
m
0 0 0
0 1
p

mr
2
sin
_
_
_
_
_
_
_
_
The only possible nonzero minors have 1 in the rst 2 columns and either
p
r
or p
r
/m in the third column. Both vanish if and only if
p
r
= p
r
= 0,
which implies r = 0 for all t, with
r sin =
_
p
2

tan
m
2
g
_
1/3
. (20)
These exceptional orbits are just those of case (iii) in (b).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 100
(d) Topological structure of a 3-torus?
Because of the unbounded p

motion, the manifold /is not compact, hence


does not satisfy the hypotheses of the theorem and cannot be a 3-torus.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 101
Exercise 3.20 Combined Coulomb and uniform electric fields
Calculation of the Hamiltonian
We rst write down the Lagrangian and calculate the canonical momenta:
L = T V =
m
8
_
u + v
u
u
2
+
u + v
v
v
2
+ 4uv

2
_
+
2
u + v
(u v).
p
u
=
L
u
=
m
4
_
u + v
u
_
u, p
v
=
L
v
=
m
4
_
u + v
v
_
v,
p

=
L

= muv

The Hamiltonian is then


H = up
u
+ vp
v
+

p

L.
Substituting for u, v,

in terms of u, v, , p
u
, p
v
, p

,, we get
H =
1
u + v
_
2
m
(up
2
u
+ vp
2
v
) +
p
2

2m
_
1
u
+
1
v
_
2 + (u
2
v
2
)
_
.
Commutation, independence, and separability
[K, H] = [
2up
2
u
m
+
p
2

2mu
+ u,
1
u + v
](u + v)H H[u, H]
= [
2up
2
u
m
,
1
u + v
](u + v)H H[u,
2up
2
u
m
] = 0.
The separability is established by solving the dening relations for K for
p
u
(u, p
u
, p
v
, p

) and p
v
(v, p
u
, p
v
, p

).
To check the independence, we write down the rectangular array of par-
tialo derivatives, using the relations
K
u
= v
H
u
,
K
v
= u
H
v
,
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 102
K
p
u
= v
H
p
u
,
K
p
v
= u
H
p
v
,
K
p

=
p

mv
+ v
H
p

.
We get
_
H
u
H
v
0
H
pu
H
pv
H
p

v
H
u
u
H
v
0 v
H
pu
u
H
pv

mv
+ v
H
p

_
For H and K to be dependent, all the 2 2 minors of this matrix must
vanish. This implies, in particular,
p

mv
H
u
= 0.
This restricts the dependence domain to a set of lower dimension, hence of
measure zero. For almost all points in phase space, H and K are independent.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 3 103
Chapter 4 Canonical perturbation theory
CONTENTS
4.1 Perturbed rotor (L) 105
4.2 Double-well quartic potential (L) 107
4.3 Perturbed 2D harmonic oscillator (L) 110
4.4 Perturbed oscillator in normal-mode coordinates (L) 113
4.5 Fourier series perturbation (L) 114
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 104
Exercise 4.1 Perturbed rotor
We make a canonical transformation from phase space coordinates , L
to Q, P by means of a generating function of type 2,
F
2
(, P, t) = P + aS(, P, t),
so that
L = P + a
S

,
Q = = + a
S
P
,
and the new Hamiltonian is
K(Q, P, t) = H((Q, P, t), L(Q, P, t), t) + a
S
t
((Q, P, t), P, t)
=
P
2
2I
+ a
P
I
S

+ a sin
2
sin(t) + a
S
t
+ O(a
2
).
We choose S to kill all of the O(a) terms, so that in lowest order K will be
simply P
2
/(2I). The condition on S gives the partial dierential equation
P
I
S

+
S
t
=
1
2
(1 cos(2) sin(t).
The right-hand side is an explicit sum of Fourier terms, and so we expand S
as
S = Bcos(t) + C sin(2) sin(t) + Dcos(2) cos(t).
One could include more Fourier terms, but these are the only ones which,
under application of / and /t, can cancel the given terms in K(Q, P, t).
Plugging into the PDE for S, we have
2P
I
(C sin(t) cos(2) Dsin(2) cos(t)) +
(Bsin(t) + C sin(2) cos(t) Dcos(2) sin(t)) =
1
2
(sin(t) + cos(2) sin(t)) .
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 105
Setting = 2P/I, we equate coecients to obtain
B =
1
2
, D =

2(
2

2
, C =

2(
2

2
Thus
S =
1
2
cos(t) +
1

2
_
sin(2) sin(t) +

2
cos(2) cos(t)
_
,
P = L a
S

= L
a

2
( cos(2) cos(t) sin(2) cos(t)) ,
K(P) =
P
2
2I
+ O(a
2
).
The rst order expressions blow up when 2P/I = . If the perturba-
tion expansion were carried out to higher orders, one would expect to nd
vanishing denominators when
m
P
I
+ n = 0, m, n integers.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 106
Exercise 4.2 Double-well quartic potential
For the Hamiltonian
H(x, p
x
) =
1
2
p
2
x


2
x
2
+

4
x
4
,
the equations of motion are
x =
H
p
x
= p
x
, p
x
=
H
x
= x x
3
.
The equilibrium points are obtained by setting the right-hand sides equal to
zero:
p
x
= 0, x = 0, x
0
, x
0
=
_
/.
(a) Phase portrait
The gure below was obtained using the Mathematica function ContourPlot,
assuming = = 1. Obviously the equilibrium point at the origin is unsta-
ble, while those at (x
0
, 0) are stable. This will be conrmed by the analytic
calculations of (b).
x
0
-x
0
0
(b) Relative coordinates
We set
x = x
0
+ q, p
x
= p.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 107
That the transformation from x, p
x
to the relative coordinates q, p is canonical
follows from a direct calculation of the Poisson brackets,
[q, q] = [p, p] = 0, [q, p] = [x x
0
, p] = 1.
The new Hamiltonian is obtained by substitution, dropping the constant
term H(x
0
, 0):
K(q, p) = H(x
0
+ q, p) H(x
0
, 0) = H
0
(q, p) + H
1
(q),
where
H
0
=
1
2
p
2
+ q
2
, H
1
=

q
3
+

4
q
4
.
For asymptotically small q, p, the system behaves as a harmonic oscillator
with angular frequency =

2, thus conrming the stability of the equi-


librium point at (x
0
, 0).
(c) Unperturbed action-angle variables
We now introduce the harmonic oscillator action-angle variables , J derived
in Section 3.3:
q =
_
2J

cos , p =

2J sin .
Substitution into K(q, p) gives

H(, J) = J +

H
1
(, J),

H
1
(, J) = 2
_

J
3/2
cos
3
+

2
J
2
cos
4
.
(d) First-order perturbation
In canonical perturbation theory, a generating function is introduced which
cancels the oscillatory part of the perturbation

H
1
(, J). What is left can be
obtained by simply averaging over the angle:

H =

J +

H
1
(

J) + O(
2
),
where

H
1
(

J) = 2
_

J
3/2
cos
3
) +

J
2
cos
4
)
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 108
But
cos
3
) = 0, cos
4
) = 3/8,
and so, to rst order in the perturbation,

H =

J +
3
8
2

J
2
.
The oscillation frequency is obtained by dierentiating with respect to the
action:
(

J) =


H


J
= +
3
4
2

J.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 109
Exercise 4.3 Perturbed 2D harmonic oscillator
(a)
We seek a canonical transformation q, p Q, P such that
Q
k
=
1

q
k
+
p
k
i
k

, P
k
=
k
q
k
+
k
p
k
, k = 1, 2,
where
k
and
k
are to be determined.
The canonical Poisson bracket relation
1 = [Q
k
, P
k
] =
1


k
i
k

implies

k
=

k
i
k
,
hence
P
k
=
k
q
k
+

k
i
k
+

p
k
.
Substituting into condition (iii), we get
k
= i
k
/

2, hence
P
k
=
1

2
(p
k
i
k
q
k
).
(b)
We now seek a canonical transformation (Q, P) (, J) such that
J
k
= iQ
k
P
k
, k = 1, 2.
To construct a generating function of type 2, we rewrite this equation with
the righthand side a function of the mixed set of variables Q
1
, Q
2
, J
1
, J
2
:
P
k
=
J
k
iQ
k
=
F
2
Q
k
(Q, J).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 110
Direct integration gives
F
2
(Q, J) =
1
i
2

k=1
J
k
ln Q
k
+ G(J),
with G an arbitrary smooth function of J
1
, J
2
. The angle coordinates
k
are then given by

k
=
F
2
J
k
=
1
i
ln Q
k
+
G
J
k
We must choose G such that the
k
are true angle coordinates. At the
least,
G
J
k
should cancel the imaginary part of the logarithmic term, i ln [Q
k
[.
But
[Q
k
[
2
= Q
k
Q

k
=
1
2
2
k
(p
2
k
+
2
k
q
2
k
) =
J
k

k
,
and hence we want
G
J
k
= i ln
_
J
k

k
,
G(J) = i

k
_
ln
_
J
k

k
dJ
k
.
With this choice,
Q
k
=
_
J
k

k
e
i
k
, P
k
= i
k
Q

k
= i
_
J
k

k
e
i
k
,
q
k
=
1

2
(Q
k

P
k
i
k
) =
_
2J
k

k
cos
k
,
p
k
=
1

2
(P
k
+ i
k
Q
k
) =
_
2J
k

k
sin
k
.
In terms of the , J coordinates, the Hamiltonian takes the form
H =
1
J
1
+
2
J
2
+ 4J
1
J
2
_

2
_
sin
2

1
cos
2

2
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 111
(c)
Making a canonical transformation with generating function

1

J
1
+
2

J
2
+ S(
1
,
2
,

J
1
,

J
2
),
we can eliminate all oscillatory terms in the Fourier expansion of H. This is
equivalent to making an angular average of H over the region 0
1
,
2
< 2.
Since the averages of sin
2

1
cos
2

2
is equal to 1/4, we get

H =
1

J
1
+
2

J
2
+

J
1

J
2
_

2
_
+ O(
2
)
The perturbed oscillation frequencies are

1
=


H


J
1
=
1
(1 +

J
2
) + O(
2
),

2
=


H


J
2
=
2
(1 +

1

2
2

J
1
) + O(
2
).
and the corresponding periods are

T
1
=
2

1
=
2

1
(1

J
2
) + O(
2
),

T
2
=
2

2
=
2

2
(1

1

2
2

J
1
) + O(
2
).
(d)
One does not expect the model to be integrable for 2 degrees of freedom.
The perturbation series can be constructed to arbitrary order in , using the
same technique as in (c). However, the series in for

H,
k
, etc. is not
expected to converge, no matter how small we take , at least in those parts
of phase space where numerical experiments show evidence for the existence
of chaotic orbits. These issues are discussed in some detail in Chapter 5.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 112
Exercise 4.4 Perturbed oscillator in normal-mode coordinates
The Hamiltonian, in expanded form, is
H = ia

a + (a
4
+ 4 a
3
a

+ 6 a
2
a
2
+ 4 aa
3
+ a
4
).
We introduce a perturbative generating function for a canonical transforma-
tion to new coordinates, A and A

:
F
2
(a, A

) = aA

+ S(a, A).
where S(a, A) is a quartic polynomial. The corresponding transformation
is given by
a

=
F
2
a
= A

+
S
A
(A, A

) + higher degree terms,


A =
F
2
A

= a +
S
A

(A, A

) + higher degree terms.


with a transformed Hamiltonian
K(A, A

) = i(AA

+A
S
A
A

S
A

)+(A
4
+4 A
3
A

+6 A
2
A
2
+4 AA
3
+A
4
)
+higher degree terms.
The Birkho-Gustavson indices d(M) of the monomials M in the factor
multiplying are
d(A
4
) = 4i = d(A
4
), d(A
3
A

) = d(AA
3
) = 2i, d(A
2
A
2
) = 0.
According to the general prescription, we construct our generating function
by replacing each of the monomials M with nonzero index by M/d(M).
This gives
S(A, A

) = i

_
A
4
4
+ 2A
3
A

2AA
3

A
4
4
_
.
If we insert this into the expression for K, we get
K(A, A

) = i(AA

) + 6(AA

)
2
+ higher degree terms,
while the transformation equations are
A = a i

_
2a
3
6aa
2
4a
3
_
+ higher degree terms,
A

= a

+ i

_
6a
2
a

2a
3
+ a
3
_
+ higher degree terms.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 113
Exercise 4.5 Fourier series perturbation
By means of a perturbative transformation
(q
1
, q
2
, p
1
, p
2
) (
1
,
2
, J
1
, J
2
),
we seek to convert the Hamiltonian
H =
1
p
1
+
2
p
2
+

k
1
,k
2
=
h
k
1
,k
2
(p
1
, p
2
) e
i(k
1
q
1
+k
2
q
2
)
into
K =
1
J
1
+
2
J
2
+ K
1
(J
1
, J
2
) + O(
2
).
We use a generating function of the (perturbative) form
F
2
(q
1
, q
2
, J
1
, J
2
) = q
1
J
1
+ q
2
J
2
+

k
1
,k
2
=
c
k
1
,k
2
(J
1
, J
2
) e
i(k
1
q
1
+k
2
q
2
)
so that, up to O(
2
) terms,

i
=
F
2
J
i
(, J) = q
i
f
i
(, J)
p
i
=
F
2
q
i
(, J) = J
i
+ g
i
(, J)
where
f
i
(, J) =

k
1
,k
2
=
c
k
1
,k
2
J
i
(J) e
i(k
1

1
+k
2

2
)
,
g
i
(, J) =

k
1
,k
2
=
ik
i
c
k
1
,k
2
e
i(k
1

1
+k
2

2
)
Inserting the expansions of P
1
and p
2
into H, we get
K =
1
J
1
+
2
J
2
+

k
1
,k
2
=
_
i(
1
k
1
+
2
k
2
)c
k
1
,k
2
(J) +h
k
1
,k
2
(J)
_
e
i(k
1
q
1
+k
2
q
2
)
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 114
We can choose the coecients c
k
1
,k
2
(J) to kill all of the h
k
1
,k
2
(J) except for
the term k
1
= k
2
= 0, which contributes to K
1
(J):
c
0,0
(J) = 0,
c
k
1
,k
2
(J) =
i h
k
1
,k
2
(J)

1
k
1
+
2
k
2
, (k
1
, k
2
) = (0, 0),
K(, J) =
1
J
1
+
2
J
2
+ h
0,0
(J) + O(
2
).
We run into convergence problems whenever
1
and
2
are rationally
related, i.e. their ratio is a rational number. In that case, at least one of the
coecients blows up. Even if there is no exact resonance, one will encounter
smaller and smaller denominators as one progresses to higher values of |k
1
| +
|k
2
|. This small denominators problem, and its solution, are an important
part of the statement and proof of the KAM theorem (see discussion in EHD,
Section 5.2).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 4 115
Chapter 5 Order and chaos in Hamiltonian systems
CONTENTS
5.1 Covering the rationals with room to spare (L) 117
5.2 Nonlinear stability of the Lagrange points (M) 118
5.3 Full treatment of the nonlinear stability L
4
and L
5
(M) 124
5.4 Poincare sections of the driven pendulum (M) 130
5.5 Stochastic web map (M) 134
5.6 Stochastic webs (M) 137
5.7 Folded web map (M) 144
5.8 Orbits and Poincare sections of the Dung oscillator (M) 150
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 116
Exercise 5.1 Covering the rationals with room to spare
The result is easy to prove, but still challenges our intuition about the
real numbers. The rationals are dense in the reals, but nonetheless they are
countable, and so we can list them as r
1
, r
2
, r
3
, . . . . If, on the segment (0, 1),
we cover the nth rational r
n
with a segment of length 2
n2
, the total length
of all the segments will be less than or equal to
1
4

n=1
2
n
=
1
8

1 +
1
2
+ (
1
2
)
2
+

=
1
8

1
1
1
2

=
1
4
<
1
2
.
It is easy to change the prescription to make the total length as small as one
wants.
This simple warm-up exercise is designed to help students deal with the
KAM solution to the small denominator problem of canonical perturbation
theory. In that context, the resonant frequencies may be dense in the space
of all frequencies, but they can be covered by open sets and removed from
the space at the expense of only a small fraction of the total measure.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 117
Exercise 5.2 Nonlinear stability of the Lagrange points L
4
and
L
5
Hamiltonian
Hamiltonian for a mass-0 particle in the S-J co-rotating frame of reference (S and J on the x-axis, center-of-mass at the
origin):
In[15]:= hamK = px^2 2 + py^2 2 + px y - x py -
Hmu Sqrt@Hx + mu - 1L^2 + y^2D + H1 - muL Sqrt@Hx + muL^2 + y^2DL
Out[15]=
px
2
2
+
py
2
2
- py x + px y -
mu
H-1 + mu + xL
2
+ y
2
-
1 - mu
Hmu + xL
2
+ y
2
Here p
x
and p
y
are the momenta canonically conjugate to x and y, respectively. We have chosen time units such that
the Keplerian frequency is equal to unity. The velocities are given by Hamilton's eqns.: x

= p
x
+ y, y

= p
y
- x . At a
stationary point (a,b), the momenta are thus p
x
= -b, p
y
= a . At L
4
,
a = 1/2 - m, b= 3 2 Hsee EHDFigure 2.7L, while at L
5
, a = 1/2 - m, b= - 3 2 . From here on, we restrtict
ourselves to L
4
.
Hamiltonian in relative coordinates in neighborhood of L
4
We now introduce coordinates q1,q2,p1,p2 relative to the L
4
stationary point (see EHD Figurer 2.7). We also use a
parameter s is introduced to keep track of powers of q1,q2,p1,p2.
In[18]:= hamK1 = hamK . 8x 1 2 - mu + s * q1,
y Sqrt@3D 2 + s * q2, px -Sqrt@3D 2 + s * p1, py 1 2 - mu + s * p2<;
We Taylor-expand up to degree 4:
In[19]:= hamK1 = Collect@Expand@Normal@Series@hamK1, 8s, 0, 4<DDD, sD
Out[19]= -
3
2
+
mu
2
-
mu
2
2
+
p1
2
2
+
p2
2
2
- p2 q1 +
q1
2
8
+ p1 q2 -
3
4
3 q1 q2 +
3
2
3 mu q1 q2 -
5 q2
2
8
s
2
+
-
7 q1
3
16
+
7 mu q1
3
8
+
3
16
3 q1
2
q2 +
33 q1 q2
2
16
-
33
8
mu q1 q2
2
+
3 3 q2
3
16
s
3
+
37 q1
4
128
+
25
32
3 q1
3
q2 -
25
16
3 mu q1
3
q2 -
123 q1
2
q2
2
64
-
45
32
3 q1 q2
3
+
45
16
3 mu q1 q2
3
-
3 q2
4
128
s
4
Finally, we introduce the parameter k=
3
4
3 H1 - 2 mL to simplify the coefficients:
In[20]:= hamK1 = Collect@Simplify@hamK1 . mu 1 2 - 2 k H3 Sqrt@3DLD, sD
Out[20]= -
11
8
-
2 k
2
27
+
p1
2
2
+
p2
2
2
- p2 q1 +
q1
2
8
+ p1 q2 - k q1 q2 -
5 q2
2
8
s
2
+
-
7 k q1
3
12 3
+
3
16
3 q1
2
q2 +
11 k q1 q2
2
4 3
+
3 3 q2
3
16
s
3
+
37 q1
4
128
+
25
24
k q1
3
q2 -
123 q1
2
q2
2
64
-
15
8
k q1 q2
3
-
3 q2
4
128
s
4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 118
Diagonalization of the quadratic Hamiltonian
hamK2 =
p1
2
2
+
p2
2
2
- p2 q1 +
q1
2
8
+ p1 q2 - k q1 q2 -
5 q2
2
8
;
The quadratic Hamiltonian hamK2 may be written
1
2
rCr , where r=(q1,q2,p1,p2) and
c = 881 4, -k, 0, -1<, 8-k, -5 4, 1, 0<, 80, 1, 1, 0<, 8-1, 0, 0, 1<<;
Hamilton's equations take the form r

=Cr, where C=WC, W=


0 0
0 0
1 0
0 1
-1 0
0 -1
0 0
0 0
.
cbar = 880, 1, 1, 0<, 8-1, 0, 0, 1<, 8-1 4, k, 0, 1<, 8k, 5 4, -1, 0<<;
Calculate eigenvalues lam1 , lam2 , and eigenvectors e1, e2, f1, f2 of matrix cbar
eigensys = Eigensystem@cbarD;
lam1 = eigensys@@1, 2DD
1
2
-2 - -23 + 16 k
2
lam2 = eigensys@@1, 4DD
1
2
-2 + -23 + 16 k
2
e1 = SimplifyBeigensys@@2, 2DD . -23 + 16 k
2
-2 - 4 a1^2F
:
4 9 + 4 a1
2
+ 4 a1
2
k
9 + 20 a1
2
+ 16 k
2
,
4 a1
2
I5 + 4 a1
2
M - 4 k
9 + 20 a1
2
+ 16 k
2
,
16 a1
2
+ k + a1
2
k
9 + 20 a1
2
+ 16 k
2
, 1>
e2 = SimplifyBeigensys@@2, 1DD . -23 + 16 k
2
-2 - 4 a1^2F
:
4 9 + 4 a1
2
- 4 a1
2
k
9 + 20 a1
2
+ 16 k
2
, -
4 a1
2
I5 + 4 a1
2
M + 4 k
9 + 20 a1
2
+ 16 k
2
, -
16 a1
2
- I1 + a1
2
M k
9 + 20 a1
2
+ 16 k
2
, 1>
f1 = SimplifyBeigensys@@2, 4DD . -23 + 16 k
2
2 + 4 a2^2F
:
4 9 + 4 a2
2
+ 4 a2
2
k
9 + 20 a2
2
+ 16 k
2
,
4 a2
2
I5 + 4 a2
2
M - 4 k
9 + 20 a2
2
+ 16 k
2
,
16 a2
2
+ k + a2
2
k
9 + 20 a2
2
+ 16 k
2
, 1>
f2 = SimplifyBeigensys@@2, 3DD . -23 + 16 k
2
2 + 4 a2^2F
:
4 9 + 4 a2
2
- 4 a2
2
k
9 + 20 a2
2
+ 16 k
2
, -
4 a2
2
I5 + 4 a2
2
M + 4 k
9 + 20 a2
2
+ 16 k
2
, -
16 a2
2
- I1 + a2
2
M k
9 + 20 a2
2
+ 16 k
2
, 1>
These expressions can be simplified by multiplying all components by a common factor and evaluating the square
roots of perfect squares:
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 119
e1 = SimplifyBe1 * I9 + 20 a1
2
+ 16 k
2
M 4 . a1
2
a1F
:9 + 4 a1
2
+ 4 a1 k, 5 a1 + 4 a1
3
- 4 k, 4 Ia1 + k + a1
2
kM,
9
4
+ 5 a1
2
+ 4 k
2
>
e2 = SimplifyBe2 * I9 + 20 a1
2
+ 16 k
2
M 4 . a1
2
a1F
:9 + 4 a1
2
- 4 a1 k, -5 a1 - 4 a1
3
- 4 k, 4 I-a1 + k + a1
2
kM,
9
4
+ 5 a1
2
+ 4 k
2
>
f1 = SimplifyBf1 * I9 + 20 a2
2
+ 16 k
2
M 4 . a2
2
a2F
:9 + 4 a2
2
+ 4 a2 k, 5 a2 + 4 a2
3
- 4 k, 4 Ia2 + k + a2
2
kM,
9
4
+ 5 a2
2
+ 4 k
2
>
f2 = SimplifyBf2 * I9 + 20 a2
2
+ 16 k
2
M 4 . a2
2
a2F
:9 + 4 a2
2
- 4 a2 k, -5 a2 - 4 a2
3
- 4 k, 4 I-a2 + k + a2
2
kM,
9
4
+ 5 a2
2
+ 4 k
2
>
We check the orthogonality conditions.
8Simplify@e1.c.e1 . 8a1 lam1, a2 lam2<D, Simplify@e2.c.e2 . 8a1 lam1, a2 lam2<D,
Simplify@f1.c.f1 . 8a1 lam1, a2 lam2<D, Simplify@f2.c.f2 . 8a1 lam1, a2 lam2<D<
80, 0, 0, 0<
8Simplify@f1.c.e1 . 8a1 lam1, a2 lam2<D, Simplify@f1.c.e2 . 8a1 lam1, a2 lam2<D,
Simplify@f2.c.e1 . 8a1 lam1, a2 lam2<D, Simplify@f2.c.e2 . 8a1 lam1, a2 lam2<D<
80, 0, 0, 0<
rho1 = Expand@
Expand@e1.c.e2D . 8a1^6 -a1^4 + k^2 a1^2 - H27 16L a1^2, a1^4 -a1^2 + k^2 - 27 16<D
27
4
- 113 a1
2
- 112 k
2
+ 48 a1
2
k
2
+ 64 k
4
rho2 = Expand@
Expand@f1.c.f2D . 8a2^6 -a2^4 + k^2 a2^2 - H27 16L a2^2, a2^4 -a2^2 + k^2 - 27 16<D
27
4
- 113 a2
2
- 112 k
2
+ 48 a2
2
k
2
+ 64 k
4
Transformation to normal-mode variables q1, q2, p1, p2
Let (q1,q2,p1,p2) = (lam1/rho1) q1 e1+ p1 e2 + (lam2/rho2) q2 f1+ p1 f2
The term proportional to e1 has time dependence exp(lam1 t).
The term proportional to e2 has time dependence exp(-lam1 t).
The term proportional to e1 has time dependence exp(lam2 t).
The term proportional to e1 has time dependence exp(-lam1 t).
Note: lam1 and lam2 are pure imaginary for 23/16 < k
2
< 27/16.
Note: the assignment of constant coefficients is not unique.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 120
Numerical values corresponding to realistic Jupiter/Sun mass ratio
k = 1.296559882047848`;
a1 = lam1 = NB
1
2
-2 - -23 + 16 k
2
F
0. + 0.996758
a2 = lam2 = NB
1
2
-2 + -23 + 16 k
2
F
0. + 0.0804636
Expressing quadratic Hamiltonian hamK2 in terms of new canonical variables
The canonical transformation to normal-mode coordinates is effected by the following substitution:
sub :=
8q1 lam1 rho1 * He1@@1DD * q1L + e2@@1DD * p1 + lam2 rho2 * Hf1@@1DD * q2L + f2@@1DD * p2,
q2 lam1 rho1 * He1@@2DD * q1L + e2@@2DD * p1 + lam2 rho2 * Hf1@@2DD * q2L + f2@@2DD * p2,
p1 lam1 rho1 * He1@@3DD * q1L + e2@@3DD * p1 + lam2 rho2 * Hf1@@3DD * q2L + f2@@3DD * p2,
p2 lam1 rho1 * He1@@4DD * q1L + e2@@4DD * p1 + lam2 rho2 * Hf1@@4DD * q2L + f2@@4DD * p2<
hamK2 = Chop@Expand@hamK2 . subDD
H0. + 0.996758 L p1 q1 + H0. + 0.0804636 L p2 q2
We see that the new canonical variables reduce the quadratic Hamiltonian to diagonal form. This is just a check: they
were custom-designed to do this.
Cubic Hamiltonian in terms of new variables
hamK3 = H-k * Sqrt@3D 36L * H7 q1^3 - 33 q1 q2^2L + H3 Sqrt@3D 16L * Hq1^2 q2 + q2^3L;
hamK3 = Chop@Expand@hamK3 . subDD
H446.029 + 6.92642 L p1
3
+ H929.789 + 531.594 L p1
2
p2 + H407.706 + 669.549 L p1 p2
2
+
H3.1401 + 89.4203 L p2
3
- H5.28984 - 2.97967 L p1
2
q1 - H1.68909 + 0.0681359 L p1 p2 q1 +
H14.2729 + 7.49054 L p2
2
q1 - H0.0944863 - 0.167742 L p1 q1
2
- H0.78113 - 0.479715 L p2 q1
2
-
H0.000220856 + 0.0142221 L q1
3
+ H83.9699 - 136.73 L p1
2
q2 + H195.659 - 110.794 L p1 p2 q2 +
H15.6339 + 0.301558 L p2
2
q2 - H0.0119927 + 0.2973 L p1 q1 q2 +
H3.51332 - 6.2044 L p2 q1 q2 + H0.0940852 + 0.164561 L q1
2
q2 - H7.31805 + 13.9442 L p1 q2
2
+
H0.0530777 + 2.75174 L p2 q2
2
- H0.657756 + 0.400525 L q1 q2
2
+ H0.487595 + 0.0171225 L q2
3
Quartic Hamiltonian in terms of new variables
hamK4 =
37 q1
4
128
+ H25 24L k q1
3
q2 -
123 q1
2
q2
2
64
- H15 8L k q1 q2
3
-
3 q2
4
128
;
hamK4 = Chop@Expand@hamK4 . subDD
H2332.47 + 4246.47 L p1
4
- H20.0345 - 16865.1 L p1
3
p2 - H11058.5 - 20030.5 L p1
2
p2
2
-
H12625.7 - 7978.77 L p1 p2
3
- H4417.24 - 272.286 L p2
4
- H139.448 + 82.8476 L p1
3
q1 -
H263.077 + 446.565 L p1
2
p2 q1 - H20.1582 + 655.826 L p1 p2
2
q1 + H173.698 - 341.213 L p2
3
q1 +
4.6351 p1
2
q1
2
+ H13.6603 + 7.49003 L p1 p2 q1
2
+ H9.97125 + 15.6731 L p2
2
q1
2
-
H0.140221 - 0.0833068 L p1 q1
3
- H0.474289 - 0.0153618 L p2 q1
3
+
H0.0023584 - 0.00429367 L q1
4
+ H2618.08 + 84.7974 L p1
3
q2 + H6206.08 + 3682.61 L p1
2
p2 q2 +
H3693.31 + 6265.61 L p1 p2
2
q2 + H93.7221 + 3044.4 L p2
3
q2 - H75.8233 - 41.5742 L p1
2
q1 q2 -
229.654 p1 p2 q1 q2 - H188.314 + 103.3 L p2
2
q1 q2 + H1.46833 - 2.49245 L p1 q1
2
q2 +
H6.24048 - 3.70302 L p2 q1
2
q2 + H0.00011244 + 0.0946521 L q1
3
q2 + H307.207 - 482.876 L p1
2
q2
2
+
H1045.26 - 573.376 L p1 p2 q2
2
+ 798.041 p2
2
q2
2
- H0.624502 - 20.3175 L p1 q1 q2
2
-
H20.6138 - 34.9707 L p2 q1 q2
2
- H0.344491 + 0.623986 L q1
2
q2
2
- H29.8688 + 58.6743 L p1 q2
3
+
H2.90352 - 94.3156 L p2 q2
3
+ H2.18313 + 1.37962 L q1 q2
3
- H4.23951 + 0.261331 L q2
4
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 121
Reduction to Birkhoff Normal Form
L/: L^(n_/;n>m):=0
m = 4;
hamK = L^2 hamK2 + L^3 hamK3 + L^4 hamK4
L
2
HH0. + 0.996758 L p1 q1 + H0. + 0.0804636 L p2 q2L +
L
3
IH446.029 + 6.92642 L p1
3
+ H929.789 + 531.594 L p1
2
p2 + H407.706 + 669.549 L p1 p2
2
+
H3.1401 + 89.4203 L p2
3
- H5.28984 - 2.97967 L p1
2
q1 - H1.68909 + 0.0681359 L p1 p2 q1 +
H14.2729 + 7.49054 L p2
2
q1 - H0.0944863 - 0.167742 L p1 q1
2
- H0.78113 - 0.479715 L p2 q1
2
-
H0.000220856 + 0.0142221 L q1
3
+ H83.9699 - 136.73 L p1
2
q2 + H195.659 - 110.794 L p1 p2 q2 +
H15.6339 + 0.301558 L p2
2
q2 - H0.0119927 + 0.2973 L p1 q1 q2 +
H3.51332 - 6.2044 L p2 q1 q2 + H0.0940852 + 0.164561 L q1
2
q2 -
H7.31805 + 13.9442 L p1 q2
2
+ H0.0530777 + 2.75174 L p2 q2
2
-
H0.657756 + 0.400525 L q1 q2
2
+ H0.487595 + 0.0171225 L q2
3
M +
L
4
IH2332.47 + 4246.47 L p1
4
- H20.0345 - 16865.1 L p1
3
p2 - H11058.5 - 20030.5 L p1
2
p2
2
-
H12625.7 - 7978.77 L p1 p2
3
- H4417.24 - 272.286 L p2
4
- H139.448 + 82.8476 L p1
3
q1 -
H263.077 + 446.565 L p1
2
p2 q1 - H20.1582 + 655.826 L p1 p2
2
q1 +
H173.698 - 341.213 L p2
3
q1 + 4.6351 p1
2
q1
2
+ H13.6603 + 7.49003 L p1 p2 q1
2
+
H9.97125 + 15.6731 L p2
2
q1
2
- H0.140221 - 0.0833068 L p1 q1
3
-
H0.474289 - 0.0153618 L p2 q1
3
+ H0.0023584 - 0.00429367 L q1
4
+
H2618.08 + 84.7974 L p1
3
q2 + H6206.08 + 3682.61 L p1
2
p2 q2 +
H3693.31 + 6265.61 L p1 p2
2
q2 + H93.7221 + 3044.4 L p2
3
q2 - H75.8233 - 41.5742 L p1
2
q1 q2 -
229.654 p1 p2 q1 q2 - H188.314 + 103.3 L p2
2
q1 q2 + H1.46833 - 2.49245 L p1 q1
2
q2 +
H6.24048 - 3.70302 L p2 q1
2
q2 + H0.00011244 + 0.0946521 L q1
3
q2 +
H307.207 - 482.876 L p1
2
q2
2
+ H1045.26 - 573.376 L p1 p2 q2
2
+ 798.041 p2
2
q2
2
-
H0.624502 - 20.3175 L p1 q1 q2
2
- H20.6138 - 34.9707 L p2 q1 q2
2
-
H0.344491 + 0.623986 L q1
2
q2
2
- H29.8688 + 58.6743 L p1 q2
3
+
H2.90352 - 94.3156 L p2 q2
3
+ H2.18313 + 1.37962 L q1 q2
3
- H4.23951 + 0.261331 L q2
4
M
transform@h_, s_, w_D := Module@
8h1, h2, h3, w1, u1, u2, v1, v2, wu1, wu2, wy1, wy2, zu1, zu2, zy1, zy2<, h1 = ExpandAll@hD;
h2 = h1 . L^Hn_ ; n > Hm - s + 2LL 0;
h3 = h1 - h2;
h2 = h2 . 8q1 u1, q2 u2, p1 v1, p2 v2<;
w1 = ExpandAll@wD . 8q1 u1, q2 u2<;
zu1 = D@w1, u1D; zu2 = D@w1, u2D;
zy1 = D@w1, p1D; zy2 = D@w1, p2D;
subst@mon_D :=
ExpandAll@mon . 8u1 q1 - L^Hs - 2L * wy1, u2 q2 - L^Hs - 2L * wy2, v1 p1 + L^Hs - 2L * wu1,
v2 p2 + L^Hs - 2L * wu2<D . 8wu1 zu1, wu2 zu2, wy1 zy1, wy2 zy2<;
Collect@h3 + Map@FixedPoint@subst, D &, h2D, LDD
index@mon_D :=
Chop@ExpandAll@Hlam1 * q1 * D@mon, q1D + lam2 * q2 * D@mon, q2D - lam1 * p1 * D@mon, p1D -
lam2 * p2 * D@mon, p2DL monD . 8q1 0, q2 0, p1 0, p2 0<D
reduce@mon_D := If@index@monD === 0, mon, 0D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 122
w3 = If@index@D 0, 0, - index@DD & hamK3
H2.31632 - 149.16 L p1
3
+ H256.316 - 448.312 L p1
2
p2 + H578.351 - 352.174 L p1 p2
2
+
H370.438 - 13.0084 L p2
3
+ H2.98937 + 5.30705 L p1
2
q1 - H0.846792 - 20.992 L p1 p2 q1 -
H8.9618 - 17.0763 L p2
2
q1 - H0.168288 + 0.0947937 L p1 q1
2
- H0.250759 + 0.408316 L p2 q1
2
+
H0.00475612 - 0.0000738582 L q1
3
- H71.4722 + 43.8932 L p1
2
q2 -
H111.155 + 196.295 L p1 p2 q2 + H3.74776 - 194.297 L p2
2
q2 + H3.69483 - 0.149045 L p1 q1 q2 +
H6.22458 + 3.52475 L p2 q1 q2 - H0.0793454 - 0.0453646 L q1
2
q2 - H16.6831 - 8.75542 L p1 q2
2
-
H34.1986 - 0.659648 L p2 q2
2
+ H0.345971 - 0.568165 L q1 q2
2
- H0.0709327 - 2.01994 L q2
3
Chop@reduce Htransform@hamK, 3, w3D . L 1LD
H0. + 0.996758 L p1 q1 - 0.00567714 p1
2
q1
2
+
H0. + 0.0804636 L p2 q2 - 0.155141 p1 p2 q1 q2 - 0.559867 p2
2
q2
2
In terms of the actions J
k
= q
k
p
k
, k=1,2, the expansion of hamK takes the form
w
1
J
1
+ w
2
J
2
+ w
11
J
1
2
+ 2 w
12
J
1
J
2
+ w
22
J
2
2
For nonlinear stability, the following determinant should be nonzero:
det
2 w
11
2 w
12
w
1
2 w
21
2 w
22
w
2
w
1
w
2
0
Det@882 * 0.005677141863462687` , 0.15514061382421573`, 0.9967575482584466`<,
80.15514061382421573`, 2 * 0.5598666915036574` , 0.08046359418899884` <,
80.9967575482584466`, 0.08046359418899884`, 0<<D
-1.08767
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 123
Exercise 5.3 Nonlinear stability of the Lagrange points L
4
and
L
5
(full treatment)
The normal mode analysis of the quadratic Hamiltonian with parameter k ,
In[1]:= hamK2 =
p1
2
2
+
p2
2
2
- p2 q1 +
q1
2
8
+ p1 q2 - k q1 q2 -
5 q2
2
8
;
may be found in the solution of Exercise 5.2. We merely review the results. The eigenvalue equation
27
16
- k
2
+ lambda
2
+ lambda
4
= 0
has solutions
In[2]:= a1 =
1
2
-2 - -23 + 16 k
2
; a2 =
1
2
-2 + -23 + 16 k
2
;
and eigenvectors
In[22]:= e1 = :9 + 4 a1
2
+ 4 a1 k, 5 a1 + 4 a1
3
- 4 k, 4 Ia1 + k + a1
2
kM,
9
4
+ 5 a1
2
+ 4 k
2
>;
e2 = :9 + 4 a1
2
- 4 a1 k, -5 a1 - 4 a1
3
- 4 k, 4 I-a1 + k + a1
2
kM,
9
4
+ 5 a1
2
+ 4 k
2
>;
f1 = :9 + 4 a2
2
+ 4 a2 k, 5 a2 + 4 a2
3
- 4 k, 4 Ia2 + k + a2
2
kM,
9
4
+ 5 a2
2
+ 4 k
2
>;
f2 = :9 + 4 a2
2
- 4 a2 k, -5 a2 - 4 a2
3
- 4 k, 4 I-a2 + k + a2
2
kM,
9
4
+ 5 a2
2
+ 4 k
2
>;
The inner products with respect to the symmetric matrix
c = 881 4, -k, 0, -1<, 8-k, -5 4, 1, 0<, 80, 1, 1, 0<, 8-1, 0, 0, 1<<
vanish, except for
e1 c e2 = rho1, f1 c f2 = rho2, where
In[26]:= rho1 =
27
4
- 113 a1
2
- 112 k
2
+ 48 a1
2
k
2
+ 64 k
4
;
rho2 =
27
4
- 113 a2
2
- 112 k
2
+ 48 a2
2
k
2
+ 64 k
4
;
Normal mode coordinates are introduced via the substitution
In[9]:= sub :=
8q1 a1 rho1 * He1@@1DD * q1L + e2@@1DD * p1 + a2 rho2 * Hf1@@1DD * q2L + f2@@1DD * p2,
q2 a1 rho1 * He1@@2DD * q1L + e2@@2DD * p1 + a2 rho2 * Hf1@@2DD * q2L + f2@@2DD * p2,
p1 a1 rho1 * He1@@3DD * q1L + e2@@3DD * p1 + a2 rho2 * Hf1@@3DD * q2L + f2@@3DD * p2,
p2 a1 rho1 * He1@@4DD * q1L + e2@@4DD * p1 + a2 rho2 * Hf1@@4DD * q2L + f2@@4DD * p2<
In[10]:= Simplify@hamK2 . subD
Out[10]=
1
2
-2 - -23 + 16 k
2
p1 q1 + -2 + -23 + 16 k
2
p2 q2
We see that the new canonical variables reduce the quadratic Hamiltonian to diagonal form. This is just a check: they
were custom-designed to do this.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 124
In[21]:= Clear@a1, a2D
In[28]:= hamK3 = HH-k * Sqrt@3D 36L * H7 q1^3 - 33 q1 q2^2L + H3 Sqrt@3D 16L * Hq1^2 q2 + q2^3LL . sub;
In[29]:= For@nu1 = 0, nu1 3, nu1++, For@nu2 = 0, nu2 3, nu2++, For@nu3 = 0, nu3 3, nu3++,
For@nu4 = 0, nu4 3, nu4++, If@nu1 + nu2 + nu3 + nu4 3,
gval@nu1, nu2, nu3, nu4D = Simplify@D@D@D@D@hamK3 Hnu1! nu2! nu3! nu4!L, 8q1, nu1<D,
8q2, nu2<D, 8p1, nu3<D, 8p2, nu4<DDDDDDD;
In[30]:= For@nu1 = 0, nu1 3, nu1++, For@nu2 = 0, nu2 3, nu2++, For@nu3 = 0, nu3 3, nu3++,
For@nu4 = 0, nu4 3, nu4++, If@nu1 + nu2 + nu3 + nu4 3,
Print@"g@", nu1, ",", nu2, ",", nu3, ",", nu4, "D=", gval@nu1, nu2, nu3, nu4DDDDDDD
g@0,0,0,3D=
1
288 3
I162 I-5 a2 - 4 a2
3
- 4 kM II5 a2 + 4 a2
3
+ 4 kM
2
+ I9 + 4 a2
2
- 4 a2 kM
2
M -
4 k I-198 I5 a2 + 4 a2
3
+ 4 kM
2
I9 + 4 a2
2
- 4 a2 kM + 42 I9 + 4 a2
2
- 4 a2 kM
3
MM
g@0,0,1,2D=
1
96 3
I27 I-6 I5 a1 + 4 a1
3
+ 4 kM I5 a2 + 4 a2
3
+ 4 kM
2
+ 4 I5 a2 + 4 a2
3
+ 4 kM I-9 - 4 a1
2
+ 4 a1 kM
I9 + 4 a2
2
- 4 a2 kM - 2 I5 a1 + 4 a1
3
+ 4 kM I9 + 4 a2
2
- 4 a2 kM
2
M -
4 k I66 I5 a2 + 4 a2
3
+ 4 kM
2
I-9 - 4 a1
2
+ 4 a1 kM + 42 I9 + 4 a1
2
- 4 a1 kM I9 + 4 a2
2
- 4 a2 kM
2
+
132 I5 a1 + 4 a1
3
+ 4 kM I5 a2 + 4 a2
3
+ 4 kM I-9 - 4 a2
2
+ 4 a2 kMMM
etc., etc., etc.
In[31]:= hamK4 =
37 q1
4
128
+ H25 24L k q1
3
q2 -
123 q1
2
q2
2
64
- H15 8L k q1 q2
3
-
3 q2
4
128
. sub;
In[36]:= For@nu1 = 0, nu1 4, nu1++, For@nu2 = 0, nu2 4, nu2++, For@nu3 = 0, nu3 4, nu3++,
For@nu4 = 0, nu4 4, nu4++, If@Hnu1 == nu3L && Hnu2 == nu4L && H2 nu1 + 2 nu2 == 4L,
hval@nu1, nu2, nu3, nu4D = Simplify@D@D@D@D@hamK4 Hnu1! nu2! nu3! nu4!L, 8q1, nu1<D,
8q2, nu2<D, 8p1, nu3<D, 8p2, nu4<DDDDDDD;
In[37]:= Print@"h@", 2, ",", 0, ",", 2, ",", 0, "D=", hval@2, 0, 2, 0DD;
Print@"h@", 0, ",", 2, ",", 0, ",", 2, "D=", hval@0, 2, 0, 2DD;
Print@"h@", 1, ",", 1, ",", 1, ",", 1, "D=", hval@1, 1, 1, 1DD;
h@2,0,2,0D=Ia1
2
I-2304 a1
12
- 768 a1
10
I-67 + 240 k
2
M - 32 a1
8
I-13989 + 36464 k
2
M +
16 a1
6
I85215 - 200448 k
2
+ 6400 k
4
M + 9 I80919 - 235872 k
2
+ 45824 k
4
M +
6 a1
2
I298809 - 781728 k
2
+ 118016 k
4
M + 3 a1
4
I699117 - 1693472 k
2
+ 147712 k
4
MMM
I4 I27 - 448 k
2
+ 256 k
4
+ 4 a1
2
I-113 + 48 k
2
MM
2
M
h@0,2,0,2D=Ia2
2
I-2304 a2
12
- 768 a2
10
I-67 + 240 k
2
M - 32 a2
8
I-13989 + 36464 k
2
M +
16 a2
6
I85215 - 200448 k
2
+ 6400 k
4
M + 9 I80919 - 235872 k
2
+ 45824 k
4
M +
6 a2
2
I298809 - 781728 k
2
+ 118016 k
4
M + 3 a2
4
I699117 - 1693472 k
2
+ 147712 k
4
MMM
I4 I27 - 448 k
2
+ 256 k
4
+ 4 a2
2
I-113 + 48 k
2
MM
2
M
h@1,1,1,1D=
Ia1 a2 I-48 a1
6
I-3321 + 48 a2
6
+ 4272 k
2
+ 8 a2
4
I-67 + 240 k
2
M + a2
2
I-2877 + 4976 k
2
MM - 8 a1
4
I48 a2
6
I-67 + 240 k
2
M + 8 a2
4
I-2679 + 10768 k
2
M +
a2
2
I-65289 + 174816 k
2
- 6400 k
4
M - 3 I22599 - 50080 k
2
+ 3840 k
4
MM +
a1
2
I896427 - 2345184 k
2
+ 354048 k
4
- 48 a2
6
I-2877 + 4976 k
2
M +
8 a2
4
I65289 - 174816 k
2
+ 6400 k
4
M + 3 a2
2
I337533 - 892192 k
2
+ 86272 k
4
MM +
3 Ia2
6
I53136 - 68352 k
2
M + 8 a2
4
I22599 - 50080 k
2
+ 3840 k
4
M +
3 I80919 - 235872 k
2
+ 45824 k
4
M + a2
2
I298809 - 781728 k
2
+ 118016 k
4
MMMM
II27 - 448 k
2
+ 256 k
4
+ 4 a1
2
I-113 + 48 k
2
MM I27 - 448 k
2
+ 256 k
4
+ 4 a2
2
I-113 + 48 k
2
MMM
2 Ex5-3.nb
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 125
Reduction to Birkhoff Normal Form
In[40]:= L/: L^(n_/;n>m):=0
In[41]:= m = 4;
Initially we consider the coefficients g[nu1,nu2,nu3,nu4] and h[nu1,nu2,nu3,nu4] as abstract quantities. Later, after
reducing to Birkhoff normal form, we will introduce the values calculated above.
In[42]:= hamK = Ha1 * q1 * p1 + a2 * q2 * p2L * L^2 +
Sum@If@nu1 + nu2 + nu3 + nu4 3, g@nu1, nu2, nu3, nu4D * q1^nu1 * q2^nu2 * p1^nu3 * p2^nu4,
0D, 8nu1, 0, 3<, 8nu2, 0, 3<, 8nu3, 0, 3<, 8nu4, 0, 3<D * L^3;
In[46]:= hamK3 = Sum@
If@nu1 + nu2 + nu3 + nu4 3, g@nu1, nu2, nu3, nu4D * q1^nu1 * q2^nu2 * p1^nu3 * p2^nu4, 0D,
8nu1, 0, 3<, 8nu2, 0, 3<, 8nu3, 0, 3<, 8nu4, 0, 3<D;
In[43]:= transform@h_, s_, w_D := Module@
8h1, h2, h3, w1, u1, u2, v1, v2, wu1, wu2, wy1, wy2, zu1, zu2, zy1, zy2<, h1 = ExpandAll@hD;
h2 = h1 . L^Hn_ ; n > Hm - s + 2LL 0;
h3 = h1 - h2;
h2 = h2 . 8q1 u1, q2 u2, p1 v1, p2 v2<;
w1 = ExpandAll@wD . 8q1 u1, q2 u2<;
zu1 = D@w1, u1D; zu2 = D@w1, u2D;
zy1 = D@w1, p1D; zy2 = D@w1, p2D;
subst@mon_D :=
ExpandAll@mon . 8u1 q1 - L^Hs - 2L * wy1, u2 q2 - L^Hs - 2L * wy2, v1 p1 + L^Hs - 2L * wu1,
v2 p2 + L^Hs - 2L * wu2<D . 8wu1 zu1, wu2 zu2, wy1 zy1, wy2 zy2<;
Collect@h3 + Map@FixedPoint@subst, D &, h2D, LDD
In[44]:= index@mon_D :=
ExpandAll@Ha1 * q1 * D@mon, q1D + a2 * q2 * D@mon, q2D - a1 * p1 * D@mon, p1D - a2 * p2 * D@mon, p2DL
monD . 8q1 0, q2 0, p1 0, p2 0<
In[53]:= w3 = If@index@D === 0, 0, - index@DD & hamK3
Out[53]=
p2
3
g@0, 0, 0, 3D
3 a2
-
p1 p2
2
g@0, 0, 1, 2D
-a1 - 2 a2
-
p1
2
p2 g@0, 0, 2, 1D
-2 a1 - a2
+
p1
3
g@0, 0, 3, 0D
3 a1
+
p2
2
q2 g@0, 1, 0, 2D
a2
+
p1 p2 q2 g@0, 1, 1, 1D
a1
-
p1
2
q2 g@0, 1, 2, 0D
-2 a1 + a2
-
p2 q2
2
g@0, 2, 0, 1D
a2
-
p1 q2
2
g@0, 2, 1, 0D
-a1 + 2 a2
-
q2
3
g@0, 3, 0, 0D
3 a2
-
p2
2
q1 g@1, 0, 0, 2D
a1 - 2 a2
+
p1 p2 q1 g@1, 0, 1, 1D
a2
+
p1
2
q1 g@1, 0, 2, 0D
a1
-
p2 q1 q2 g@1, 1, 0, 1D
a1
-
p1 q1 q2 g@1, 1, 1, 0D
a2
-
q1 q2
2
g@1, 2, 0, 0D
a1 + 2 a2
-
p2 q1
2
g@2, 0, 0, 1D
2 a1 - a2
-
p1 q1
2
g@2, 0, 1, 0D
a1
-
q1
2
q2 g@2, 1, 0, 0D
2 a1 + a2
-
q1
3
g@3, 0, 0, 0D
3 a1
In[54]:= reduce@mon_D := If@index@monD === 0, mon, 0D
In[55]:= reduce Htransform@hamK, 3, w3D . L 1L +
h@2, 0, 2, 0D q1^2 p1^2 + h@1, 1, 1, 1D q1 p1 q2 p2 + h@0, 2, 0, 2D q2^2 p2^2
Ex5-3.nb 3
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 126
Out[55]= a1 p1 q1 + a2 p2 q2 -
3 p2
2
q2
2
g@0, 1, 0, 2D g@0, 2, 0, 1D
a2
-
3 p2
2
q2
2
g@0, 0, 0, 3D g@0, 3, 0, 0D
a2
+
4 p1 p2 q1 q2 g@0, 2, 1, 0D g@1, 0, 0, 2D
a1 - 2 a2
-
4 p1 p2 q1 q2 g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1 + 2 a2
+
4 a1 p1 p2 q1 q2 g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1
2
+ 4 a1 a2 - 4 a2
2
-
8 a2 p1 p2 q1 q2 g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1
2
+ 4 a1 a2 - 4 a2
2
-
p2
2
q2
2
g@0, 2, 1, 0D g@1, 0, 0, 2D
a1 - 2 a2
+
p2
2
q2
2
g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1 + 2 a2
-
a1 p2
2
q2
2
g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1
2
+ 4 a1 a2 - 4 a2
2
+
2 a2 p2
2
q2
2
g@0, 2, 1, 0D g@1, 0, 0, 2D
-a1
2
+ 4 a1 a2 - 4 a2
2
-
2 p1 p2 q1 q2 g@0, 2, 0, 1D g@1, 0, 1, 1D
a2
-
p2
2
q2
2
g@0, 1, 1, 1D g@1, 1, 0, 1D
a1
-
2 p1 p2 q1 q2 g@1, 0, 2, 0D g@1, 1, 0, 1D
a1
-
2 p1 p2 q1 q2 g@0, 1, 0, 2D g@1, 1, 1, 0D
a2
-
p1
2
q1
2
g@1, 0, 1, 1D g@1, 1, 1, 0D
a2
+
4 p1 p2 q1 q2 g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1 - 2 a2
-
4 p1 p2 q1 q2 g@0, 0, 1, 2D g@1, 2, 0, 0D
a1 + 2 a2
-
4 a1 p1 p2 q1 q2 g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1
2
- 4 a1 a2 - 4 a2
2
-
8 a2 p1 p2 q1 q2 g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1
2
- 4 a1 a2 - 4 a2
2
+
p2
2
q2
2
g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1 - 2 a2
-
p2
2
q2
2
g@0, 0, 1, 2D g@1, 2, 0, 0D
a1 + 2 a2
-
a1 p2
2
q2
2
g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1
2
- 4 a1 a2 - 4 a2
2
-
2 a2 p2
2
q2
2
g@0, 0, 1, 2D g@1, 2, 0, 0D
-a1
2
- 4 a1 a2 - 4 a2
2
+
p1
2
q1
2
g@0, 1, 2, 0D g@2, 0, 0, 1D
2 a1 - a2
-
p1
2
q1
2
g@0, 1, 2, 0D g@2, 0, 0, 1D
-2 a1 + a2
+
2 a1 p1
2
q1
2
g@0, 1, 2, 0D g@2, 0, 0, 1D
-4 a1
2
+ 4 a1 a2 - a2
2
-
a2 p1
2
q1
2
g@0, 1, 2, 0D g@2, 0, 0, 1D
-4 a1
2
+ 4 a1 a2 - a2
2
-
4 p1 p2 q1 q2 g@0, 1, 2, 0D g@2, 0, 0, 1D
2 a1 - a2
+
4 p1 p2 q1 q2 g@0, 1, 2, 0D g@2, 0, 0, 1D
-2 a1 + a2
-
8 a1 p1 p2 q1 q2 g@0, 1, 2, 0D g@2, 0, 0, 1D
-4 a1
2
+ 4 a1 a2 - a2
2
+
4 a2 p1 p2 q1 q2 g@0, 1, 2, 0D g@2, 0, 0, 1D
-4 a1
2
+ 4 a1 a2 - a2
2
-
2 p1 p2 q1 q2 g@0, 1, 1, 1D g@2, 0, 1, 0D
a1
-
3 p1
2
q1
2
g@1, 0, 2, 0D g@2, 0, 1, 0D
a1
+
p1
2
q1
2
g@0, 0, 2, 1D g@2, 1, 0, 0D
-2 a1 - a2
-
p1
2
q1
2
g@0, 0, 2, 1D g@2, 1, 0, 0D
2 a1 + a2
-
2 a1 p1
2
q1
2
g@0, 0, 2, 1D g@2, 1, 0, 0D
-4 a1
2
- 4 a1 a2 - a2
2
-
a2 p1
2
q1
2
g@0, 0, 2, 1D g@2, 1, 0, 0D
-4 a1
2
- 4 a1 a2 - a2
2
+
4 p1 p2 q1 q2 g@0, 0, 2, 1D g@2, 1, 0, 0D
-2 a1 - a2
-
4 p1 p2 q1 q2 g@0, 0, 2, 1D g@2, 1, 0, 0D
2 a1 + a2
-
8 a1 p1 p2 q1 q2 g@0, 0, 2, 1D g@2, 1, 0, 0D
-4 a1
2
- 4 a1 a2 - a2
2
-
4 a2 p1 p2 q1 q2 g@0, 0, 2, 1D g@2, 1, 0, 0D
-4 a1
2
- 4 a1 a2 - a2
2
-
3 p1
2
q1
2
g@0, 0, 3, 0D g@3, 0, 0, 0D
a1
+
p2
2
q2
2
h@0, 2, 0, 2D + p1 p2 q1 q2 h@1, 1, 1, 1D + p1
2
q1
2
h@2, 0, 2, 0D
4 Ex5-3.nb
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 127
Collecting terms (with the help of functions Collectand Simplify), we can write the above expression for the
transformed Hamiltonian as
alpha Hp1 q1L^2 + beta Hp1 q1L Hp2 q2L + gamma Hp2 q2L^2
where
alpha := -
g@1, 0, 1, 1D g@1, 1, 1, 0D
a2
+
1
2 a1 - a2
g@0, 1, 2, 0D g@2, 0, 0, 1D -
3 g@1, 0, 2, 0D g@2, 0, 1, 0D
a1
-
g@0, 0, 2, 1D
g@2, 1, 0, 0D
2 a1 + a2
-
3 g@0, 0, 3, 0D g@3, 0, 0, 0D
a1
+ h@2, 0, 2, 0D
beta :=
4
a1 - 2 a2
g@0, 2, 1, 0D g@1, 0, 0, 2D -
2 g@0, 2, 0, 1D g@1, 0, 1, 1D
a2
-
2 g@1, 0, 2, 0D g@1, 1, 0, 1D
a1
-
2 g@0, 1, 0, 2D g@1, 1, 1, 0D
a2
-
4
a1 + 2 a2
g@0, 0, 1, 2D g@1, 2, 0, 0D -
4
2 a1 - a2
g@0, 1, 2, 0D g@2, 0, 0, 1D -
2 g@0, 1, 1, 1D g@2, 0, 1, 0D
a1
-
4
2 a1 + a2
g@0, 0, 2, 1D g@2, 1, 0, 0D + h@1, 1, 1, 1D
gamma := -
3 g@0, 1, 0, 2D g@0, 2, 0, 1D
a2
-
3 g@0, 0, 0, 3D g@0, 3, 0, 0D
a2
+
1
-a1 + 2 a2
g@0, 2, 1, 0D g@1, 0, 0, 2D -
g@0, 1, 1, 1D g@1, 1, 0, 1D
a1
+ -
1
a1 + 2 a2
g@0, 0, 1, 2D g@1, 2, 0, 0D + h@0, 2, 0, 2D
In terms of the actions J
k
= q
k
p
k
, k=1,2, the expansion of hamK takes the form
w
1
J
1
+ w
2
J
2
+ w
11
J
1
2
+ 2 w
12
J
1
J
2
+ w
22
J
2
2
For nonlinear stability, the following determinant should be nonzero:
det
2 w
11
2 w
12
w
1
2 w
21
2 w
22
w
2
w
1
w
2
0
In terms of alpha, beta, gamma, a1, a2, this is equivalent to the nonvanishing of
phi := alpha a2^2 - beta a1 a2 + gamma a1^2
To plot phi, we need to evaluate the coefficients:
g@nu1_, nu2_, nu3_, nu4_D := gval@nu12, nu2, nu3, nu4D;
h@nu1_, nu2_, nu3_, nu4_D := hval@nu12, nu2, nu3, nu4D;
a1 :=
1
2
-2 - -23 + 16 k
2
; a2 :=
1
2
-2 + -23 + 16 k
2
;
Ex5-3.nb 5
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 128
Plot@phi, 8k, Sqrt@23 16D, Sqrt@27 16D<D
1.22 1.24 1.26 1.28 1.3
-100
100
200
Graphics
6 Ex5-3.nb
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 129
Exercise 5.4 Poincar Sections of the Forced Pendulum
To integrate the differential equations of the forced simple pendulum,
we can use the usual
In[8]:= RK4step[z_]:= (k1=f[z]*dt;
k2=f[z+k1/2]*dt;
k3=f[z+k2/2]*dt;
k4=f[z+k3]*dt;
z+(k1+2*k2+2*k3+k4)/6)
with
In[9]:= f[{x_,p_,phi_}]:=
{p,-g*(1+a*Sin[phi])Sin[x],omega}
In[10]:= n=200; a=.1; g=1.0; dt=2.0 Pi/(omega*n); omega=3.0;
The system is described by the time-dependent Hamiltonian
H(x, p, t)=
1
2
p
2
- g (1+a sin(Wt)) cos x
In the following program, we fix the forcing amplitude at a = 0.01 and the time step at dt = 2p/(200W), and follow 12
orbits for 500 forcing periods (200 x 500 = 100000 time steps). The (x,p) coordinates are calculated using 4th-order
integration. They are recorded for each orbit, forcing period, and phase in the 3-dimensional array pts. Once all
1200000 points have been stored, they can be sorted according to initial condition to obtain the 12 separate orbits, or
according to phase to obtain 200 different Poincar sections. The latter can be displayed rapidly to give an animated
view of how the Poincar section evolves in time (it has the same temporal period as the forcing).
Generating the data array
In[11]:= pts=Table[{0,0},{i,1,12},{j,1,500},{k,1,n}];
In[12]:= z0list = 880, .3, 0<, 80, .6, 0<, 80, .9, 0<, 80, 1.2, 0<, 80, 1.5, 0<, 80, 1.8, 0<,
80, 2.1, 0<, 80, 2.4, 0<, 80, 2.7, 0<, 80, -2.7, 0<, 80, -2.4, 0<, 80, -2.1, 0<<;
In[13]:= For@i = 1, i 12, i++, z = z0list@@iDD;
For@j = 1, j 500, j++,
For@k = 1, k <= n, k++,
pts@@i, j, kDD = 8z@@1DD, z@@2DD<;
z = RK4step@zD;
z@@1DD = Mod@z@@1DD + N@PiD, N@2 PiDD - N@PiD;
z@@3DD = Mod@z@@3DD, N@2 PiDDDDD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 130
Twelve orbits
In[15]:= For@i = 1, i 12, i++,
orbit@iD = Table@pts@@i, j, kDD, 8j, 1, 100<, 8k, 1, 200<D;
gr@iD = ListPlot@orbit@iD, AspectRatio 1,
PlotStyle PointSize@.002D, PlotRange 88-N@PiD, N@PiD<, 8-N@PiD, N@PiD<<DD;
GraphicsGrid@88gr@1D, gr@2D, gr@3D<, 8gr@4D, gr@5D, gr@6D<,
8gr@7D, gr@8D, gr@9D<, 8gr@10D, gr@11D, gr@12D<<, Frame AllD
Out[16]=
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 131
200 Poincar sections, animated
In[17]:= For@k = 1, k <= n, k++, poincare@kD = Table@pts@@i, j, kDD, 8i, 1, 12<, 8j, 1, 500<DD;
Animate[
ListPlot[poincare[k],AspectRatio->1,PlotStyle->{Black,PointSize[.002]},
PlotRange->{{-N[Pi],N[Pi]},{-N[Pi],N[Pi]}}],{k,1,n,1}]
k
-3 -2 -1 1 2 3
-3
-2
-1
1
2
3
Chaos, 6000 points
Here we concentrate on a single long chaotic orbit over 6000 forcing periods (1200000 time steps). Note the mixing
action near the origin.
In[18]:= pts1=Table[{0,0},{j,1,6000},{k,1,n}];
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 132
In[19]:= z = 80, 2.1, 0<;
For@j = 1, j 6000, j++,
For@k = 1, k <= n, k++,
pts1@@j, kDD = 8z@@1DD, z@@2DD<;
z = RK4step@zD;
z@@1DD = Mod@z@@1DD + N@PiD, N@2 PiDD - N@PiD;
z@@3DD = Mod@z@@3DD, N@2 PiDDDD
In[21]:= For@k = 1, k <= n, k++, poincare1@kD = Table@pts1@@j, kDD, 8j, 1, 6000<DD;
Animate[
ListPlot[poincare1[k],AspectRatio->1,PlotStyle->{Black,PointSize[.001]},
PlotRange->{{-N[Pi],N[Pi]},{-N[Pi],N[Pi]}}],{k,1,n,1}]
k
-3 -2 -1 1 2 3
-3
-2
-1
1
2
3
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 133
Exercise 5.5 Stochastic web map
(a) Effective Hamiltonian for small parameter
wmap@8x_, y_<D := 8y + a * Sin@xD, -x<
wmap4@z_D := Nest@wmap, z, 4D
Series@wmap4@8 x, y<D, 8a, 0, 1<D
9x - 2 Sin@yD a + O@aD
2
, y + 2 Sin@xD a + O@aD
2
=
To first order in a, this is just a Hamiltonian flow with Hamiltonian
H
eff
(x,y) = 2 (cos x + cos y) , with time step a .
(b,c) Stable and unstable fixed points
The fixed points of the Hamiltonian flow occur when sin x = sin y = 0 , i.e. at (m , n p), where m and n are integers.
Such a fixed point is stable (a maximum or minimum of H
eff
) if m and n are both even or both odd. The fixed point
is unstable (a saddle point of H
eff
) if m is even and n is odd, or vice versa.
The action of W on any of the points (m , n p) is a pure rotation by
p
2
; hence the action of W
4
is the identity, i.e. they
are also fixed points of the 4th iterate map. To study their stability, we study the linearized map. This corresponds to
a matrix equal to the right-to-left product of the Jacobian matrices of the 4 points on the periodic W orbit:
(x,y) = (m , n p), m, n even
DW4 = Expand@88a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<D
991 - 3 a
2
+ a
4
, -2 a + a
3
=, 92 a - a
3
, 1 - a
2
==
Eigenvalues@DW4D
:
1
2
2 - 4 a
2
+ a
4
- a -4 + a
2
I-2 + a
2
M ,
1
2
2 - 4 a
2
+ a
4
+ a -4 + a
2
I-2 + a
2
M >
For a<2, these are complex numbers lying on the unit circle, and so the fixed point is stable. For a>2, the eigenvalues
are real and the fixed point is a saddle. At the bifurcation point a=2, the eigenvalues are both equal to 1.
(x,y) = (m , n p), m, n odd
DW4 = Expand@88-a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<D
991 - 3 a
2
+ a
4
, 2 a - a
3
=, 9-2 a + a
3
, 1 - a
2
==
Eigenvalues@DW4D
:
1
2
2 - 4 a
2
+ a
4
- a -4 + a
2
I-2 + a
2
M ,
1
2
2 - 4 a
2
+ a
4
+ a -4 + a
2
I-2 + a
2
M >
Same story as for m, n even.
(x,y) = (m , n p), m even, n odd
DW4 = Expand@88-a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<D
991 + 3 a
2
+ a
4
, 2 a + a
3
=, 92 a + a
3
, 1 + a
2
==
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 134
Eigenvalues@DW4D
:
1
2
2 + 4 a
2
+ a
4
- a I2 + a
2
M 4 + a
2
,
1
2
2 + 4 a
2
+ a
4
+ a I2 + a
2
M 4 + a
2
>
Both eigenvalues are real, with product = 1. The first eigenvalue is less than 1, the second greater than 1. It is a saddle
point with contraction along the first eigendirection, expansion along the second.
Eigenvectors@DW4D
::
1
2
a - 4 + a
2
, 1>, :
1
2
a + 4 + a
2
, 1>>
(x,y) = (m , n p), m odd, n even
DW4 = Expand@88a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<.88a, 1<, 8-1, 0<<.88-a, 1<, 8-1, 0<<D
991 + 3 a
2
+ a
4
, -2 a - a
3
=, 9-2 a - a
3
, 1 + a
2
==
Eigenvalues@DW4D
:
1
2
2 + 4 a
2
+ a
4
- a I2 + a
2
M 4 + a
2
,
1
2
2 + 4 a
2
+ a
4
+ a I2 + a
2
M 4 + a
2
>
Again both eigenvalues are real, with product = 1. The first eigenvalue is less than 1, the second greater than 1. It is a
saddle point with contraction along the first eigendirection, expansion along the second.
Eigenvectors@DW4D
::
1
2
-a + 4 + a
2
, 1>, :
1
2
-a - 4 + a
2
, 1>>
(d) Construction of the unstable manifold at (p,0)
a = 0.8; eplus = 8-a - Sqrt@4 + a^2D, 2<
8-2.95407, 2<
pts0 = Table@8N@PiD, 0< + n * eplus 10000000, 8n, 1, 10000<D;
ListPlot@pts0, AspectRatio Automatic, PlotStyle 8Black, PointSize@.002D<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 135
pts = pts0; umfld = pts0;
For@k = 1, k 9, k++,
pts = wmap4@D & pts;
umfld = Join@umfld, ptsDD;
ListPlot@umfld, AspectRatio Automatic, PlotStyle 8Black, PointSize@.002D<D
Show@%, PlotRange 88-.1, .1<, 8N@PiD - .1, N@PiD + .1<<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 136
Exercise 5.6 Stochastic webs
Web map and its 4th iterate
f@8u_, v_<D := 8v, -u - a Sin@vD<
f4@z_D := Nest@f, z, 4D
pi = N@PiD;
a = 0.8;
z = 8pi, .0000001<;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 137
Variable initial condition (machine precision)
z = 8pi, .00000011<;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
z = 8pi, .000000101<;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 138
z = 8pi, .0000001001<;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
z = 8pi, .00000010001<;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
Variable precision
set@n_D := SetPrecision@n, precD
prec = 20;
$MinPrecision = prec;
a = set@4 5D;
z = set@8Pi, 10^H-7L<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 139
z = set@8Pi, 10^H-7L<D;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
prec = 40;
$MinPrecision = prec;
a = set@4 5D;
z = set@8Pi, 10^H-7L<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 140
z = set@8pi, 10^H-7L<D;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
prec = 100;
$MinPrecision = prec;
a = set@4 5D;
z = set@8Pi, 10^H-7L<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 141
z = set@8pi, 10^H-7L<D;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
prec = 200;
$MinPrecision = prec;
a = set@4 5D;
z = set@8Pi, 10^H-7L<D;
z = set@8pi, 10^H-7L<D;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
prec = 500;
$MinPrecision = prec;
a = set@4 5D;
z = set@8Pi, 10^H-7L<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 142
z = set@8pi, 10^H-7L<D;
tbl = Table@z = f4@zD, 8100000<D;
ListPlot@tbl, PlotStyle 8Black, PointSize@.001D<, AspectRatio AutomaticD
Conclusion
This is a chaotic orbit with extreme sensitivity to both choice of initial condition and to
numerical precision.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 143
Exercise 5.7 Folded web map phase portraits
Web map and its 4th iterate
f@8u_, v_<D := 8v, -u - a Sin@vD<
f4@z_D := Nest@f, z, 4D
pi = N@PiD;
a = 0.8;
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
a = 0.1;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 144
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
a = 0.5;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 145
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
a = 1.0;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 146
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
a = 2.0;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 147
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
a = 6.0;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 148
z = 8pi, .000001<; tbl@0D = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 850000<D;
g@0D = ListPlot@tbl@0D, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1D;
For@n = 1, n 19, n++,
z = 8pi, n * pi 20<;
tbl@nD = Table@z = f4@zD; 8Mod@z@@1DD, 2 piD, Mod@z@@2DD, 2 piD<, 820000<D;
g@nD = ListPlot@tbl@nD, PlotStyle 8Black, PointSize@.001D<,
PlotRange 880, 2 pi<, 80, 2 pi<<, AspectRatio 1DD;
Show@Table@g@nD, 8n, 0, 19<DD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 149
Exercise 5.8 Orbits and Poincar Sections of the Forced
Duffing Oscillator
To integrate the differential equations of the forced Duffing oscillator,
we can use the usual
RK4step[z_]:= (k1=f[z]*dt;
k2=f[z+k1/2]*dt;
k3=f[z+k2/2]*dt;
k4=f[z+k3]*dt;
z+(k1+2*k2+2*k3+k4)/6)
with
f[{x_,p_,phi_}]:=
{p,x - x^3 -b*p + a*Cos[phi],1}
n=200; a=.1; b=0; dt=2.0 Pi/n;
The choice b=0 restricts us to the non-dissipative case, described by the time-dependent Hamiltonian
H(x, p, t)=
1
2
p
2
-
1
2
x
2
+
1
4
x
4
- a x cos t .
In the following program, we fix the forcing amplitude at a = 0.1 and the time step at dt = p/100, and follow 12 orbits
for 500 forcing periods (200 x 500 = 100000 time steps). The (x,p) coordinates are calculated using 4th-order integra-
tion. They are recorded for each orbit, forcing period, and phase in the 3-dimensional array pts. Once all 1200000
points have been stored, they can be sorted according to initial condition to obtain the 12 separate orbits, or according
to phase to obtain 200 different Poincar sections. The latter can be displayed rapidly to give an animated view of how
the Poincar section evolves in time (it has the same temporal period as the forcing).
Generating the data array
pts=Table[{0,0},{i,1,12},{j,1,500},{k,1,n}];
z0list = 880, 0.5, 0<, 80, 0.2, 0<, 8-1.1, 0, 0<, 8-0.9, 0, 0<, 8-0.8, 0, 0<, 8-0.7, 0, 0<,
81.1, 0, 0<, 81.2, 0, 0<, 81.3, 0, 0<, 81.8, 0, 0<, 81.9, 0, 0<, 81.95, 0, 0<<;
For@i = 1, i 12, i++, z = z0list@@iDD;
Print@"Calculating orbit ", i , "."D;
For@j = 1, j 500, j++,
For@k = 1, k <= n, k++,
pts@@i, j, kDD = 8z@@1DD, z@@2DD<;
z = RK4step@zD; z@@3DD = Mod@z@@3DD, N@2 PiDDDDD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 150
Twelve orbits
For@i = 1, i 12, i++,
orbit@iD = Table@pts@@i, j, kDD, 8j, 1, 100<, 8k, 1, 200<D;
gr@iD = ListPlot@orbit@iD, AspectRatio 1,
PlotStyle Thickness@.002D, Joined True, PlotRange 88-2, 2<, 8-2, 2<<DD;
GraphicsGrid@88gr@1D, gr@2D, gr@3D<, 8gr@4D, gr@5D, gr@6D<,
8gr@7D, gr@8D, gr@9D<, 8gr@10D, gr@11D, gr@12D<<D
For@k = 1, k <= n, k++, poincare@kD = Table@pts@@i, j, kDD, 8i, 1, 12<, 8j, 1, 500<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 151
Animate[
ListPlot[poincare[k],AspectRatio->1,PlotStyle->{Black,PointSize[.005]},
PlotRange->{{-2,2},{-2,2}}],{k,1,n,1}]
Chaos, 6000 points
Here we concentrate on a single long chaotic orbit over 6000 forcing periods (1200000 time steps). Note the mixing
action near the origin.
pts1=Table[{0,0},{j,1,6000},{k,1,n}];
z = 80, .5, 0<;
For@j = 1, j 6000, j++,
For@k = 1, k <= n, k++,
pts1@@j, kDD = 8z@@1DD, z@@2DD<;
z = RK4step@zD; z@@3DD = Mod@z@@3DD, N@2 PiDDDD
For@k = 1, k <= n, k++, poincare1@kD = Table@pts1@@j, kDD, 8j, 1, 6000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 152
Animate[
ListPlot[poincare1[k],AspectRatio->1,PlotStyle->{Black,PointSize[.002]},
PlotRange->{{-2,2},{-2,2}}],{k,1,n,1}]
Island chain, 6000 points
Here we concentrate on a single long quasiperiodic orbit, living on a chain of islands, over 6000 forcing periods
(1200000 time steps).
pts2=Table[{0,0},{j,1,6000},{k,1,n}];
z = 81.9, 0, 0<;
For@j = 1, j 6000, j++,
For@k = 1, k <= n, k++,
pts2@@j, kDD = 8z@@1DD, z@@2DD<;
z = RK4step@zD; z@@3DD = Mod@z@@3DD, N@2 PiDDDD
For@k = 1, k <= n, k++, poincare2@kD = Table@pts2@@j, kDD, 8j, 1, 6000<DD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 153
Animate[
ListPlot[poincare2[k],AspectRatio->1,PlotStyle->{Black,PointSize[.001]},
PlotRange->{{-2,2},{-2,2}}],{k,1,n,1}]
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 5 154
Chapter 6 The swing-spring
CONTENTS
6.1 2D swing-spring Poincare sections (M) 156
6.2 Birkho-Gustavson perturbation expansion (M) 164
6.3 Hamiltonian of an integrable swing-spring model (M) 169
6.4 Independence of the swing-spring integrals (L) 170
6.5 Formulas for
4
and
5
(L) 171
6.6 Poisson bracket [
k
,
4
] (L) 172
6.7 Bifurcation point (L) 173
6.8 Plotting the function f(
3
) (M) 174
6.9 Derivation of EHD equation (6.28) (L) 175
6.10 Properties of boundary curves of the EM manifold (L) 176
6.11 Angular shifts, curve (M) 177
6.12 Angular shifts, curves , , (M) 182
6.13 Polar angle in the quasi-laboratory frame (L) 188
6.14 Swing-plane shift viewed in the Q, P frame (M) 189
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 155
Exercise 6.1 2D Swing-Spring Poincar Sections
Hamiltonian
H= (1/2) (p1^2 + p2^2)+U;
U= x2+2(3/4-Sqrt[x1^2+(x2-1)^2])^2;
ContourPlot[U,{x1,-1.5,1.5},{x2,-.8,2.2},PlotPoints->40,
Contours->30,ContourShading->False,ContourStyle->Black]
Righthand side of Hamilton's equations of motion
f@8x1_, x2_, p1_, p2_<D :=
8p1, p2, x1 H3 Hx1^2 + Hx2 - 1L^2L^H-1 2L - 4L, Hx2 - 1L H3 Hx1^2 + Hx2 - 1L^2L^H-1 2L - 4L - 1<
Runge-Kutta integration of ODE's
rungeKutta[f_,xi0_,h_,steps_]:=
NestList[rKStep[f,#,h]&,xi0,steps]
Notation: xi =(x1,x2,p1,p2)
Notation: xi0=initial point in phase space, h= time step, steps=number of steps.
rKStep[f_,xi_,h_]:=
Module[{k1,k2,k3,k4},
k1=h f[xi];
k2=h f[xi+k1/2];
k3=h f[xi+k2/2];
k4=h f[xi+k3];
xi+(k1+2 k2+2 k3+k4)/6
]
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 156
Poincar map
poincareMap[f_,xi0_,h_,sectionFcn_,sectionRes_]:=
Module[{xi1,xi2,s1=0,s2,k},
xi2=rKStep[f,xi0,h];s2=sectionFcn[xi2];
While[s1>=0 || s2<0,
xi1=xi2;
s1=s2;
xi2=rKStep[f,xi1,h];
s2=sectionFcn[xi2];
];
k=h;
While[s2>=sectionRes || s2< -sectionRes,
k*=s2/(s1-s2);
xi2=rKStep[f,xi2,k];
s1=s2;
s2=sectionFcn[xi2];
];
xi2
]


Note: The equation sectionFcn[xi]==0 specifies the 3-dimensional hyperplane to be used for the Poincar
section.
Note: The function poincareMap iterates the dynamical map, starting at an arbitrary phase-space point xi0,
and outputting the next point on the orbit for which sectionFcn vanishes, changing from negative to positive,
with an error bounded by sectionRes.
Note: This function uses the secant method of rootfinding to home in on the surface of section with desired resolu-
tion.
poincareList[f_,xi0_,h_,sectionFcn_,sectionRes_,points_]:=
Module[{xi=xi0},Table[xi=poincareMap[f,xi,h,sectionFcn,sectionRes],{points}]]
section[xi_]:=xi[[1]]; (*** selects hyperplane x1==0 ***)

collapse[xi_]:= {xi[[2]],xi[[4]]}; (*** 2D projection ***)
p1calc@x2_, p2_, h_D := NSqrt@2 h - p2^2 - 2 x2 - 4 H3 4 - Abs@1 - x2DL^2D
E=4
The surface p1=0
h = 4.125;
p2plus@x1_, x2_D := Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
p2minus@x1_, x2_D := -Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 157
Plot3D@8p2plus@x1, x2D, p2minus@x1, x2D<, 8x1, -2, 2.5<, 8x2, -2, 2.5<, PlotPoints 40,
ColorFunction Function@8x, y, z<, GrayScale@zDD, Axes False, Boxed FalseD
Contour plot of the potential energy
ContourPlot@2 h - p2^2 - 2 x2 - 4 H3 4 - Abs@1 - x2DL^2,
8x2, -2, 3<, 8p2, -3.5, 3.5<, PlotRange 80, 10<D
Poincar section orbit
xi0 = 80, 0.5, p1calc@0.5, 1.2, hD, 1.2<;
g1 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 10000DD,
PlotStyle 8Black, PointSize@.002D<D
xi0 = 80, 0.5, p1calc@0.5, .5, hD, .5<;
g2 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 158
xi0 = 80, 1.7, p1calc@1.7, 1, hD, 1<;
g3 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, -.6, p1calc@-.6, 1, hD, 1<;
g4 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, 1.3, p1calc@1.3, 0, hD, 0<;
g5 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, -.3, p1calc@-.3, 0, hD, 0<;
g6 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, .5, p1calc@.5, 1, hD, 1<;
g7 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 10000DD,
PlotStyle -> 8Black, PointSize@.002D<D
Show@g1, g2, g3, g4, g5, g6, g7, Axes False, Frame TrueD
E=1.5
The surface p1=0
h = 1.625;
p2plus@x1_, x2_D := Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
p2minus@x1_, x2_D := -Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 159
Plot3D@8p2plus@x1, x2D, p2minus@x1, x2D<, 8x1, -2, 2.5<, 8x2, -2, 2.5<, PlotPoints 40,
ColorFunction Function@8x, y, z<, GrayScale@zDD, Axes False, Boxed FalseD
Contour plot of the potential energy
ContourPlot@2 h - p2^2 - 2 x2 - 4 H3 4 - Abs@1 - x2DL^2,
8x2, -1, 1<, 8p2, -2.5, 2<, PlotRange 80, 5<D
Poincar section orbit
xi0 = 80, 0.5, p1calc@0.5, .9, hD, .9<;
g1 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, 0.5, p1calc@0.5, 1.2, hD, 1.2<;
g2 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 10000DD,
PlotStyle -> 8Black, PointSize@.002D<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 160
xi0 = 80, -.8, p1calc@-.8, .1, hD, .1<;
g3 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, -.7, p1calc@-.7, 0, hD, 0<;
g4 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, .5, p1calc@.5, 0, hD, 0<;
g5 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
Show@g1, g2, g3, g4, g5, Axes False, Frame True, PlotRange AllD
E=0.5
The surface p1=0
h = 0.625;
p2plus@x1_, x2_D := Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
p2minus@x1_, x2_D := -Sqrt@2 h - 2 x2 - 4 H3 4 - Sqrt@x1^2 + Hx2 - 1L^2DL^2D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 161
Plot3D@8p2plus@x1, x2D, p2minus@x1, x2D<, 8x1, -2, 2.5<, 8x2, -2, 2.5<, PlotPoints 40,
ColorFunction Function@8x, y, z<, GrayScale@zDD, Axes False, Boxed FalseD
Contour plot of the potential energy
ContourPlot@2 h - p2^2 - 2 x2 - 4 H3 4 - Abs@1 - x2DL^2,
8x2, -.6, .6<, 8p2, -1.2, 1.2<, PlotRange 80, 1<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 162
Poincar section orbit
xi0 = 80, 0, p1calc@0, .5, hD, .5<;
g1 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 10000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, 0.2, p1calc@0.2, 0.7, hD, 0.7<;
g2 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 5000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, -.2, p1calc@-.2, .7, hD, .7<;
g3 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, -.25, p1calc@-.25, 0, hD, 0<;
g4 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
xi0 = 80, .2, p1calc@.2, 0, hD, 0<;
g5 = ListPlot@Map@collapse, poincareList@f, xi0, .01, section, 10^H-12L, 1000DD,
PlotStyle -> 8Black, PointSize@.002D<D
Show@g1, g2, g3, g4, g5, Axes False, Frame True, PlotRange AllD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 163
Exercise 6.2 Birkhoff-Gustavson perturbation theory of the
swing-spring
Perturbative cut-off
L/: L^(n_/;n>m):=0
m=4;
Canonical Transformations
Given a generating function w which is a homogeneous
polynomial of degree s in the variables x1,x2,x3,y1,
y2,y3 the function transform[] performs the canonical
transformation generated by w on an arbitrary
polynomial h . Due to the condition on L , all
monomials of degree greater than m are deleted. The
function body is designed to throw away the unwanted
terms as frequently as possible, to avoid wasteful
and time-consuming algebra.
transform[h_,s_,w_]:=
Module[{h1,h2,h3,w1,u1,u2,u3,v1,v2,v3,
wu1,wu2,wu3,wy1,wy2,wy3,
zu1,zu2,zu3,zy1,zy2,zy3},
h1=ExpandAll[h];
h2=h1/.L^(n_/;n>(m-s+2))->0;
h3=h1-h2;
h2=h2/.{x1->u1,x2->u2,x3->u3,
y1->v1,y2->v2,y3->v3};
w1=ExpandAll[w]/.{x1->u1,x2->u2,x3->u3};
zu1=D[w1,u1]; zu2=D[w1,u2]; zu3=D[w1,u3];
zy1=D[w1,y1]; zy2=D[w1,y2]; zy3=D[w1,y3];
subst[mon_]:=
ExpandAll[mon/.
{u1 -> x1 - L^(s-2)*wy1,
u2 -> x2 - L^(s-2)*wy2,
u3 -> x3 - L^(s-2)*wy3,
v1 -> y1 + L^(s-2)*wu1,
v2 -> y2 + L^(s-2)*wu2,
v3 -> y3 + L^(s-2)*wu3}
]/.{wu1 -> zu1,wu2 -> zu2,wu3->zu3,
wy1 -> zy1,wy2 -> zy2,wy3->zy3};
Collect[h3 +
Map[FixedPoint[subst,#]& ,h2], L]
]
Construction of the Generating Function
The function wcalc[h,s] constructs a homogeneous
polynomial of degree s which generates a canonical
transformation which annihilates those terms of
degree s in the polynomial h which violate the
condition Dh=0.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 164
index[mon_]:= Together[q1*D[mon,q1] + q2*D[mon,q2] +2*q3*D[mon,q3] -
p1*D[mon,p1] - p2*D[mon,p2] -2*p3*D[mon,p3]]/mon/.
{q1->0,q2->0,q3->0,p1->0,p2->0,p3->0}
invD[mon_]:= If[index[mon]==0, 0 ,
I*mon/index[mon]]
complexify@h_D := Collect@ExpandAll@
h . 8x1 q1 + I * p1, x2 q2 + I * p2, x3 q3 + I * p3,
y1 p1 + I * q1, y2 p2 + I * q2, y3 p3 + I * q3, L L Sqrt@2D<D, LD
decomplexify@h_D :=
Collect@ExpandAll@h . 8q1 x1 - I * y1, q2 x2 - I * y2, q3 x3 - I * y3,
p1 y1 - I * x1, p2 y2 - I * x2, p3 y3 - I * x3, L L Sqrt@2D<D, LD
wcalc[h_,s_]:=
Module[{h1},
h1=ExpandAll[h]/.L^(n_/;n!=s)->0;
h1=complexify[h1];
h1=Map[invD,ExpandAll[h1]];
h1=decomplexify[h1];
ExpandAll[h1]/.L->1]
ham0 = Normal@
Series@HHpx^2 + py^2 + pz^2L 2 - 1 8 + z + 2 * H3 4 - Sqrt@x^2 + y^2 + Hz - 1L^2DL^2L .
8x L * x, y L * y, z L * z, px L * px, py L * py, pz L * pz<,
8L,
0,
m<DD
-
3
2
L
3
Ix
2
z + y
2
zM +
1
2
L
2
Ipx
2
+ py
2
+ pz
2
+ x
2
+ y
2
+ 4 z
2
M +
3
8
L
4
Ix
4
+ 2 x
2
y
2
+ y
4
- 4 x
2
z
2
- 4 y
2
z
2
M
ham = Collect@
ExpandAll@ham0 .
8x x1 + y2, y x2 + y1, z x3, px y1 - x2, py y2 - x1, pz 2 * y3, L L Sqrt@2D<D, LD
L
3
-
3 x1
2
x3
4 2
-
3 x2
2
x3
4 2
-
3 x2 x3 y1
2 2
-
3 x3 y1
2
4 2
-
3 x1 x3 y2
2 2
-
3 x3 y2
2
4 2
+
L
4
3 x1
4
32
+
3 x1
2
x2
2
16
+
3 x2
4
32
-
3 x1
2
x3
2
8
-
3 x2
2
x3
2
8
+
3
8
x1
2
x2 y1 +
3 x2
3
y1
8
-
3
4
x2 x3
2
y1 +
3 x1
2
y1
2
16
+
9 x2
2
y1
2
16
-
3 x3
2
y1
2
8
+
3 x2 y1
3
8
+
3 y1
4
32
+
3 x1
3
y2
8
+
3
8
x1 x2
2
y2 -
3
4
x1 x3
2
y2 +
3
4
x1 x2 y1 y2 +
3
8
x1 y1
2
y2 +
9 x1
2
y2
2
16
+
3 x2
2
y2
2
16
-
3 x3
2
y2
2
8
+
3
8
x2 y1 y2
2
+
3 y1
2
y2
2
16
+
3 x1 y2
3
8
+
3 y2
4
32
+
L
2
x1
2
2
+
x2
2
2
+ x3
2
+
y1
2
2
+
y2
2
2
+ y3
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 165
Cubic Hamiltonian
H3 = J3 x3 J4 2 NN
ExpandBJ4 2 N H3 x3L * -
3 x1
2
x3
4 2
-
3 x2
2
x3
4 2
-
3 x2 x3 y1
2 2
-
3 x3 y1
2
4 2
-
3 x1 x3 y2
2 2
-
3 x3 y2
2
4 2
F
3 x3 I-x1
2
- x2
2
- 2 x2 y1 - y1
2
- 2 x1 y2 - y2
2
M
4 2
Cubic generating function (EHD:6.3)
w3 = wcalc@ham, 3D
3 x1 x2 x3
16 2
-
3 x3 y1 y2
16 2
-
3 x1
2
y3
8 2
-
3 x2
2
y3
8 2
-
3 x2 y1 y3
16 2
-
3 y1
2
y3
8 2
-
3 x1 y2 y3
16 2
-
3 y2
2
y3
8 2
Transformed Hamiltonian
ham3 = transform@ham, 3, w3D
L
3
-
3 x2 x3 y1
4 2
-
3 x1 x3 y2
4 2
+
3 x1 x2 y3
4 2
-
3 y1 y2 y3
4 2
+ L
2
x1
2
2
+
x2
2
2
+ x3
2
+
y1
2
2
+
y2
2
2
+ y3
2
+
L
4
3 x1
4
128
+
33 x1
2
x2
2
512
+
3 x2
4
128
-
519 x1
2
x3
2
1024
-
519 x2
2
x3
2
1024
+
21
128
x1
2
x2 y1 +
21 x2
3
y1
128
-
57
64
x2 x3
2
y1 +
3 x1
2
y1
2
64
+
171 x2
2
y1
2
512
-
465 x3
2
y1
2
1024
+
21 x2 y1
3
128
+
3 y1
4
128
+
21 x1
3
y2
128
+
21
128
x1 x2
2
y2 -
57
64
x1 x3
2
y2 +
69
128
x1 x2 y1 y2 +
21
128
x1 y1
2
y2 +
171 x1
2
y2
2
512
+
3 x2
2
y2
2
64
-
465 x3
2
y2
2
1024
+
21
128
x2 y1 y2
2
+
33 y1
2
y2
2
512
+
21 x1 y2
3
128
+
3 y2
4
128
+
63
64
x1 x2 x3 y3 +
171
256
x1 x3 y1 y3 +
171
256
x2 x3 y2 y3 -
27
64
x3 y1 y2 y3 +
207 x1
2
y3
2
1024
+
207 x2
2
y3
2
1024
+
9
32
x2 y1 y3
2
-
135 y1
2
y3
2
1024
+
9
32
x1 y2 y3
2
-
135 y2
2
y3
2
1024
Quartic generating function (EHD:6.10)
w4 = wcalc@ham3, 4D
-
21 x1
3
x2
256
-
21 x1 x2
3
256
-
25
256
x1 x2 x3
2
-
69 x1 x2
2
y1
1024
-
9 x1 x3
2
y1
1024
-
21
256
x1 x2 y1
2
-
69 x1
2
x2 y2
1024
-
9 x2 x3
2
y2
1024
+
21
256
x1
2
y1 y2 +
21
256
x2
2
y1 y2 +
7
256
x3
2
y1 y2 +
69 x2 y1
2
y2
1024
+
21 y1
3
y2
256
-
21
256
x1 x2 y2
2
+
69 x1 y1 y2
2
1024
+
21 y1 y2
3
256
-
141 x1
2
x3 y3
1024
-
141 x2
2
x3 y3
1024
-
65
128
x2 x3 y1 y3 -
123 x3 y1
2
y3
1024
-
65
128
x1 x3 y2 y3 -
123 x3 y2
2
y3
1024
+
103
256
x1 x2 y3
2
+
153 x1 y1 y3
2
1024
+
153 x2 y2 y3
2
1024
-
85
256
y1 y2 y3
2
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 166
Transformed Hamiltonian
ham3 = transform@ham, 3, w3D
L
3
-
3 x2 x3 y1
4 2
-
3 x1 x3 y2
4 2
+
3 x1 x2 y3
4 2
-
3 y1 y2 y3
4 2
+ L
2
x1
2
2
+
x2
2
2
+ x3
2
+
y1
2
2
+
y2
2
2
+ y3
2
+
L
4
3 x1
4
128
+
33 x1
2
x2
2
512
+
3 x2
4
128
-
519 x1
2
x3
2
1024
-
519 x2
2
x3
2
1024
+
21
128
x1
2
x2 y1 +
21 x2
3
y1
128
-
57
64
x2 x3
2
y1 +
3 x1
2
y1
2
64
+
171 x2
2
y1
2
512
-
465 x3
2
y1
2
1024
+
21 x2 y1
3
128
+
3 y1
4
128
+
21 x1
3
y2
128
+
21
128
x1 x2
2
y2 -
57
64
x1 x3
2
y2 +
69
128
x1 x2 y1 y2 +
21
128
x1 y1
2
y2 +
171 x1
2
y2
2
512
+
3 x2
2
y2
2
64
-
465 x3
2
y2
2
1024
+
21
128
x2 y1 y2
2
+
33 y1
2
y2
2
512
+
21 x1 y2
3
128
+
3 y2
4
128
+
63
64
x1 x2 x3 y3 +
171
256
x1 x3 y1 y3 +
171
256
x2 x3 y2 y3 -
27
64
x3 y1 y2 y3 +
207 x1
2
y3
2
1024
+
207 x2
2
y3
2
1024
+
9
32
x2 y1 y3
2
-
135 y1
2
y3
2
1024
+
9
32
x1 y2 y3
2
-
135 y2
2
y3
2
1024
Quartic generating function (EHD:6.10)
w4 = wcalc@ham3, 4D
-
21 x1
3
x2
256
-
21 x1 x2
3
256
-
25
256
x1 x2 x3
2
-
69 x1 x2
2
y1
1024
-
9 x1 x3
2
y1
1024
-
21
256
x1 x2 y1
2
-
69 x1
2
x2 y2
1024
-
9 x2 x3
2
y2
1024
+
21
256
x1
2
y1 y2 +
21
256
x2
2
y1 y2 +
7
256
x3
2
y1 y2 +
69 x2 y1
2
y2
1024
+
21 y1
3
y2
256
-
21
256
x1 x2 y2
2
+
69 x1 y1 y2
2
1024
+
21 y1 y2
3
256
-
141 x1
2
x3 y3
1024
-
141 x2
2
x3 y3
1024
-
65
128
x2 x3 y1 y3 -
123 x3 y1
2
y3
1024
-
65
128
x1 x3 y2 y3 -
123 x3 y2
2
y3
1024
+
103
256
x1 x2 y3
2
+
153 x1 y1 y3
2
1024
+
153 x2 y2 y3
2
1024
-
85
256
y1 y2 y3
2
Comparison with (EHD : 6.10)
Expand@-1024 w4 + 84 Hy1 y2 - x1 x2L Hx1^2 + x2^2 + y1^2 + y2^2L +
69 Hx1 y1 Hy2^2 - x2^2L + x2 y2 Hy1^2 - x1^2LL + x3^2 H-100 x1 x2 - 9 Hx1 y1 + x2 y2L + 28 y1 y2L +
y3^2 H412 x1 x2 + 153 Hx1 y1 + x2 y2L - 340 y1 y2L +
x3 y3 H-141 Hx1^2 + x2^2L - 520 Hx1 y2 + x2 y1L - 123 Hy1^2 + y2^2LLD
0
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 167
Transformed quartic Hamiltonian
ham4 = transform@ham3, 4, w4D
L
3
-
3 x2 x3 y1
4 2
-
3 x1 x3 y2
4 2
+
3 x1 x2 y3
4 2
-
3 y1 y2 y3
4 2
+
L
2
x1
2
2
+
x2
2
2
+ x3
2
+
y1
2
2
+
y2
2
2
+ y3
2
+ L
4
3 x1
4
128
+
51 x1
2
x2
2
256
+
3 x2
4
128
-
57 x1
2
x3
2
256
-
57 x2
2
x3
2
256
+
3 x1
2
y1
2
64
+
51 x2
2
y1
2
256
-
57 x3
2
y1
2
256
+
3 y1
4
128
+
51 x1
2
y2
2
256
+
3 x2
2
y2
2
64
-
57 x3
2
y2
2
256
+
51 y1
2
y2
2
256
+
3 y2
4
128
-
57 x1
2
y3
2
256
-
57 x2
2
y3
2
256
-
57 y1
2
y3
2
256
-
57 y2
2
y3
2
256
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 168
Exercise 6.3 Hamiltonian of the quartic integrable swing-
spring
From Exercise 6.2
ham4 = -
3 x2 x3 y1
4 2
-
3 x1 x3 y2
4 2
+
3 x1 x2 y3
4 2
-
3 y1 y2 y3
4 2
+
x1
2
2
+
x2
2
2
+ x3
2
+
y1
2
2
+
y2
2
2
+ y3
2
+
3 x1
4
128
+
51 x1
2
x2
2
256
+
3 x2
4
128
-
57 x1
2
x3
2
256
-
57 x2
2
x3
2
256
+
3 x1
2
y1
2
64
+
51 x2
2
y1
2
256
-
57 x3
2
y1
2
256
+
3 y1
4
128
+
51 x1
2
y2
2
256
+
3 x2
2
y2
2
64
-
57 x3
2
y2
2
256
+
51 y1
2
y2
2
256
+
3 y2
4
128
-
57 x1
2
y3
2
256
-
57 x2
2
y3
2
256
-
57 y1
2
y3
2
256
-
57 y2
2
y3
2
256
;
rho1 = x1^2 + y1^2;
rho2 = x2^2 + y2^2;
rho3 = x3^2 + y3^2;
Expand@Hx1 - I y1L Hx2 - I y2L Hx3 + I y3LD
x1 x2 x3 - x2 x3 y1 - x1 x3 y2 - x3 y1 y2 + x1 x2 y3 + x2 y1 y3 + x1 y2 y3 - y1 y2 y3
rho4 = x1 x2 y3 - y1 y2 y3 - x2 x3 y1 - x1 x3 y2;
rho5 = x1 x2 x3 - x3 y1 y2 + x2 y1 y3 + x1 y2 y3;
mu3 = 3 Sqrt@2D 8;
mu41 = 3 128;
mu42 = 51 256;
mu43 = -57 256;
K4 = rho1 2 + rho2 2 + rho3 + mu3 rho4 +
mu41 Hrho1^2 + rho2^2L + mu42 rho1 rho2 + mu43 Hrho1 + rho2L rho3;
Expand@K4 - ham4D
0
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 169
Exercise 6.4 Independence of the swing-spring integrals
Dependence requires the vanishing of all 3 3 minors of the rectangular
matrix

3
P
2
Q
3
0 0

3
P
1
Q
3
0 0
2Q
3
(1 +
43
(
1
+
2
)) 2Q
3
0

3
P
2
P
3
+P
1
(1 + 4
41

1
+ 2
42

2
+ 2
43

3
) P
1
P
1

3
P
1
P
3
+P
2
(1 + 4
41

2
+ 2
42

1
+ 2
43

3
) P
2
P
2

3
P
1
P
2
+ 2P
3
(1 +
43
(
1
+
2
)) 2P
3
0

The minor built from rows 1,3,and 5 evaluates to 2


3
P
2
2
Q
2
3
, while that
consisting of rows 2, 3, and 4 evaluates to 2
3
P
2
1
Q
2
3
. The vanishing of both
of these minors implies either Q
3
= 0 or P
1
= P
2
= 0. Since in the frame of
reference where Q
1
= 0 = Q
2
,

5
= Q
3
P
1
P
2
,
4
= P
1
P
2
P
3
,
we conclude that if P
1
= P
2
= 0, then
5
=
4
= 0 and equation (EHD:6.14)
holds trivially, while if Q
3
= 0, then

5
= 0,
4
=

P
2
1
P
2
2
P
2
3
=

3
.
Moreover, the only nontrivial minor for Q
3
= 0 is built from rows 4,5, and
6. Evaluating the determinant, we get

P
2
P
3
P
1
P
1
P
1
P
3
P
2
P
2
P
1
P
2
2P
3
0

+P
1
P
2
P
3

1 + 4
41

1
+ 2
42

2
+ 2
43

3
1 1
1 + 4
41

2
+ 2
42

1
+ 2
43

3
1 1
2(1 +
43
(
1
+
2
)) 2 0

The rst determinant evaluates to


2
3
(P
2
1
P
2
3
+P
2
2
P
2
3
P
2
1
P
2
2
) = 2
3
(
1

3
+
2

2
),
while the second one evaluates to
4
4
((2
41
+
42

4,3
)(
1
+
2
) + 2
43

3
)
Setting the sum equal to zero completes the proof of (EHD:6.14).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 170
Exercise 6.5 Formulas for
4
and
5

The three conserved quanties are:
K
2
=
1
2
(
1
+
2
+ 2
3
),
M =
1
2
(
2

1
),
K = K
2
+
3

4
+
41
(
2
1
+
2
2
) +
42

2
+
43
(
1
+
2
)
3
.
Solving for
4
gives
1
3
g(
3
), with g given by (EHD:6.16). Solving (EHD:6.12),

2
5
+
2
4
=
1

3
,
for
5
gives

f(
3
), with f given by (EHD:6.17).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 171
Exercise 6.6 Poisson bracket [
k
,
4
]
By denition,
ln(Q
k
iP
k
) =
1
2
ln
k
+i
k
, k = 1, 2.
Thus,
[
1
2
ln
k
+i
k
,
5
+i
4
] = [ln(Q
k
iP
k
), (Q
1
iP
1
)(Q
2
iP
2
)(Q
3
+iP
3
)] = 0.
Taking the real part,
[
k
,
4
] = [
1
2
ln
k
,
5
] =
1
2
k
[
k
,
5
] =

4

k
, k = 1, 2.
Here we have used the Poisson bracket identity
[F(A), B] = F

(A)[A, B]
and the formulas (EHD:6.11).
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 172
Exercise 6.7 Bifurcation point
The bifurcation point is characterized by the function f(
3
) having a
cubic inection point, where
f(
3
) = f

(
3
) = f

(
3
) = 0.
Let us write these simultaneous equations in terms of the variables K
2
, M,
3
,
4
and constants m
1
=
41
/
3
, m
2
=
42
/
3
, m
3
=
43
/
3
:
f(
3
) = ((K
2

3
)
2
M
2
)
3

2
4
= 0
f

(
3
) = K
2
2
M
2
4K
2

3
+ 3
3
3
+4
4
(
3
(2m
1
+ m
2
2m
3
) K
2
(2m
1
+ m
2
m
3
)) = 0
f

(
3
) = 6
4
4K
2
8((
3
(2m
1
+ m
2
2m
3
) K
2
(2m
1
+ m
2
m
3
))
2
+4
4
(2m
1
+ m
2
2m
3
) = 0.
Using the Mathematica function Solve, we nd that the only real solu-
tions for K
2
,
3
,
4
are
K
2
=
3
=
4
= 0
and
K
2
=
3
=
512
361
,
4
= 0.
Clearly the second solution is the desired threshold solution. Note that the
condition f = 0 implies that M = 0 as well.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 173
Exercise 6.8 Plotting the function f(r
3
)
The function f(r
3
)
mu3 = 3 H4 Sqrt@2DL;
mu41 = 3 128;
mu42 = 51 256;
mu43 = -57 256;
rho4@K2_, M_, K_, r3_D := Module@8r1, r2, r4<,
r1 = K2 - M - r3;
r2 = K2 + M - r3;
mu3^H-1L HK - K2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3LD
f@K2_, M_, K_, r3_D := Module@8r1, r2, r4<,
r1 = K2 - M - r3;
r2 = K2 + M - r3;
r4 = mu3^H-1L HK - K2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3L;
r1 r2 r3 - r4^2D
Manipulate@Plot@f@K2, M, K, r3D, 8r3, 0, K2<, PlotRange 8-max, max<D,
8K2, 0, 5<, 8M, 0, K2<, 8K, 0, 5<, 8max, 1 1000, 10<D
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 174
Exercise 6.9 Derivation of EHD equation (6.28)
We start with Eq. (EHD:6.14), divided through by
3
, and make the
substitutions

1
K
2
M
3
,
2
K
2
+M
3
,

3

3

2
8
,
41

3
128
,
41

51
256
,
41

57
256
.
Easy algebra gives (EHD:6.28)
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 175
Exercise 6.10 Properties of the boundary curves
From (EHD:6.15), we have
K
2
+
2
+
3
M K
2

3
.
We see that the extreme values of M are achieved when

2
=
3
= 0, M = K
2
minimum value

1
=
3
= 0, M = K
2
maximum value
From (EHD:6.13) and (EHD:3.15), each of these conditions determines a
unique value of K, hence a unique point (A
+
or A

) in the (H, K) plane.


Since (EHD:6.28) is satised at these points, they must lie on the boundary
of the allowed region.
That the function f(
3
) has a cubic inection point (a triple root of f) at
the points C

follows from the fact that the second derivative at the point
of tangency is continuous as one traverses the path E

D, and
moreover it changes from negative on E

to positive on D, necessarily passing


through zero at the point C

. A similar argument holds for E


+
C
+
D.
The case G for the threshold K
2
= K

2
is obtained by decreasing K
2
continuously until C
+
and C

coincide. The second derivative at the point


of tangency is zero for C

and remains so in the limit K


2
= K

2
.
For M = 0 (and only for M = 0), the boundary equations f(
3
) = 0 and
(EHD:6.28) have a special solution where
3
achieves its maximum possible
value,
3
= K
2
. Then, from (EHD6.15),
1
= 0 =
2
. Since
5
= 0 and

2
4
+
2
5
=
1

3
= 0, we conclude that
4
= 0 as well. Finally, from
(EHD6.13), we conclude K = K
2
.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 176
Exercise 6.11 Angular shifts
The function f(rho3)
mu3 = 3 H4 Sqrt@2DL;
mu41 = 3 128;
mu42 = 51 256;
mu43 = -57 256;
f@H2_, L_, H_, r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
r4 = mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3L;
r1 r2 r3 - r4^2D
rho1@H2_, L_, H_, r3_D := H2 - L - r3
rho2@H2_, L_, H_, r3_D := H2 + L - r3
rho4@H2_, L_, H_, r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3LD
froots@H2_, L_, H_D := NSolve@f@H2, L, H, r3D 0, r3, Reals, WorkingPrecision 40D
R0@H2_, L_, H_D := r3 . froots@H2, L, HD@@1DD
R1@H2_, L_, H_D := r3 . froots@H2, L, HD@@2DD
R2@H2_, L_, H_D := r3 . froots@H2, L, HD@@3DD
R3@H2_, L_, H_D := r3 . froots@H2, L, HD@@4DD
Precession rates for a
1
and a
2
; angular shifts T
1
and T
2
h1@H2_, L_, H_, r3_D := 1 + mu3 rho4@H2, L, H, r3D rho1@H2, L, H, r3D +
4 mu41 rho1@H2, L, H, r3D + 2 mu42 rho2@H2, L, H, r3D + 2 mu43 r3
h2@H2_, L_, H_, r3_D := 1 + mu3 rho4@H2, L, H, r3D rho2@H2, L, H, r3D +
4 mu41 rho2@H2, L, H, r3D + 2 mu42 rho1@H2, L, H, r3D + 2 mu43 r3
Machine precision calculation
t1@H2_, L_, H_D := Re@
NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL, 8r3, R0@H2, L, HD, R1@H2, L, HD<DD
t2@H2_, L_, H_D := Re@
NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL, 8r3, R0@H2, L, HD, R1@H2, L, HD<DD
ell@s_D := Cos@sD;
aitch@s_D := 29 10 + Sin@sD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 177
Plot@t1@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
Plot@t2@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
FindRoot@29 10 + Sin@sD - crit@3, Cos@sDD, 8s, 561785 100000<D
8s 5.61781<
ss = 5.617813442939268`;
t1central = t1@3, ell@ssD, crit@3, ell@ssDDD
2.8819714591996894`
t1high = t1@3, ell@ssD, crit@3, ell@ssDD + 10^H-8LD
5.7667086190687105`
t1low = t1@3, ell@ssD, crit@3, ell@ssDD - 10^H-8LD
2.8491076368387365`
t1high - t1central
2.88474
t1central - t1low
0.0328638
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 178
30-digit precision calculation
t1@H2_, L_, H_D := Re@NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 50DD
t2@H2_, L_, H_D := Re@NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 50DD
ell@s_D := Cos@sD;
aitch@s_D := 29 10 + Sin@sD;
Plot@t1@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
Plot@t2@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
FindRoot@29 10 + Sin@sD - crit@3, Cos@sDD, 8s, 561785 100000<, WorkingPrecision 30D
8s 5.61781344293926866033965055305<
ss = 5.617813442939268660339650553050140652837305601216`30.;
t1central = t1@3, ell@ssD, crit@3, ell@ssDDD
2.8819717005845005541533999179150928920767448107503
t1high = t1@3, ell@ssD, crit@3, ell@ssDD + 10^H-8LD
6.0235642482604376566811416765587310722501189247269
t1low = t1@3, ell@ssD, crit@3, ell@ssDD - 10^H-8LD
-0.25962084710453133216287626553102795648460536068828
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 179
t1high - t1central
3.1415925476759371025277417586436381801733741139767
t1central - t1low
3.1415925476890318863162761834461208485613501714386
N@Pi, 15D
3.14159265358979
40-digit precision calculation
t1@H2_, L_, H_D := Re@NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
t2@H2_, L_, H_D := Re@NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
ell@s_D := Cos@sD;
aitch@s_D := 29 10 + Sin@sD;
Plot@t1@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
Plot@t2@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1
2
3
4
5
6
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
FindRoot@29 10 + Sin@sD - crit@3, Cos@sDD, 8s, 561785 100000<, WorkingPrecision 40D
80 5.617813442939268660339650553050140652837<
ss = 5.6178134429392686603396505530501406528372413235087821165531`40.;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 180
t1central = t1@3, ell@ssD, crit@3, ell@ssDDD
2.88197170058450055428930540503236675257870039940184075704755395588173212525507302925166
3492545879943
t1high = t1@3, ell@ssD, crit@3, ell@ssDD + 10^H-8LD
6.02356434466354496610179256252604133461683097003268116103276033741566049508778894199175
3119848004658
t1low = t1@3, ell@ssD, crit@3, ell@ssDD - 10^H-8LD
-0.2596209435234309890677914018274716594718933274073923896526588712631350941625091951713
419654822583305
t1high - t1central
3.14159264407904441181248715749367458203813057063084040398520638153392836983271591274008
9627302124715
t1central - t1low
3.14159264410793154335709680685983841205059372680923314670021282714486721941758222442300
5458028138274
N@Pi, 15D
3.14159265358979
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 181
Exercise 6.12 Angular shifts, curves a,h,e
The function f(rho3)
mu3 = 3 H4 Sqrt@2DL;
mu41 = 3 128;
mu42 = 51 256;
mu43 = -57 256;
f@H2_, L_, H_, r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
r4 = mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3L;
r1 r2 r3 - r4^2D
rho1@H2_, L_, H_, r3_D := H2 - L - r3
rho2@H2_, L_, H_, r3_D := H2 + L - r3
rho4@H2_, L_, H_, r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3LD
froots@H2_, L_, H_D := NSolve@f@H2, L, H, r3D 0, r3, Reals, WorkingPrecision 40D
R0@H2_, L_, H_D := r3 . froots@H2, L, HD@@1DD
R1@H2_, L_, H_D := r3 . froots@H2, L, HD@@2DD
R2@H2_, L_, H_D := r3 . froots@H2, L, HD@@3DD
R3@H2_, L_, H_D := r3 . froots@H2, L, HD@@4DD
Precession rates for a
1
and a
2
; angular shifts T
1
and T
2
h1@H2_, L_, H_, r3_D := 1 + mu3 rho4@H2, L, H, r3D rho1@H2, L, H, r3D +
4 mu41 rho1@H2, L, H, r3D + 2 mu42 rho2@H2, L, H, r3D + 2 mu43 r3
h2@H2_, L_, H_, r3_D := 1 + mu3 rho4@H2, L, H, r3D rho2@H2, L, H, r3D +
4 mu41 rho2@H2, L, H, r3D + 2 mu42 rho1@H2, L, H, r3D + 2 mu43 r3
40-digit precision calculation, curve alpha on first sheet (R0 r
3
R1)
t1@H2_, L_, H_D := Re@NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
t2@H2_, L_, H_D := Re@NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
ell@s_D := -15 10 + Cos@sD;
aitch@s_D := 36 10 + Sin@sD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 182
Plot@t1@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
1.8
2.0
2.2
2.4
2.6
2.8
Plot@t2@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
3.4
3.6
3.8
4.0
4.2
4.4
4.6
40-digit precision calculation, curve h on second sheet (R2 r
3
R3)
t1@H2_, L_, H_D := Re@NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R2@H2, L, HD, R3@H2, L, HD<, WorkingPrecision 100DD
t2@H2_, L_, H_D := Re@NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R2@H2, L, HD, R3@H2, L, HD<, WorkingPrecision 100DD
ell@s_D := 71 1000 Cos@sD;
aitch@s_D := 2933 1000 + 12 1000 Sin@sD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 183
Plot@t1@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
2
4
6
8
Plot@t2@3, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
2
4
6
8
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
FindRoot@2933 1000 + 12 1000 Sin@sD - crit@3, 71 1000 Cos@sDD,
8s, 561785 100000<, WorkingPrecision 40D
8s 5.640590623801827229397488525678998245667<
ss = 5.6405906238018272293974885256789982456666663843812780632571`40.;
t1central = t1@3, ell@ssD, crit@3, ell@ssDDD
4.88025937363718741298381323119518650719102297125723497557887705964416524371290679879175
6076063378838
t1high = t1@3, ell@ssD, crit@3, ell@ssDD + 10^H-8LD
8.07246963180181738758308049063563587308505595986358247631755118966250305101105148678123
8948878729779
t1low = t1@3, ell@ssD, crit@3, ell@ssDD - 10^H-8LD
1.73866743385467228854348724659288609058939984656448340195280768591518294035037283782454
6221120657764
t1high - t1central
3.19221025816462997459926725944044936589403298860634750073867413001833780729814468798948
287281535094
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 184
t1central - t1low
3.14159193978251512444032598460230041660162312469275157362606937372898230336253396096720
9854942721074
N@Pi, 15D
3.14159265358979
FindRoot@2933 1000 + 12 1000 Sin@sD - crit@3, 71 1000 Cos@sDD,
8s, 90 100<, WorkingPrecision 40D
8s 0.9048257448434651736769392766442910677288<
ss = 0.9048257448434651736769392766442910677288301435835598133664`40.;
t1central = t1@3, ell@ssD, crit@3, ell@ssDDD
4.15077126125876560117592726936595284549346630647245564926227780965532744555677883371950
0364150625273
t1high = t1@3, ell@ssD, crit@3, ell@ssDD + 10^H-8LD
7.28951338212943296247894687092927641102189871820779001829930963707900527181164513594793
5118610455571
t1low = t1@3, ell@ssD, crit@3, ell@ssDD - 10^H-8LD
1.01202913653994115215739423298399590957239701972538306304202601991738298896712878066871
57389570571316
t1high - t1central
3.13874212087066736130301960156332356552843241173533436903703182742367782625486630222843
4754459830298
t1central - t1low
3.13874212471882444901853303638195693592106928674707258622025178973794445658965005305078
4625193568141
N@Pi, 15D
3.14159265358979
40-digit precision calculation, curve epsilon on first sheet (R0 r
3
R1)
t1@H2_, L_, H_D := Re@NIntegrate@h1@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
t2@H2_, L_, H_D := Re@NIntegrate@h2@H2, L, H, r3D Hmu3 Sqrt@f@H2, L, H, r3DDL,
8r3, R0@H2, L, HD, R1@H2, L, HD<, WorkingPrecision 100DD
ell@s_D := 2 10 Cos@sD;
aitch@s_D := 1 + 2 10 Sin@sD;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 185
Plot@t1@1, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
4
5
6
7
8
9
Plot@t2@1, ell@sD, aitch@sDD, 8s, 0, 2 Pi<, PlotPoints 20D
1 2 3 4 5 6
4
5
6
7
8
9
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
FindRoot@1 + 2 10 Sin@sD - crit@1, 2 10 Cos@sDD, 8s, 6<, WorkingPrecision 40D
8s 5.952453347078372748883292510236566250682<
ss = 5.9524533470783727488832925102365662506820920865304285653036`40.;
t1central = t1@1, ell@ssD, crit@1, ell@ssDDD
6.35311592788436677107046234090913651037421995552524065809501886574540152036500119217244
0454065763788
t1high = t1@1, ell@ssD, crit@1, ell@ssDD + 10^H-8LD
9.49470856872318921749279079294507196475698106092966070924817192395212677303892082435683
6761303396400
t1low = t1@1, ell@ssD, crit@1, ell@ssDD - 10^H-8LD
3.21152328704540143603534798103253208536312781703337953813441416698616667380068008121383
7585592763503
t1high - t1central
3.14159264083882244642232845203593545438276110540442005115315305820672525267391963218439
630723763261
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 186
t1central - t1low
3.14159264083896533503511435987660442501109213849186111996060469875923484656432111095860
2868473000285
N@Pi, 15D
3.14159265358979
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 187
Exercise 6.13 Polar angle in the quasi-laboratory frame
We wish to show that the polar angle of the eigenvector a
+
of the matrix
M of (EHD:6.37) is equal to

1
= tan
1

P
1
Q
1

tan
1

P
2
Q
2

in the limit of vanishing angular momentum l = XP


Y
Y P
X
in the quasi-
laboratory frame.
First, we calculate a
+
= (a
+X
, a
+Y
), which is a solution of the eigenvector
equation

2h
Y

+
m
m 2h
X

+

a
+X
a
+Y

0
0

,
where

+
= h
X
+h
Y

(h
X
+h
Y
)
2
l
2
,
h
X
=
1
2
(X
2
+P
2
X
), h
Y
=
1
2
(Y
2
+P
2
Y
), m = XY +P
X
P
Y
.
Thus
tan =
2h
X

+
m
=
h
X
h
Y
m
+O

l
2
(h
X
+h
Y
)
2

.
We now want to express tan(
2

1
) in the quasi-laboratory frame. Since
tan
1
=
Y +P
X
X P
Y
, tan
2
=
X +P
Y
Y P
X
,
we obtain
tan(
2

1
) =
tan
2
tan
1
1 + tan
1
tan
2
=
X
2
+P
2
X
Y
2
P
2
Y
2XY + 2P
X
P
Y
=
h
X
h
Y
m
= tan +O

l
2
(h
X
+h
Y
)
2

This establishes the desired identity in the limit of vanishing angular


momentum.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 188
Exercise 6.14 Periodic shift of the swing plane, in the Q,P
frame of reference
Functions
mu3 = 3 H4 Sqrt@2DL;
mu41 = 3 128;
mu42 = 51 256;
mu43 = -57 256;
rho4@r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3LD
f@r3_D := Module@8r1, r2, r4<,
r1 = H2 - L - r3;
r2 = H2 + L - r3;
r4 = mu3^H-1L HH - H2 - mu41 Hr1^2 + r2^2L - mu42 r1 r2 - mu43 Hr1 + r2L r3L;
r1 r2 r3 - r4^2D
froots := NSolve@f@r3D 0, r3, WorkingPrecision 200D
rho1@r3_D := H2 - L - r3
rho2@r3_D := H2 + L - r3
h1@r3_D := 1 + mu3 rho4@r3D rho1@r3D + 4 mu41 rho1@r3D + 2 mu42 rho2@r3D + 2 mu43 r3
h2@r3_D := 1 + mu3 rho4@r3D rho2@r3D + 4 mu41 rho2@r3D + 2 mu42 rho1@r3D + 2 mu43 r3
crit@H2_, L_D := H2 + 2 H2 L mu43 + H-2 mu43 + 4 mu41L L^2
Numerical integration of an orbit
H2=1/100; L=10^(-8); H= crit[H2,L]+10^(-16)
Here H2, L, and H are the numerical values of the observables K
2
, M, and K in EHD, Section 6.8.
H2 = 1 100;
L = 10^H-8L;
H = crit@H2, LD + 10^H-16L
u0 = Re@r3 . froots@@1DDD;
u1 = Re@r3 . froots@@2DDD;
u2 = r3 . froots@@3DD;
u3 = r3 . froots@@4DD;
Numerical integration of the flow coordinates over many periods
We calculate the three Liouville-Arnold flow coordinates t
1
, t
2
, t
3
as functions of r
3
at 2792 points for a single
period, starting at the root r
3
=u
0
of f(r
3
). We use finer separations between successive points near the turning
points.
drA = Hu1 - u0L 1000;
drB = drA 100;
drC = drB 100;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 189
t3@0D = 0; r3@0D = u0; r1@0D = H2 - L - r3@0D; r2@0D = H2 + L - r3@0D;
t1@0D = SetPrecision@Pi 2, 40D; t2@0D = SetPrecision@Pi 2, 40D;
For@k = 1, k 100, k++,
r3@kD = u0 + k * drC;
r1@kD = H2 - L - r3@kD;
r2@kD = H2 + L - r3@kD;
t3@kD = t3@k - 1D +
Re@NIntegrate@1 H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t1@kD = t1@k - 1D +
Re@NIntegrate@h1@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t2@kD = t2@k - 1D +
Re@NIntegrate@h2@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DDD
For@k = 101, k 199, k++,
r3@kD = u0 + Hk - 99L * drB;
r1@kD = H2 - L - r3@kD;
r2@kD = H2 + L - r3@kD;
t3@kD = t3@k - 1D +
Re@NIntegrate@1 H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t1@kD = t1@k - 1D +
Re@NIntegrate@h1@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t2@kD = t2@k - 1D +
Re@NIntegrate@h2@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DDD
For@k = 200, k 1197, k++,
r3@kD = u0 + Hk - 198L * drA;
r1@kD = H2 - L - r3@kD;
r2@kD = H2 + L - r3@kD;
t3@kD = t3@k - 1D +
Re@NIntegrate@1 H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drA, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t1@kD = t1@k - 1D +
Re@NIntegrate@h1@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drA, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t2@kD = t2@k - 1D +
Re@NIntegrate@h2@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drA, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DDD
For@k = 1198, k 1296, k++,
r3@kD = u0 + 999 * drA + Hk - 1197L * drB;
r1@kD = H2 - L - r3@kD;
r2@kD = H2 + L - r3@kD;
t3@kD = t3@k - 1D + Re@NIntegrate@1 H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t1@kD = t1@k - 1D +
Re@NIntegrate@h1@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t2@kD = t2@k - 1D +
Re@NIntegrate@h2@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drB, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DDD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 190
For@k = 1297, k 1396, k++,
r3@kD = u0 + 999 * drA + 99 * drB + Hk - 1296L * drC;
r1@kD = H2 - L - r3@kD;
r2@kD = H2 + L - r3@kD;
t3@kD = t3@k - 1D +
Re@NIntegrate@1 H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t1@kD = t1@k - 1D +
Re@NIntegrate@h1@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DD;
t2@kD = t2@k - 1D +
Re@NIntegrate@h2@rD H2 mu3 Sqrt@f@rDDL, 8r, r3@kD - drC, r3@kD<,
MaxRecursion 30, WorkingPrecision 200, PrecisionGoal 40DDD
For@k = 1397, k 2792, k++,
t3@kD = 2 * t3@1396D - t3@2792 - kD;
t2@kD = 2 * t2@1396D - t2@2792 - kD;
t1@kD = 2 * t1@1396D - t1@2792 - kD;
r3@kD = r3@2792 - kD;
r1@kD = r1@2792 - kD;
r2@kD = r2@2792 - kDD
t3@k_D := t3@Mod@k, 2792DD + Floor@k 2792D * 2 * t3@1396D;
t1@k_D := t1@Mod@k, 2792DD + Floor@k 2792D * 2 * Ht1@1396D - t1@0DL;
t2@k_D := t2@Mod@k, 2792DD + Floor@k 2792D * 2 * Ht2@1396D - t2@0DL;
r3@k_D := r3@Mod@k, 2792DD;
r1@k_D := r1@Mod@k, 2792DD;
r2@k_D := r2@Mod@k, 2792DD
For@k = 0, k 1396, k++, r4@kD = rho4@r3@kDDD;
For@k = 1397, k 2792, k++, r4@kD = r4@2792 - kDD;
r4@k_D := r4@Mod@k, 2792DD
r5@0D = 0;
For@k = 1, k 1396, k++, r5@kD = f@r3@kDDD;
For@k = 1397, k 2792, k++, r5@kD = -r5@2792 - kDD;
r5@k_D := r5@Mod@k, 2792DD
The orbit in phase space
We transform from flow coordinates to phase-space coordinates of the Q,P frame of reference
Q1val@k_D := Sqrt@r1@kDD * Cos@t1@kDD
Q2val@k_D := Sqrt@r2@kDD * Cos@t2@kDD
Q3val@k_D := 1 Sqrt@r1@kD * r2@kDD HCos@t1@kD + t2@kDD * r5@kD + Sin@t1@kD + t2@kDD * r4@kDL
P1val@k_D := -Sqrt@r1@kDD * Sin@t1@kDD
P2val@k_D := -Sqrt@r2@kDD * Sin@t2@kDD
P3val@k_D := 1 Sqrt@r1@kD * r2@kDD H-Sin@t1@kD + t2@kDD * r5@kD + Cos@t1@kD + t2@kDD * r4@kDL
We store the Q, P values for a 4-period orbit, and then define coordinate functions taking these values.
phaseorbit =
Table@8Q1val@kD, Q2val@kD, Q3val@kD, P1val@kD, P2val@kD, P3val@kD<, 8k, 0, 4 * 2792<D;
phaseorbit = phaseorbit . Hold@r4@Mod@0, 2792DDD -> rho4@r3@0DD;
Correction for initial point.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 191
Q1@k_D := phaseorbit@@k + 1, 1DD;
Q2@k_D := phaseorbit@@k + 1, 2DD;
Q3@k_D := phaseorbit@@k + 1, 3DD;
P1@k_D := phaseorbit@@k + 1, 4DD;
P2@k_D := phaseorbit@@k + 1, 5DD;
P3@k_D := phaseorbit@@k + 1, 6DD;
Orbit plot, Q1, Q2 plane, first period
phaseorb2 = Table@phaseorbit@@k + 1, 81, 2<DD, 8k, 0, 2792<D;
ListPlot@phaseorb2, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio AutomaticD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 192
Orbit plot, Q1, Q2 plane, second period
phaseorb2 = phaseorb1 = Table@phaseorbit@@k + 1, 81, 2<DD, 8k, 2792, 2 * 2792<D;
ListPlot@phaseorb2, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio AutomaticD
Orbit plot, Q1, Q2 plane, third period
phaseorb2 = Table@phaseorbit@@k + 1, 81, 2<DD, 8k, 2 * 2792, 3 * 2792<D;
ListPlot@phaseorb2, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio AutomaticD
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 193
Orbit plot, Q1, Q2 plane, fourth period
phaseorb2 = Table@phaseorbit@@k + 1, 81, 2<DD, 8k, 3 * 2792, 4 * 2792<D;
ListPlot@phaseorb2, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio AutomaticD
Behavior of the instantaneous eccentricity (Q1,Q2 plane)
ecc@k_D := Hkap1 = Hr1@kD + r2@kDL 2 - HQ1@kD * P2@kD - Q2@kD * P1@kDL;
kap2 = Hr1@kD + r2@kDL 2 + HQ1@kD * P2@kD - Q2@kD * P1@kDL;
kappa = Hkap1 kap2L^H1 4L;
2 * kappa H1 + kappa^2LL
10 periods
ListPlot@Table@8t3@kD, ecc@kD<, 8k, 0, 10 * 2792<D,
PlotStyle 8Black, Thickness@.003D, PointSize@.003D<, Joined TrueD
40 periods
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 194
ListPlot@Table@8t3@kD, ecc@kD<, 8k, 0, 40 * 2792<D,
PlotStyle 8Black, Thickness@.003D, PointSize@.003D<, Joined TrueD
Next 40 periods
ListPlot@Table@8t3@kD, ecc@kD<, 8k, 40 * 2792, 80 * 2792<D,
PlotStyle 8Black, Thickness@.003D, PointSize@.003D<, Joined TrueD
Same orbit in the quasi-laboratory frame, X,Y plane
XYOrbit = Table@8HQ1@kD + P2@kDL Sqrt@2D, HQ2@kD + P1@kDL Sqrt@2D<, 8k, 0, 2792<D;
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 195
ListPlot@XYOrbit, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio AutomaticD
Zooming in
ListPlot@XYOrbit, PlotStyle 8Black, Thickness@.003D, PointSize@.003D<,
Joined True, AspectRatio Automatic, PlotRange 88-.001, .001<, 8-.001, .001<<D
The orbit over 17 periods is plotted in EHD, Figure 6.18.
Solutions to the Exercises Essentials of Hamiltonian Dynamics
Chapter 6 196

Das könnte Ihnen auch gefallen