Post on 17-Dec-2015
UKNF WP1 meeting, 12/11/08
Zgoubi
Zgoubi is a ray-tracing code that computes particle trajectories in arbitrary magnetic and/or electric field maps or analytical models. The code is a compendium of numerical recipes for simulation of mode optical elements encountered in beam optics
Uses an integration method founded on stepwise resolution of the Lorentz equation using a technique based on Taylor series
C.R. Prior, “Start to end simulation of a Neutrino Factory”, IDS-NF-003
UKNF WP1 meeting, 12/11/08
Integration methodUse truncated Taylor series for position and normalised velocity
Calculating R to the sixth order requires 4th derivative of B(s)
Obtain velocity terms via Lorentz equation
UKNF WP1 meeting, 12/11/08
Running Zgoubi
zgoubi.dat Run zgoubi zgoubi.res
• At present running Zgoubi can be tedious as much work needs to be done “by hand”.• Two interfaces being developed
1. C++/Root (S. Sheehy/R. Fenning)2. Python (S. Tygier)
UKNF WP1 meeting, 12/11/08
Input fileemma'OBJET'-3.501946e+0121 10.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 ' '1
'PARTICUL'5.109989e-01 -1.602177e-19 1.159652e-03 0.000000e+00 0
'DRIFT' ld 1.050000e+01
'CHANGREF' 0.000000e+00 0.000000e+00 8.571429e+00
'CHANGREF' 0.000000e+00 -3.404800e+00 0.000000e+00
'QUADRUPO' defoc 07.569900e+00 5.300000e+00 2.493120e+000.000000e+00 0.000000e+000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+000.000000e+00 0.000000e+000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00#20|20|200 0.000000e+00 0.000000e+00 0.000000e+00
'CHANGREF' 0.000000e+00 3.404800e+00 0.000000e+00
'DRIFT' sd 5.000000e+00
'CHANGREF' 0.000000e+00 -7.514000e-01 0.000000e+00
'QUADRUPO' foc 05.878200e+00 3.700000e+00 -2.477150e+000.000000e+00 0.000000e+000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+000.000000e+00 0.000000e+000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00#20|20|200 0.000000e+00 0.000000e+00 0.000000e+00
'CHANGREF' 0.000000e+00 7.514000e-01 0.000000e+00
'END'
UKNF WP1 meeting, 12/11/08
Python interface
Zgoubi input file created and may be easily modified. Elements such as QUADRUPO and MULTIPOL included. Still working on DIPOLES and FFAG. A utility to find the closed orbit, the tune (from the MATRIX result) and the dynamic aperture have been written. Utilities currently being developed
- calculate dynamic aperture over tune space- add magnet misalignments and check effect
on dynamic aperture
UKNF WP1 meeting, 12/11/08
EMMA exampleob = OBJET2()emma.add(ob)
emma.add(ELECTRON())
emma.add(DRIFT('ld', XL=ld*cm_/2))emma.add(CHANGREF(ALE=angle))
emma.add(CHANGREF(YCE=d_offset*cm_))emma.add(QUADRUPO('defoc', XL=dq*cm_, R_0=dr*cm_, B_0=db*kgauss_, XPAS=xpas))emma.add(CHANGREF(YCE=-d_offset*cm_))
emma.add(DRIFT('sd', XL=sd*cm_))
emma.add(CHANGREF(YCE=f_offset*cm_))emma.add(QUADRUPO('foc', XL=fq*cm_, R_0=fr*cm_, B_0=fb*kgauss_, XPAS=xpas))emma.add(CHANGREF(YCE=-f_offset*cm_))
emma.add(DRIFT('ld', XL=ld*cm_/2))
emma.add(FAISCNL(FNAME='zgoubi.fai'))
emma.add(REBELOTE(K=99, NPASS=10))
emma.add(END())
Zgoubi fringe fields - Multipol
MULTIPOL
Uses the multipole fringe field with Enge fall off as described earlier. A rectangular type magnet is assumed. Four terms in multipole expansion are included.
)!(!
)2(sin
)!(!4
)()1(!1!),,(V
0
222
n mnm
ZYm
qnq
zyxGnnzyx
mmn
qqq
xGzyxGzyxGzyxGBz
6322422222
9216
1
192
1"
8
1
e.g. Vertical dipole field expansion
Zgoubi fringe fields – DIPOLES
DIPOLE/DIPOLE-M/DIPOLES Provides a model of a dipole field in a radial magnet
geometry. Terms up to octupole can be included.
Multipole expansion is ignored – instead a smooth Enge fall off is assumed at every position. In polar coordinates
32
0 1,,m
m
m
m
m
mz r
rr
r
rr
r
rrBrFrB
sPerF
1
1,
5
5
4
4
3
3
2
210)(
g
scgscg
scgscg
sccsP
r
rgrg m0
Dipole fringe field in MULTIPOL Assume 1m MULTIPOL magnet with 1T dipole field
only. The fringe field fall off extent λ is set to 20cm.
Calculate vertical fringe field in Zgoubi by tracking a particle through the magnet at various horizontal locations (5cm, 10cm, 20cm) from that magnetic axis. (Switch off bending)
Mathematica study of MULTIPOL fringe field
Replicate result in Mathematica. First four terms in dipole fringe field included.
xGzyxGzyxGzyxGBZ6322422222
9216
1
192
1"
8
1
Plot Bz longitudinally at 5cm, 10cm and 20cm. Fringe field extent is 20cm
UKNF WP1 meeting, 12/11/08
MULTIPOL summary• There is some radius inside which the multipole equations converge. Beyond that strong oscillations in the fringe field appear.
•Create a new “MULTIPOL” object – a rectangular magnet with arbitrary number of multipoles, each of which fall off smoothly at all radii, just as in the case of radial magnets
• Rather than using analytic equations directly, instead create “ideal” field map in which to track (JAI).