Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle...

27
Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle Dynamics in High Energy Accelerators There are six lectures in this course on nonlinear dynamics: 1. First example: nonlinear dynamics in a bunch compressor 2. Second example: nonlinear dynamics in storage rings 3. Hamiltonian mechanics 4. Canonical perturbation theory 5. Lie transformations 6. Symplectic integrators Nonlinear Dynamics 1 Part 3: Hamiltonian Mechanics

Transcript of Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle...

Page 1: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Nonlinear Single-Particle Dynamics

in High Energy Accelerators

Part 3: Hamiltonian Mechanics

Nonlinear Single-Particle Dynamics in High Energy Accelerators

There are six lectures in this course on nonlinear dynamics:

1. First example: nonlinear dynamics in a bunch compressor

2. Second example: nonlinear dynamics in storage rings

3. Hamiltonian mechanics

4. Canonical perturbation theory

5. Lie transformations

6. Symplectic integrators

Nonlinear Dynamics 1 Part 3: Hamiltonian Mechanics

Page 2: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

In the previous lectures...

We have seen how nonlinear dynamics can play an important

role in some diverse accelerator systems.

Nonlinear effects in beam dynamics often have to be taken into

account when designing accelerators.

By making a simple analysis, we were able to compensate the

most severe nonlinear effects in a bunch compressor.

We were also able to develop some understanding the effects of

sextupoles in a periodic beamline (a storage ring).

Nonlinear Dynamics 2 Part 3: Hamiltonian Mechanics

In the previous lectures...

So far, our analysis has been based on transfer maps

represented in the form of Taylor series.

For example:

x1 = R11x0 +R12px0 + T111x20 + T112x0px0 + T122p

2x0 + · · ·

(1)

px1 = R21x0 +R22px0 + T211x20 + T212x0px0 + T222p

2x0 + · · ·

(2)

Nonlinear Dynamics 3 Part 3: Hamiltonian Mechanics

Page 3: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Limitations of Taylor maps

In simple cases, Taylor maps can be very useful and convenient.

For example, once the coefficients in a Taylor map for a

particular component (or section) in a beamline have been

worked out, a Taylor map can be readily implemented in a

tracking code.

Also, the coefficients in a Taylor map contain information

about the dynamics of the system.

However, in several degrees of freedom Taylor series quickly

become cumbersome, especially where high-order effects are

important.

It is also difficult to enforce certain desirable properties of the

dynamics (in particular, symplecticity) when using Taylor maps.

To make progress, we need to use more sophisticated tools.

Nonlinear Dynamics 4 Part 3: Hamiltonian Mechanics

Basic tools and concepts

Some very powerful methods for analysis of nonlinear systems

are based on Hamiltonian mechanics. In this lecture, we review

the basic principles of Hamiltonian mechanics in the context of

accelerator beam dynamics.

In particular, we shall:

1. review Hamilton’s equations;

2. discuss the significance of symplecticity;

3. derive (and solve) the nonlinear equations of motion for a

drift space in an accelerator;

4. review canonical transformations, and introduce

action–angle variables.

Nonlinear Dynamics 5 Part 3: Hamiltonian Mechanics

Page 4: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Basic tools and concepts

By the end of this lecture, you should be able to:

• derive the equations of motion for a dynamical system with

a given Hamiltonian;

• be able to express relationships between different sets of

variables in the form of canonical transformations.

Nonlinear Dynamics 6 Part 3: Hamiltonian Mechanics

Hamilton’s equations

In Hamiltonian mechanics, the state of a particle is specified by

giving particular values for a set of dynamical variables.

The dynamical variables occur in pairs, with each pair

consisting of a co-ordinate and a conjugate momentum.

The dynamics of the particle are described by expressing the

dynamical variables as functions of an independent variable (for

example, time t).

Nonlinear Dynamics 7 Part 3: Hamiltonian Mechanics

Page 5: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Equation of motion for a harmonic oscillator

For example, for a particle of mass m performing simple

harmonic motion with frequency ω, the equations of motion are

derived from Newton’s second law:

dq

dt=

p

m,

dp

dt= −mω2q, (3)

where q = q(t) is the position of the particle at time t, and

p = p(t) is the momentum of the particle at time t.

The equations of motion have solution:

q(t) = a cos(ωt+ φ0), (4)

p(t) = −mωa sin(ωt+ φ0), (5)

where a (the amplitude) and φ0 (a constant phase) are

constants determined by the initial conditions.

Nonlinear Dynamics 8 Part 3: Hamiltonian Mechanics

Hamilton’s equations

In Newtonian mechanics, the equations of motion for a particle

in a specific case are determined by the force F on the particle:

dq

dt=

p

m,

dp

dt= F. (6)

In Hamiltonian mechanics, the equations of motion are derived

from a function called the Hamiltonian.

The Hamiltonian is a function of the dynamical variables and

(in general) the independent variable.

Given the Hamiltonian, we can use Hamilton’s equations to

construct the equations of motion in a particular case.

Nonlinear Dynamics 9 Part 3: Hamiltonian Mechanics

Page 6: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamilton’s equations

If the dynamical variables are (qi, pi) and the independent

variable is t, Hamilton’s equations are:

dqidt

=∂H

∂pi,

dpidt

= −∂H

∂qi. (7)

where H = H(qi, pi; t) is the Hamiltonian.

In Newtonian mechanics, the momentum of a particle is

generally given by the product of the mass and the velocity,

i.e. p = mdq/dt.

In Hamiltonian mechanics, an expression for the momentum

can be obtained from Hamilton’s equations: the momentum is

not always the mass times the velocity.

The Hamiltonian must be expressed in terms of the

co-ordinates and the conjugate momenta, and not in terms of

the velocities.Nonlinear Dynamics 10 Part 3: Hamiltonian Mechanics

Example: the simple harmonic oscillator

In some simple cases, the Hamiltonian takes the form:

H = T + V, (8)

where T is the kinetic energy of the particle, and V is the

potential energy.

Consider a particle with mass m and co-ordinate q, moving in a

potential:

V =1

2kq2. (9)

In this case (not in general), the momentum is p = mq. Then,

the Hamiltonian takes the form:

H =1

2mp2 +

1

2kq2. (10)

Nonlinear Dynamics 11 Part 3: Hamiltonian Mechanics

Page 7: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Example: the simple harmonic oscillator

The first of Hamilton’s equations (7) gives:

dq

dt=∂H

∂p=

p

m. (11)

This tells us that the momentum in this case corresponds to

the usual mechanical momentum; i.e. the product of the mass

and the velocity, p = mdq/dt.

The second of Hamilton’s equations (7) gives:

dp

dt= −

∂H

∂q= −kq. (12)

This expresses Newton’s second law of motion for a force −kq.

Combining the two equations gives the familiar second-order

equation of motion for a simple harmonic oscillator:

d2q

dt2= −ω2q, where ω =

√k

m. (13)

Nonlinear Dynamics 12 Part 3: Hamiltonian Mechanics

Hamiltonian for a relativistic particle in an electromagnetic field

To apply Hamiltonian mechanics to a given system, we need to:

• define the dynamical variables;

• define the independent variable;

• write down the Hamiltonian that defines the physics of the

system.

Nonlinear Dynamics 13 Part 3: Hamiltonian Mechanics

Page 8: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamiltonian for a relativistic particle in an electromagnetic field

In the case of a relativistic particle in an electromagnetic field,

we can choose to work in a Cartesian co-ordinate system, with

co-ordinates x, y, z, and conjugate momenta px, py, pz.

We can choose the time t as the independent variable.

The Hamiltonian is:

H =√c2(~p− q ~A)2 +m2c4 + qϕ, (14)

where:

• c is the speed of light in free space,

• m is the mass of the particle,

• q is the electric charge of the particle,

• ~A is the vector potential,

• and ϕ is the scalar potential.

Nonlinear Dynamics 14 Part 3: Hamiltonian Mechanics

Hamiltonian for a relativistic particle in an electromagnetic field

Applying Hamilton’s equations with the Hamiltonian (14), wefind that the equations of motion for the co-ordinates give:

px = γmdx

dt+ qAx, (15)

and similarly for py and pz.

The equations of motion for the momenta lead to:

d2x

dt2=

q

γm

(Ex +

[~v × ~B

]x

), (16)

and similarly for y and z.

~v = (x, y, z) is the velocity of the particle.

The electric and magnetic fields ~E and ~B are derived from thepotentials ~A and ϕ in the usual way:

~B = ∇× ~A, ~E = −∇ϕ−∂ ~A

∂t. (17)

Nonlinear Dynamics 15 Part 3: Hamiltonian Mechanics

Page 9: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamiltonian for a relativistic particle in an electromagnetic field

Equation (16) is the equation of motion that we would write

down for a relativistic particle in an electromagnetic field, using

Newton’s second law and the Lorentz force equation.

There are formal methods to derive the Hamiltonian (starting

from the Lagrangian for a given system).

Ultimately, the form of the Hamiltonian can be justified by

whether it gives the correct (observed) dynamics.

Nonlinear Dynamics 16 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian

In a particle accelerator:

• It is convenient to work in a curved co-ordinate system,

with x and y the transverse co-ordinates with respect to

some “reference trajectory”.

• It is convenient to choose the distance s along the

reference trajectory as the independent variable.

For simplicity, we shall assume that the reference trajectory lies

in a horizontal plane.

Then, the reference trajectory can be defined by a sequence of

straight lines of given lengths, joined by lines with given lengths

and curvatures.

Nonlinear Dynamics 17 Part 3: Hamiltonian Mechanics

Page 10: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian

The longitudinal co-ordinate z of a particle is defined:

z(s) = c(t0 − t), (18)

where the particle arrives at s at time t, and a reference particle

(travelling along the reference trajectory with momentum P0)

arrives at s at time t0.

Nonlinear Dynamics 18 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian

If we were using Cartesian co-ordinates, and using time as the

independent variable, then we could just use the Hamiltonian

(14) for a particle in an accelerator beamline.

The dynamics at any point along the beamline would be

defined by the scalar and vector potential at the given point.

Since we are using a curved co-ordinate system, with path

length s as the independent variable, the Hamiltonian takes a

rather more complicated form.

It is possible to derive the accelerator Hamiltonian starting

from (14); but to save time we shall just quote the result.

For a full derivation of the accelerator Hamiltonian, see “Beam Dynamics in

High Energy Particle Accelerators” by A. Wolski.

Nonlinear Dynamics 19 Part 3: Hamiltonian Mechanics

Page 11: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian

The Hamiltonian for a charged particle in an acceleratorbeamline is:

H = −(1 + hx)

√(1

β0+ δ −

P0c

)2

−(px −

q

P0Ax

)2

−(py −

q

P0Ay

)2

−1

β20γ

20

−(1 + hx)q

P0As +

δ

β0. (19)

Here, P0 = β0γ0mc is the reference momentum (i.e. the

momentum of the reference particle, with velocity β0c).

h is the curvature of the reference trajectory (assumed to lie in

the x− s plane):

h =1

ρ, (20)

where ρ is the local radius of curvature.

Nonlinear Dynamics 20 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian

The momenta conjugate to the co-ordinates x and y are given

by:

px =γmx+ qAx

P0, py =

γmy + qAy

P0. (21)

Here, x and y are the transverse components of the velocity

(i.e. the time derivatives of the transverse co-ordinates).

γ is the relativistic factor for the particle (not necessarily equal

to γ0).

Nonlinear Dynamics 21 Part 3: Hamiltonian Mechanics

Page 12: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian

The longitudinal dynamical variables are (z, δ), where:

z = c(t0 − t), (22)

• t0 is the time at which the reference particle arrives at a

location s along the reference trajectory,

• t is the time at which the given particle crosses the plane

perpendicular to the reference trajectory at s.

Note that if t < t0, the chosen particle arrives at s sooner than

the reference particle, i.e. the chosen particle is ahead of the

reference particle.

The longitudinal conjugate momentum δ is defined by:

δ =E

P0c−

1

β0=E − E0

β0E0, (23)

where E is the kinetic energy of the particle, and E0 is the

kinetic energy of a particle with the reference momentum P0.

Nonlinear Dynamics 22 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian in a drift space

As an example, let us consider the Hamiltonian in a drift space,

where h = 0, and there are no electric or magnetic fields (so we

can take the scalar and vector potentials to be zero):

H = −

√√√√( 1

β0+ δ

)2

− p2x − p2

y −1

β20γ

20

β0. (24)

The Hamiltonian has no dependence on the co-ordinates x, y or

δ. This means, from Hamilton’s equations, that the momenta

are conserved:

dpx

ds= −

∂H

∂x= 0, (25)

dpy

ds= −

∂H

∂y= 0, (26)

ds= −

∂H

∂z= 0. (27)

Nonlinear Dynamics 23 Part 3: Hamiltonian Mechanics

Page 13: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian in a drift space

The equations of motion for the co-ordinates are also

reasonably straightforward:

dx

ds=

∂H

∂px=px

ps, (28)

dy

ds=

∂H

∂py=py

ps, (29)

dz

ds=

∂H

∂δ=

1

β0−

1β0

+ δ

ps, (30)

where we have defined ps (not a dynamical variable!) as:

ps =

√√√√( 1

β0+ δ

)2

− p2x − p2

y −1

β20γ

20. (31)

Note that since px, py and δ are constants of the motion, ps is

constant.

Nonlinear Dynamics 24 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian in a drift space

From the above results, it is possible to write the map for a

drift space in closed form.

For the transverse variables, we have:

x1 = x0 +px0

ps∆s, px1 = px0, (32)

y1 = y0 +py0

ps∆s, py1 = py0, (33)

where x0 = x(s0), x1 = x(s0 + ∆s), and similarly for the other

variables.

And for the longitudinal variables, we have:

z1 = z0 +

1

β0−

1β0

+ δ0

ps

∆s, δ1 = δ0. (34)

Nonlinear Dynamics 25 Part 3: Hamiltonian Mechanics

Page 14: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian in a drift space

The map has a nonlinear dependence on the momenta px, pyand δ. However, the nonlinear effects only become significant

when the values of the momenta become very large.

To illustrate this, consider the case py0 = δ0 = 0. Then:

ps =√

1− p2x0. (35)

In this case:

px =γ0mx

P0, so that lim

x→β0cpx = 1. (36)

The horizontal momentum px has a maximum value of 1, which

occurs when the particle is travelling perpendicular to the

reference trajectory.

Nonlinear Dynamics 26 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian in a drift space

Let us now plot:

∆x

∆s=

px0√1− p2

x0

, (37)

(where ∆x = x1 − x0) as a function of px0.

There is a significant deviation from linearity when px0 is largerthan about 0.1.

Nonlinear Dynamics 27 Part 3: Hamiltonian Mechanics

Page 15: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

The accelerator Hamiltonian in a drift space

In the case that px0 = py0 = 0, the particle is travelling parallelto the reference trajectory. Then, the Hamiltonian becomes:

H =δ

β0−

√√√√( 1

β0+ δ

)2

−1

β20γ

20. (38)

It follows that the equation of motion for the longitudinalco-ordinate is:

dz

ds=∂H

∂δ=

1

β0−

1β0

+ δ√(1β0

+ δ)2− 1β2

0γ20

. (39)

Since, from equation (23), we have:

δ =E − E0

β0E0=γ − γ0

β0γ0, ∴

1

β0+ δ =

γ

β0γ0, (40)

we find that:dz

ds=

1

β0−

1

β, (41)

which is consistent with our interpretation of z, equation (22).

Nonlinear Dynamics 28 Part 3: Hamiltonian Mechanics

The accelerator Hamiltonian in a drift space

Using a Hamiltonian approach, even the map for a drift space is

rather complicated.

It is possible to describe the dynamics using different variables,

that simplify the map. For example, instead of using px and py,

we could define:

x′ =dx

ds, and y′ =

dy

ds. (42)

Then, the (transverse) map for a drift space would simply be:

x1 = x0 + x′0 ∆s, x′1 = x′0, (43)

y1 = y0 + y′0 ∆s, y′1 = y′0, (44)

with no dependence at all on the energy deviation.

This looks much simpler – why do we bother with the

Hamiltonian? There are three reasons...

Nonlinear Dynamics 29 Part 3: Hamiltonian Mechanics

Page 16: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamiltonian mechanics and symplecticity

• Hamiltonian mechanics provides a highly systematic

framework for constructing the equations of motion for a

relativistic particle in even quite complicated

electromagnetic fields.

• Hamiltonian mechanics provides the basis for some powerful

analytical techniques for modelling and analysis of beam

dynamics.

• Proper use of Hamiltonian methods ensures the

conservation of phase space volumes (Liouville’s theorem),

which is a property of the physics of particles in accelerators

(nelgecting synchrotron radiation and collective effects).

Nonlinear Dynamics 30 Part 3: Hamiltonian Mechanics

Hamiltonian mechanics and symplecticity

Let ~x be a vector constructed from the phase space variables.

It is shown in Appendix A that if the values of the phase space

variables at position s+ ∆s on the reference trajectory are

given by ~X = ~X (~x(s); ∆s), then:

JTSJ = S, (45)

where J is the Jacobian of the transformation from s to s+ ∆s:

Jij =∂Xi∂xj

, (46)

and S is a block-diagonal matrix constructed from 2× 2

antisymmetric matrices S2:

S2 =

(0 1−1 0

). (47)

Any matrix that satisfies equation (45) is said to be a

symplectic matrix.

Nonlinear Dynamics 31 Part 3: Hamiltonian Mechanics

Page 17: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamiltonian mechanics and symplecticity

Since the determinant of S is unity:

|S| = 1, (48)

it follows from (45) that if J is the Jacobian of a symplecticmap, then:

|J |2 = 1, i.e. |J | = ±1, (49)

where |J | is the determinant of J.

For a map to be symplectic, it is a necessary (but notsufficient) condition for the Jacobian to have determinant ±1.

It follows immediately from this that symplectic maps preservevolumes in phase space:∫

. . .∫d ~X =

∫. . .

∫|J | d~x = ±

∫. . .

∫d~x. (50)

In the context of Hamilton mechanics, equation (50) is calledLiouville’s theorem.Nonlinear Dynamics 32 Part 3: Hamiltonian Mechanics

Hamiltonian mechanics and symplecticity

In accelerator beam dynamics, Liouville’s theorem says that asa bunch of particles is transported along a beamline (neglectingradiation and interactions between the particles) the volume ofphase space occupied by the particles remains constant.

The total volume in phase space is one of a number ofinvariants of Hamiltonian systems, known as Poincareinvariants. The others are not so easily expressed as thevolume of an element in phase space, and since we do not needthem in this course, we do not discuss them further.

However, it is worth mentioning that the eigenvalues of thematrix:

ΣS = 〈~x~xT〉S (51)

are conserved under a symplectic transformation.

The eigenvalues of ΣS are ±iεk, where k is an index over thedegrees of freedom of the system, and εk are the beamemittances.Nonlinear Dynamics 33 Part 3: Hamiltonian Mechanics

Page 18: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Hamiltonian mechanics and symplecticity

Liouville’s theorem is easiest to visualise in one degree of

freedom, with a linear map...

...but the theorem generalises to more degrees of freedom, and

nonlinear maps.

Nonlinear Dynamics 34 Part 3: Hamiltonian Mechanics

Hamiltonian mechanics and symplecticity

As an example of a symplectic map, consider again the case ofa drift space. To simplify things further, let us consider onlythe transverse motion. The map can be written:

X = x+pxs√

1− p2x

(52)

PX = px. (53)

The Jacobian is:

J =

∂X∂x

∂X∂px

∂PX∂x

∂PX∂px

=

1 s

(1−p2x)

3/2

0 1

. (54)

The Jacobian is a function of the dynamical variables; but wecan still work out the matrix product with S. We find, asexpected, that:

JTSJ = S.

The case of three degrees of freedom starts to look morecomplicated, but we still find that the map is symplectic.

Nonlinear Dynamics 35 Part 3: Hamiltonian Mechanics

Page 19: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Canonical transformations

In our discussion so far, we considered transformations from

one point along the reference trajectory to another.

However, we can also consider transformations that define a

new set of variables ~X in terms of an existing set ~x.

If the map is symplectic, then:

~X = ~X(~x), where∂ ~X

∂~x= J, and JTSJ = S. (55)

If the original variables ~x are canonical (i.e. obey Hamilton’s

equations) then the new set of variables are also canonical:

ifd~x

ds= S

∂H

∂~x, then

d ~X

ds= S

∂H

∂ ~X. (56)

A transformation from one set of canonical variables to another

is called a canonical transformation.Nonlinear Dynamics 36 Part 3: Hamiltonian Mechanics

Mixed variable generating functions

In Hamiltonian mechanics, there is a standard recipe for

constructing canonical transformations based on mixed variable

generating functions.

There are different types of mixed variable generating

functions, but in general a mixed variable generating function

can be expressed (as the name suggests) as a function of some

subset of the original and the new variables.

Nonlinear Dynamics 37 Part 3: Hamiltonian Mechanics

Page 20: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Mixed variable generating functions

For example a “mixed variable generating function of the

second kind” is expressed as a function of the original

co-ordinates qi and the new momenta Pi:

F2 = F2(qi, Pi, t). (57)

Then, the new variables are related to the old variables by:

pi =∂F2

∂qi, Qi =

∂F2

∂Pi. (58)

The Hamiltonian K giving the equations of motion in the new

variables is:

K = H =∂F2

∂t, (59)

where H is the Hamiltonian for the original variables.

For further discussion and some examples, see Appendix B.

Nonlinear Dynamics 38 Part 3: Hamiltonian Mechanics

Canonical transformations: action–angle variables

Sometimes, it is convenient to work with dynamical variablesother than the “cartesian” variables (x, px, y, py, z, δ). This is thecase in nonlinear dynamics, where we often use “action–angle”variables.

The action–angle variables (Jx, φx) for the horizontal motionare defined by:

2Jx = γxx2 + 2αxxpx + βxp

2x, (60)

tanφx = −αx − βxpx

x. (61)

Here, αx, βx and γx are the usual Courant–Snyder parameters,defined for linear motion.

It can be shown (an exercise for the student!) that theJacobian of the transformation is symplectic: therefore, (φx, Jx)are canonical variables. (Note that the angle φx is theco-ordinate, and the action Jx is the conjugate momentum).

Nonlinear Dynamics 39 Part 3: Hamiltonian Mechanics

Page 21: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Canonical transformations: action–angle variables

Action–angle variables are useful for linear dynamics. In that

case, we know that the betatron action is constant, and that

the rate of increase of betatron phase is given by 1/βx:

dφx

ds=

1

βx, (62)

dJx

ds= 0. (63)

Since action–angle variables are canonical variables, it should

be possible to obtain these equations of motion from a suitable

Hamiltonian. In fact, an appropriate Hamiltonian is given by:

H =Jx

βx. (64)

Action–angle variables are particularly useful in nonlinear

dynamics, and we shall make extensive use of them in the

following lectures.

Nonlinear Dynamics 40 Part 3: Hamiltonian Mechanics

Summary

• The equations of motion for a particle moving through electromagneticfields in an accelerator beamline (neglecting radiation and interactionsbetween particles) can be derived from Hamilton’s equations, with anappropriate Hamiltonian.

• Expressed in canonical variables, the transformation representing motionof a particle from one point along a beamline to another is symplectic(that is, the Jacobian of the transformation is a symplectic matrix).

• A symplectic transformation from one set of variables to another iscalled a canonical transformation. Sometimes, canonicaltransformations provide a way to simplify the equations of motion.

• An example of a canonical transformation is provided by therelationships between action–angle variables and the usual cartesianvariables. Action-angle variables are widely used in accelerator beamdynamics.

• Canonical transformations can be constructed using mixed variablegenerating functions.

Nonlinear Dynamics 41 Part 3: Hamiltonian Mechanics

Page 22: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Exercises

1. Write down the Hamiltonian for (a) a dipole magnet, and

(b) a quadrupole magnet. Are the dynamics linear or

nonlinear in each case?

2. Show that the transformation from cartesian to

action–angle variables is canonical.

3. Show that the transformation from cartesian to

action–angle variables may be obtained from the generating

function (97):

F1(x, φx) = −x2

2βx(tanφx + αx) .

Nonlinear Dynamics 42 Part 3: Hamiltonian Mechanics

Appendix A: Hamiltonian mechanics and symplecticity

To prove equation (45), first note that with ~x given by:

~x = (x, px, y, py, z, δ) , (65)

Hamilton’s equations may be written:

d~x

ds= S

∂H

∂~x. (66)

We will assume that we work inside a given accelerator

element, where the Hamiltonian H is independent of s. At

some position in the element, the variables can be expressed as

functions of the variables at some earlier position, i.e.:

~X = ~X (~x(s); ∆s) . (67)

The changes in the variables with respect to motion along the

reference trajectory are related by the Jacobian J:

d ~X

ds=∂ ~X

∂~x

d~x

ds= J

d~x

ds= JS

∂H

∂~x. (68)

Nonlinear Dynamics 43 Part 3: Hamiltonian Mechanics

Page 23: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Appendix A: Hamiltonian mechanics and symplecticity

Now, since:

∂H

∂~x= JT∂H

∂ ~X, (69)

we find that:

d ~X

ds= JSJT∂H

∂ ~X. (70)

But the evolution of the variables ~X must be determined by

Hamilton’s equations, with the same Hamiltonian that governs

the evolution of the variables ~x:

d ~X

ds= S

∂H

∂ ~X. (71)

Comparing equations (70) and (71), it is clear that:

JSJT = S. (72)

Nonlinear Dynamics 44 Part 3: Hamiltonian Mechanics

Appendix A: Hamiltonian mechanics and symplecticity

Using the properties:

S−1 = ST = −S, and(J−1

)T=(JT)−1

, (73)

equation (72) may be rewritten as (45):

JTSJ = S.

This means that for a system governed by Hamilton’s

equations, the Jacobian of the map from s to s+ ∆s must be a

symplectic matrix. For short, we say that the map must be

symplectic.

Note that for a linear map, the Jacobian is simply a matrix of

numbers. For a nonlinear map, the Jacobian will be a function

of the phase space variables ~x; but equation (45) must still

hold.

Nonlinear Dynamics 45 Part 3: Hamiltonian Mechanics

Page 24: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Appendix B: mixed variable generating functions

There is a useful recipe (or rather, set of recipes) for

constructing canonical transformations. The technique is based

on generating functions.

Many standard texts on classical mechanics give a full

discussion of generating functions, including a derivation of the

main formulae. See, for example, Goldstein.

Here, we simply present the results, and give an example. Since

the results are general (i.e. not specific to accelerator beam

dynamics) we revert to a general notation in which the

co-ordinates are denoted qi, the conjugate momenta are pi, and

the independent variable is t.

Nonlinear Dynamics 46 Part 3: Hamiltonian Mechanics

Appendix B: mixed variable generating functions

Let us define a function F1 of the “old” co-ordinates qi and the

“new” co-ordinates Qi. In general, F1 may also be a function

of the independent variable, t:

F1 = F1(qi, Qi, t). (74)

Then, F1 generates a canonical transformation, in which the

relationships between the old and new variables is given by:

pi =∂F1

qi, Pi = −

∂F1

Qi. (75)

Here, pi are the momenta conjugate to qi, and Pi are the

momenta conjugate to Qi. The Hamiltonian for the new

variables is given by:

K = H +∂F1

∂t. (76)

Nonlinear Dynamics 47 Part 3: Hamiltonian Mechanics

Page 25: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Appendix B: mixed variable generating functions

Canonical transformations can be useful in simplifying the

equations of motion. For example, suppose that we have a

system in one degree of freedom, whose dynamics are governed

by the Hamiltonian:

H = p2 − 6pq2 + q2 + 9q4. (77)

The equations of motion are nonlinear, and difficult to solve.

However, let us make a canonical transformation to new

variables, using the generating function:

F1(q,Q) = qQ+ q3. (78)

Using equations (75), we find:

p =∂F1

∂q= Q+ 3q2, ∴ Q = p− 3q2, (79)

and:

P = −∂F1

∂Q= −q. (80)

Nonlinear Dynamics 48 Part 3: Hamiltonian Mechanics

Appendix B: mixed variable generating functions

The new variables expressed in terms of the old variables are:

Q = p− 3q2, and P = −q. (81)

The old variables expressed in terms of the new variables are:

q = −P, and p = Q+ 3P2. (82)

Using (76), (77) and (82) the new Hamiltonian K, which givesthe equations of motion expressed in terms of the newvariables, is:

K = H +∂F1

∂t= p2 − 6pq2 + q2 + 9q4 = P2 +Q2. (83)

In terms of the new variables, the equations of motion aresimply those for an harmonic oscillator. We can easily solve theequations of motion in the new variables, then transform backto the old variables, using (82).

Note: if you thought that the original Hamiltonian (77) was contrived to

allow an easy solution using a relatively simple generating function, you

would be right... In general, it is not easy to solve problems in this way.

Nonlinear Dynamics 49 Part 3: Hamiltonian Mechanics

Page 26: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Appendix B: mixed variable generating functions

The generating function we introduced above, F1(qi, Qi, t), was

a function of the old co-ordinates and the new co-ordinates.

But of course, if we are going to mix up old and new variables,

there are four different ways to do it. Each of these leads to a

different “kind” of generating function, each with its own set

of relationships between the old and new variables.

We have already met F1, a “generating function of the first

kind”:

F1 = F1(qi, Qi, t), (84)

pi =∂F1

∂qi, Pi = −

∂F1

∂Qi, (85)

K = H +∂F1

∂t. (86)

Nonlinear Dynamics 50 Part 3: Hamiltonian Mechanics

Appendix B: mixed variable generating functions

F2 is a “generating function of the second kind”:

F2 = F2(qi, Pi, t), (87)

pi =∂F2

∂qi, Qi =

∂F2

∂Pi, (88)

K = H +∂F2

∂t. (89)

It is possible to express the identity transformation in terms of

a generating function of the second kind:

F2(qi, Pi) =∑i

qiPi. (90)

Nonlinear Dynamics 51 Part 3: Hamiltonian Mechanics

Page 27: Nonlinear Single-Particle Dynamics in High Energy Accelerators · Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 3: Hamiltonian Mechanics Nonlinear Single-Particle

Appendix B: mixed variable generating functions

F3 is a “generating function of the third kind”:

F3 = F3(pi, Qi, t), (91)

qi = −∂F3

∂pi, Pi = −

∂F3

∂Qi, (92)

K = H +∂F3

∂t. (93)

And finally, F4 is a “generating function of the fourth kind”:

F4 = F4(pi, Pi, t), (94)

qi = −∂F4

∂pi, Qi =

∂F4

∂Pi, (95)

K = H +∂F4

∂t. (96)

Nonlinear Dynamics 52 Part 3: Hamiltonian Mechanics

Appendix B: mixed variable generating functions

Finally, we note that since action–angle variables (φx, Jx) are

obtained from cartesian variables (x, px) by a canonical

transformation, we would expect that we can write down a

generating function for the transformation (although note that

we have not shown that every canonical transformation can be

obtained from some generating function).

We can construct the canonical transformation from cartesian

to action–angle variables using a generating function of the

first kind:

F1(x, φx) = −x2

2βx(tanφx + αx) . (97)

Nonlinear Dynamics 53 Part 3: Hamiltonian Mechanics