Modelling I - The Cockcroft Institute · 2011-09-15 · Broad approaches FFAG School 2011,...
Transcript of Modelling I - The Cockcroft Institute · 2011-09-15 · Broad approaches FFAG School 2011,...
Modelling I
David KelliherASTeC/RAL/STFC
FFAG School, FFAG11, Daresbury
Accelerator codes - why we need them
• Design accelerator
• Establish likely machine performance
• Develop commissioning strategies
• Diagnose problems in operating machine and suggest corrective measures.
FFAG School 2011, Daresbury, UK
Broad approaches
FFAG School 2011, Daresbury, UK
Lorentz Force BvqqEF
• Track motion of single particle through simulated magnets and cavities. (e.g ray-tracing codes such as Zgoubi)
• Create map that represents the accelerator – matrix/map based codes. Basis of beam optics codes (MAD-X, SAD etc)
• Deal with collective effects – space charge, wakefields etc. Beam dynamics codes (Orbit, Simpson, Impact, ...)
qqm
H Ap2
1Hamiltonian
Beam Optics vs Beam Dynamics codes
• Beam Optics codes– Fast, good for initial design and tuning
– Matrix based, usually to first order
– Hard-edge field approximation
– Space charge forces approximated (if included at all)
• Beam dynamics codes– Slower, good for detailed studies
– Particle tracking, all orders included
– 3D field maps
– Solve Poisson equation at every step
FFAG School 2011, Daresbury, UK
MAP APPROACHMAD, MARYLIE, PTC , COSY INFINITY...
FFAG School 2011, Daresbury, UK
Map approach
• In general, can construct a one-turn map of an accelerator
• To third order may write
• To follow perturbative method, truncate Taylor Series at some order. However, map will no longer be symplectic, i.e. is not fully consistent with Hamilton’s equation.
FFAG School 2011, Daresbury, UK
oMzz
...,,,
dcb
o
d
o
c
o
babcd
cb
o
c
o
babc
b
o
baba zzzUzzTzRz
321321 ,,,,, pppqqqz
Hamiltonian
• Hamiltonian for particle motion in a curved reference system with bending radius ρ
• Hamilton’s equations of motion
where the following are canonical pairs of variables
• Normalise variables with respect to ideal momentum ps and apply
canonical transformation so that E1,t1 are expressed as deviations w.r.t. fixed reference frame. Can then apply perturbative approach.
FFAG School 2011, Daresbury, UK
2
1
2222
2
11 yyxxs qApqApmcqE
cqA
xH
tEpypx yx ,,,,,
)3,2,1(,,
i
q
H
t
p
p
H
t
q
i
i
i
i
Symplecticity
• Jacobian
• Symplectic condition
• Symplectic map conserves phase space volume – Liouville
• Lack of symplecticity leads to unphysical growth or damping of phase space volume
FFAG School 2011, Daresbury, UK
JJMM T
0I-
I0J
Lie Algebra
• Lie algebra used in studying differentiable manifolds
• Poisson Bracket on differentiable functions f(q,p), g(q,p)
• Lie Operator
• Lie Transformation – operation on phase space vector z
FFAG School 2011, Daresbury, UK
iiik i q
g
p
f
p
g
q
fgf
3
1
,
iiik i qp
f
pq
ff
3
1
:: ],[:: gff
0
::
!
::
m
mf
m
fe ...
!2
]],[,[],[:: a
aaa
f zffzfzze
]],[,[:: 2 gffgf
)3,2,1(],,[],,[
iHp
t
pHq
t
qi
ii
i
Lie Algebraic Map
• Dragt-Finn factorisation theorom (1976) - A symplectic map can be written as an infinite product of Lie transformations.
• Can truncate at any stage, still left with a symplectic map.
• Lie representatinon minimises number of parameters up to a given order.
FFAG School 2011, Daresbury, UK
...:::::: 432 fff
eeeM
Transfer Matrix Corresponding Lie Transformation
R exp(f2)
T exp(f3)
U exp(f3)exp(f4)
Putting one-turn map together
• Build up library of (f2, f3, f4) for each lattice element.
• Concatenate successive maps using Lie algebraic tools
• May still need to approximate calculation of f3, f4. Calculation will still be symplectic to some order.
• Much faster operating on map than tracking through many elements.
FFAG School 2011, Daresbury, UK
:::::: 432 fff
f eeeM
:::::: 432 ggg
g eeeM
:::::: 432 hhh
gfh eeeMMM
A. Chao
Normal form analysis
• Identifies a transformation A that recasts the one-turn map Minto a block diagonal matrix N.
• Extract tune from the invariant quantity N
• Extract s-dependent parameters such as linear lattice functions from transformation A.
• Can generalise to higher order maps and obtain non-linear effects such as tune variation with amplitude, coupled lattice functions etc
FFAG School 2011, Daresbury, UK
1 ANAM
Differential Algebra
• Map not just particle coordinates z but all its derivatives.
• DA can be used to efficiently compute maps to arbitrarily high order.
• Implementation easiest in an object oriented programming language
FFAG School 2011, Daresbury, UK
Integration methods (I)
FFAG School 2011, Daresbury, UK
xp
px
Equations for simple harmonic oscillator
Euler’s method
nnn
nnn
hxpp
hpxx
1
1Error of order h => first order method
2nd order Runge-Kutta (RK2)(Midpoint method)
pp
nn
xx
nn
x
n
pp
n
x
n
p
n
x
kkh
pp
kkh
xx
hkxkhkpk
xkpk
211
211
1212
11
2
2
,
,
Error of order h2
4th order Runge-Kutta (RK4) Trade off between accuracy and computational cost means RK4 is highest order used in practice.
Integration methods (II)
FFAG School 2011, Daresbury, UK
1
2
1
2
3
2
11
nnn
nnn
xhFvv
hvxx
Leapfrog integration (Second order integrator)
JJMM T Can show that the leapfrog method is symplectic
Integration methods (III)
• Forest-Ruth fourth order symplectic integrator (1990)
• Yoshida produced 6th and 8th order integrators, but with many more substeps.
FFAG School 2011, Daresbury, UK
xhFvv
vh
xx
xhFvv
vh
xx
21
21
2
1 72 63 5 4
3 22
1
Applications in celestial mechanics!
CODES USED FOR FFAG MODELLINGPTC, Zgoubi, S-code...
FFAG School 2011, Daresbury, UK
MAD8/MAD-X
• Not an ideal code for FFAG modelling – e.g. assumes reference beam travels through centre of elements.
FFAG School 2011, Daresbury, UK
beam; periodL:=0.394481;periodN:=42; qf: quadrupole,l=0.058782,k1:=+15;qd: quadrupole,l=0.075699,k1:=-11.8;ld: drift,l=0.21; sd: drift,l=0.05; kink: yrotation, angle=-2*pi/periodN; cell: line=(ld,qf,sd,qd,kink);ring: line=(42*cell);
FFAGs – modelling issues
• Particle design orbit need not follow the layout of magnet elements
• Non-linear fields in magnet body
• Fringe field effects may be more significant than in a synchrotron
• Complicated edges
• Space charge – beam not at centre of vacuum vessel, influence of one beam on another
FFAG School 2011, Daresbury, UK
PTC (E. Forest)
• Creates Taylor map using FPP package. Makes use of Lie Algebra, DA package and Normal Form.
• Symplectic integrator (several methods)
• Lattice constructed from a linked list of fibres, that in turn point to magnets. Allows construction of non-standard accelerator topologies – recirculators, colliders etc.
FFAG School 2011, Daresbury, UK
PTC and EMMA
FFAG School 2011, Daresbury, UK
• PTC can handle the displaced quadrupole doublets that make up EMMA• Analytic form of quadrupole fringe fields included• Currently, PTC has no analytic representation of scaling FFAGs.
S-code (S. Machida)
• Layout of magnets defined in a global coordinate system.
• Field profile of each magnet defined in local coordinates.
• Magnetic field derived from vector potential of each element, using an Enge funcion to describe the fringe field fall off.
• Elements include wedge and rectangular shaped scaling FFAG magnets.
• Integrate using a drift-kick scheme.
FFAG School 2011, Daresbury, UK
S-code integration method
• Drift-kick scheme – at each slice update momentum. Proceed in straight line to next slice.
FFAG School 2011, Daresbury, UK
5.02
,
2
,
2
,
,
,
,,
,
,
,,
newznewyoldnewx
x
oldx
oldy
yoldznewz
zx
oldx
oldz
oldynewy
pppp
xBp
pBepp
xBBp
pepp
0,0 EB
x
y
Zgoubi (F. Méot)
• Ray-tracing code which allows tracking in field maps and analytic models
• A wide variety of optical elements available, including a wedge shape and spiral shape scaling FFAG magnet
• Integrate Lorentz equation via truncated Taylor expansion of parameters
• Calculate u0 and its derivatives from Lorentz then find (R1, u1)
FFAG School 2011, Daresbury, UK
BuE
uu v
BB '' ds
d
v
uu
vu ',
!6...
!2
6'''''
0
'
00
su
susuRR 01
!5...
!2
5'''''
0
''
0
'
00
su
susuuu1
Zgoubi and FFAGs
FFAG School 2011, Daresbury, UK
KEK 150 MeV radial sector FFAG
J. Fourrier
RACCAM 180 MeV spiral FFAG
PyZgoubi (S. Tygier)
• Python interface that minimises the effort involved in creating a Zgoubi data file and processing the results.
FFAG School 2011, Daresbury, UK
COLLECTIVE EFFECTS
FFAG School 2011, Daresbury, UK
Space-Charge
• Collective effects : charged particles mutually interact and with conductive walls of vacuum chamber.
• Space-charge effect due to Coulomb interactions. Particle experience self-field of bunch.
• Leads to emittance blow-up, halo formation, tune shift etc. Effect decreases with 2.
• For bunch charge distribution , code solves Poisson’s equation over a mesh with boundary conditions
FFAG School 2011, Daresbury, UK
2
0
2
Space-Charge calculations
• Space-charge calculations time consuming. Include limited number of space-charge kicks per element. Non-SC tracking in between.
• Boundary often approximated by rectangle or circle.
• Poisson’s equation solved using– Finite difference methods
– Finite element methods
– FFT approach
– SOR, LU decomposition
– Wavelet methods
FFAG School 2011, Daresbury, UK
Split-operator method
FFAG School 2011, Daresbury, UK
Code timeline
FFAG School 2011, Daresbury, UK
PyZgoubi and space charge (S. Tygier)
• Interleave tracking and space-charge steps.
• Bunch extracted from Zgoubi and passed to separate space charge solver, resulting bunch passed back to Zgoubi .
FFAG School 2011, Daresbury, UK
Summary
• Many advances in accelerator modelling codes in the last decades
• Latest tools should be used in our FFAG codes.
• Increasingly sophisticated code required to model space-charge and other collective effects in FFAGs.
FFAG School 2011, Daresbury, UK
Bibliography
FFAG School 2011, Daresbury, UK
• E. Forest, “Geometric integration for particle accelerators”, J. Phys. A: Math. Gen. 39 (2006) 5321–5377
• S. Machida, “S-code for Accelerator Design and Particle Tracking”, Int J Mod Phys A 26 (10-11) 1794-1806 (2011)
• MaryLie Documentation (http://www.physics.umd.edu/dsat/dsatmarylie.html)
• Zgoubi (sourceforge.net/projects/zgoubi)
• PyZgoubi (www.hep.man.ac.uk/u/sam/pyzgoubi)