The 13th Symp05ium on Accelerator Science and Technology, Suita, Osaka, Japan, October 2001

DEVELOP MENT OF A TRACKIN G AND ANALYSIS CODE FOR
BEAM DYNAMIC S IN SPRING-S
J. Schimizu1, K. Soutome, M.Takao and H. Tanaka, SPring-8/JASRI, Hyogo 679-5198, Japan
Abstract
A tracking and analysis code for baem dynamics has
been developed in SPring-8. Exact Hamiltonian, notlinearized, is used to derive equations of motion in thecode. The equations of motion include radiation losses, if
specified These equations of motion are solved bysymplectic integration method for basic devices such as
drift space, bending, quadrupole and sextupole magnets,
though filed errors and steering magnets are treated as
kicks and RF cavities are also treated as thin elements.
The code has been extended from four dimensions to six
dimensions and effective analytical tools have beendeveloped in this code system.

1 INTRODUC TION
Nowadays, one pursues ultimate performance of anaccelerator, for example, high current of ampere order and
sub-nmrad beam emittance. It is natural that one should
design or modify an accelerator carefully and also
optimize or re-optimize its parameters precisely. To thisend, one needs a computer code which can exactly
simulate nonlinear particle motion including direct andindirect particle-particle interaction.
We started to improve RACETRACK [1] which is akick code on the basis of 4 by 4 linearized Hamiltonianin the beginning of SPring-8 project [2]. Many functions,i.e., a beam injection simulator, a closed orbit distortion(COD) correction package, a 4 by 4 optics and emittancecalculation routine and so on were ad:lxi step by step tomeet our requirement. Toward the normal mode analysis
on higher order nonlinear effects, well-known differential
algebra algorithm [3] was introduced into the code toextract one turn map.
The code was modified drastically in the period from1997 to 2000. We gave up the 4 by 4 linearized
Hamiltonian, i.e., RACETRACK to precisely simulate
beam dynamics in new optics with four magnet-free longstraight sections [4,5]. Here, we aropted 6 by 6 exact
Hamiltonian having full kinematics terms. This meansthat all components· of an accelerator become nonlinear
and we can not use a simple transfer matrix for any
element. By expanding the code from 4 by 4 to 6 by 6formalism, we can qualitatively estimate nonlinear
particle motion with a large energy deviation and also
particle motion under large chromaticity.
In parallel, we developed various analyticalformulation on nonlinear beam motion [6, 7,8] to analyze
beam behavior in the real ring. Those were installed inour code as analytical tools. To make realistic
simulation, it is also important to estimate real error
1

distribution in the ring. From this point of view, aModel Calibration Method (MCM) package wasdeveloped [9, 10].
Recently, to estimate a momentum acceptance
precisely and simulate top-up operation, we developed asynchrotron radiation handling package. This package has
two options: the expected value option and the cpantum
photon option. We are now developing both a normal
mode analysis package and a 6 by 6 optics and emittancecalculation routine. We are also trying to include a shortrange wake-field effect for more precise simulation of real
beam behavior.

2 CODE CONSTRUC TION
The code construction is shown in Fig.l. The ringparameter handler determines the lattice structure fromelement and structure data read from files specified by thejob control data Field error information is prepared byresponse analysis and taken into the code, if necessary[9, 10]. Alignment errors can be included in the element
data.

# Dispersion Corre:ticn# ••••••••# Dynamic Apperture# Inje:ticn Efficien::y & I3ean Inje:ticn Sinulatim# Anplitude depende:lt 'lime Shift# ...•..

# N:ru:!near On:ara.ticity ~ to 3n:l anler# N:ru:!near Dispesian up to 5th anler# N:ru:!near Local Chraraticity

Figure 1: Code construction. A single asterisk indicatesthat the packages are in 4 by 4 formalism, and double
asterisks indicate that the package is now underconstruction.
The closed orbit finder in 6 dimensional form
determines the closed orbit with some correction utilities

Permanent address: The Japan Research Inst. Ltd., Osaka 550-0013, Japan-80-The 13th Symposium on Accelerator Science and Technology, Suita, Osaka, Japan, October 2001

such as COD correction, chromaticity correction and soon, if necessary. When the lattice includes no cavities andthe radiation option is not activated, this closed orbit
finder uses 4 dimensional form. In 6 dimensional closed
orbit search, RF frequency or momentum deviation 8p/p
is searched dependending on the selected option. Duringclosed orbit search, the code uses expected values ofradiation energies. Then one-tum map in 6 dimensional
form is determined.
After one tum map extraction, two functions areavailable in the code. One is the tracking and the other isthe eigen mode analysis [6, 7, 8]. Normal form analysis
package will be actl::d in the code construction near future.
Though the tracking package is in full 6 dimensional
form, eigen mode analysis packages are not in 6
dimensional form yet.
In tracking package, the code has two radiation
options, if radiation option is activated One is theexpected value option and the other is the quantum
photon option. The expected value option uses expectedvalue of radiation energy, while quantum photon option
uses quantum photon energy determined by random
number and energy spectrum of photons.

3 EQUATION OF MOTION
3.1 HamiltonianH=po- ( 1 + Kxx + Kyy )[{(1+8)2 _ Px2 _ Py2 }1/2
- ( 1 + Kxx + Kyy) 2/2 + go(x2 _ y2)f2+A. 0 (x3 - 3xy2)f6- (L/2nk)(q/p0 c)V{ cos(2nkcr/L +A <1> )+crsin<j> 0 } ].

The last term of eq. (10) is for the cavity, and <l>o = 0, if
radiation option is activated The symbol k is theharmonic number and L is the circumference of the ring.
Here, multi-poles higher than sextupole are neglected,
though they can be treated as kicks in the code. The
equations of motion are derived from eqs. (5) to (7) and(1 0). The vector potentials used for the insertion device
are basically the same as Ref. [11].

3. 2 Symplectic Integrators
For Hamiltonian systems of the form
H = T(p) + V(q),(11)there exist explicit symplectic algorithms [12]. As theHamiltonians for the quadrupole and sextupole magnets
are given by the form of eq. (11), symplectic integrators
for the quachupole and sextupole magnets can be explicit
integrators. We have adopted the fourth order integrator
given as follows:

The Hamiltonian used in the code is given by
H = Po - h[ {(1 +8)2 - (Px - qAx IP 0 ) 2- (Py - qAy IP 0 ) 2 }112 - qAs IP 0 ],(1)

Cfi = Cfi-1 + -r q( aTl aP)p=p,_ 1,(12)Pi =Pi-1- 't dj(aV/aq)q=q,,(13)

for i=1 to 4, where 't is the integration step width.

q = C4 = 1 I [2(2- 2113)],where
8 = (p - Po)/Po,(2)C2 = C3 = (1 - 2 1/3) I [2(2- 2113)],h = 1 + Kxx + Kyy,

(3)d1 = ~ = 1 I (2 - 2113),(4)
Pcr = (E - Eo)/povo
and subscript 0 means the value corresponding to design
ones, Kx and Ky are the curvature of the x- and ydirection, respectively. The Hamiltonian and canonicalmomenta Px and Py in eq.(1) are normalized by theproduct of design momentum and light velocity, PoC.
This Hamiltonian is basically the same as Ref. [6], but
modified to include synchrotron motion term Po·
The equations of motion are as follows:aHI aPx,y' = aHI aPy,
cr' = aHI ap
x' =0 ,

cr = s - v0 t.

=-a HI ax+ rx,
Py' =-a HI ay + ry,
p =-a HI acr + r
Px'0 '0 ,

(5)
(6)
(7)
(8)

The symbol cr is the deviation of the longitudinal
position from the bunch center. Radiation loss is
considered as rx, ry and r0 in eqs.(5) to (7). It is assumed
that photons are emitted toward the direction ofpropagation. We have
Ax= Ay = 0(9)for all the elements except insertion devices. Then theHamiltonian becomes(10)d], = - 2113 I (2- 2113), d:t = 0.

(14)Symplectic integrator for the cb:ift space is the same as
the transfer matrix except cr calculation, and theintegration step width is taken as the length of the cb:ift
space, i.e. one step integration.
The Hamiltonian for the bending magnet is not givenin the form of eq. (11), so the symplectic integrator forthe bending magnet should be implicit, if generating
function cannot be found We have adopted the simplest
first order implicit integrator given byz' = z + 't f((z + z')/2)(15)
which is known as the implicit midpoint rule.
The explicit first order symplectic integrator forinsertion devices can be derived by means of generating
function [11].
Field errors, steering magnets and RF cavities are stilltreated as kicks. Thin lenses treated as kicks are
essentially symplectic.

4 EXAMPLES
Some examples of the simulation are shown in thissection. First, Fig.2 shows the experimental data and the- 81-

The 13th Symposium on Accelerator Science and Technology, Suita, Osaka, Japan, October 2001

results of horizontal chromaticity calculation. We findthe thin lens approximation of sextupoles is not valid in
the region where the absolute value of momentum
d!viation Op/p is large. This shows that the thick magnet
treatment of sextupole is essential in nonlinear chromaticbehavior.
In Fig.2, the result of the 3rd ord!r nonlinear
chromaticity calculation is also shown. In the range data
exist, results of exact 3rd ord!r calculation and tracking
with thick sextupoles agree with experimental data.
Secondly, tune shift was computed for BL19XU (25mundulator) which. was installed in the long straightsection of SPring-8 last year. Figure 3 shows the relationof tune shift and gap width calculated by the cod!. Theagreement of the calculation with data is fairly well.
As an example of 6-dimensional calculation, Fig.4
shows ds(d!viation from bunch center)-E(particle energy)
phase diagrams for injection mod! simulation. In Fig.4,initial O"dg, standard d!viation of the bunch length, isooubled to enhance the shape d!velopment of the phase
diagrams.

integrators. Nonlinear effects such as dispersion andchromaticity can be explained by the cod!. The cored!veloped simulates the nonlinear beam motion well in
SPring-8 storage ring.
case-r04 : 101-th tum : kw

s:79007850
7800• Experiment-Tracking (Thin Sext.+Linear H )-Numerical Calc. by DA (Thick Sext. +Nonlinear H-·-.. Exact 3rd Equation?

~ 80506 80007950:-.: ..

7900
7850

40

80

-40

-80

ds (flllll),....,9050~.·-··"':~~ 9000 ~• :"'~ ~:~~ ~·..

•••

. ; .....:· ...

~:601-th t:u:m: lew'------······ ----- ........................................... ,8150 ~8100~ 9050:fi

E eooo fLLI

7950 ~
7900 ~;:~~ '-r·-~-~-~__j-eo-40-40ds (111m)

8200

ds (tllll'l)case-r04 :901-th tum : lao~...................... .

9150
9100

:~~ ..

-40{nm)ease--x()48200

7950 ~
7900 '---~-~-~--'

-eo

80
ds

aiSe--rOf, :401-t:h tum : lew
8200 r···: ····························································19150 ~
9100 ~-80

8200"case-r04 :10()0-tb tum : lOW'-·······················•·····················

8150
9100
8050
8000.·~;:;:; 7950
7900
7850
7900 '---~-~-~--'>
l:40
ds (INII.). ·~~=.
...·-40

as (Dill)"Figure . 4: An example of ds-E phase diagram. From
upper left to lower right, 101-th, 201-th to 1000-th turnafter beam injection at each 200 tum step. Four hundreds
macro-particles are injected.

43.4§E-<0!

= 43.30·£!0:t:..

8100....~'!'"-~

5 79508200

8150~-8000

>

43.5

8150
8100
8050

8050
~ 8000;:;:; 7950
7900
7850
7800 '---~-~-~--'

Horizontal Chromaticity (HHLV Optics)

43.6

case-r04 :201-th tum : lew.......

8200

43.2

REFERENCES

43.1

43~~~~~~~~~~~~~~~~~~

·0.04

-0.03

-0.02

-0.01

00,01

0.02

0.03

liplp

Figure 2: Typical horizontal chromaticity as a functionof op/p.

.........~.....~.......:::::::::::::::"=='"·------+-0.002 1!:-'0~-7,15,.........~2~0~"':2':"5~~30~'-";3:!;-5~'"';40~~45,.........~50
IDGapg[mm]Figure 3: Tune shift by insertion <£vise. The open circlesand solid circles are horizontal tune shift and vertical tune
shift, respectively.

5 SUMMARY
We have d!veloped a tracking and analysis cod! whichuses equations of motion d!rived from exact Hamiltonian.
The equations of motion are solved by symplectic[1] A. Wrulich, DESY 84-026 (1984).
[2] H. Kamitsubo, "8GeV Synchrotron Radiation
Facility Project in Japan: JAERI-RIKEN SPring-8Project", NIM A303 421-434, 1991.
[3] M. Berz, ''Differential Algebra Description on Beam
Dynamics to Very High Orders", Particle accelerators
24, 109-124 (1989).
[4] H. Tanaka et al., "Optimization of Optics with fourLong Straight Sections of 30m for SPring-S Storage
Ring", EPAC2000, Wienna, June 2000, p.1086.
[5] H. Tanaka et al., to. be published.
[6] H. Tanaka et al., "A perturbative Formulation of
Nonlinear Dispersion for Particle Motion in Storage
Rings", NIM A431 396-404, 1999.
[7] M. Takao et al., to be published.
[8] M. Takao et al., Proc.l9th PAC, Chicago, June 1822, 2001.
[9] G. Liu et al., Proc. 18th PAC, New York, 29 Mar.2 Apr., 1999, p.2337.
[10] H. Tanaka et al., Proc. of this conference.
[11] E. Forest and K. Ohmi, "Symplectic Integration forComplex Wigglers", KEK Report 92-14, September
1992.
[12] H. Yoshida, "Recent Progress in the Theory andApplication of Symplectic Integrators", Celestial
Mechanics and Dynamical Astronomy 56, 27-43(1993)-82-