Beam calculation exercice – MAD

Beam calculation exercise – MAD (Methodical Accelerator Design)
In this exercise a program for accelerator design and simulation called MAD-8 will be
used. The example is taken from one of the two injection beam lines to DESIRE. The
first part of the exercise is to transform between different units used for accelerator
elements. Then an input file for MAD8 is made to calculate the dispersion and the betafunction. In the final step MAD8 is used to optimize the focusing of the dipole and the
quadrupoles. The results have to be presented and discussed in a report.
Installing the software and running MAD-8
MAD-8 is the predecessor to MAD-X and it can be downloaded from the MAD-X home
page (http://frs.home.cern.ch/frs/Xdoc/mad-X.html). There are a number of ways to run
MAD8 in Windows. A simple, but maybe not the most convenient way, is to use the
command prompt. Download mad8.zip and unfold in a new folder. Go to that folder in
the command prompt to set the dic-file by typing
set DICT=mad8.dic
In order to run a simulation with the filename input.md8 type
mad8.exe<input.md8
The results are presented in a text file named print and in a postscript file Des25.ps
showing a graph of the dispersion and beta functions. In order to see the graphs you need
ghost-view installed on your computer. Note that the postscript file can have more than
one page.
The manual of MAD8 can be found at
http://project-madwindows.web.cern.ch/project-madwindows/MADresources/MAD8.13%20User%20Reference%20Manual.pdf
Questions
In this exercise you should make an input file to the MAD program and use MAD to
make some calculations. The calculations can be performed in two ways. Either all the
question marks (?) in the MAD-file in Appendix B can be replaced by the correct
constants and numbers and question 2-4 are calculated at ones. Another way is to first do
the simulation in question 2. In that case make a text file with all lines from the beginning
to the line “!stop” and remove “!”. When doing the optimization, copy and paste the rest
of the lines and insert “!” again.
1. A beamline has been calculated with another simulation program called Cosy
infinity and the input file for that program is found in Appendix A. COSY uses
electrostatic elements, they are however not available in MAD. The unit for
quadrupole strength in COSY is kV, the voltage on the poles. In MAD the unit is
m-2 which is independent of the beam energy. The definition of the unit for
quadrupole strength is the gradient (T/m) divided by the magnetic rigidity (Tm).
Calculate the quadrupole strengths in m-2.
2. A dipole in COSY is defined by radius, bend angle, entrance and exit angles. All
angles in degrees. In MAD one gives length, bend angle, entrance and exit angles.
All angles in radians. Give the values for the magnet definition for MAD.
3. The dipole magnet is double focusing, i.e. the focusing in the vertical and the
horizontal plane are the same. However, COSY and MAD has slightly different
magnet models. Which entrance and exit angle should the magnet have in MAD
to give double focusing? Here and in the next question you should use the
optimization feature in MAD (set constraints for α and β).
4. The quadrupole strengths should also be corrected. Which strengths in MAD give
a focus at the end of the beamline?
5. It is important to be able to separate ions with different masses to get well defined
experiments. How small mass differences can one separate at the end of the
beamline if the emittance is 10  mm mrad? Is there a better place to put an
aperture to get a large separation? Hint – compare beam size and beam separation
at different positions, the lattice functions are given in the file print.
Appendix A
COSY FILE:
DL – drift length – length (m)
DI – magnetic dipole – radius, bend, aperture, edge angles (degrees)
EQ – electrostatic quadrupole – length, kV, distance center-pole
The beam comes from a 10 kV platform.
DL 1.0000;
DI 0.5 90 0.0175 26.56511 0 26.56511 0;
DL 1.0000;
DL 0.5314;
DL 0.13;
EQ 0.08 0.39610 0.0265;
DL 0.01;
EQ 0.16 -0.35920 0.0265;
DL 0.01;
EQ 0.08 0.39610 0.0265;
DL 0.13;
DL 0.7314;
Appendix B
! Replace ? with suitable text and numbers
! Output is print and DES25.ps
! You can ignore warnings in output but nor errors
!
TITLE, "DESIREE 25 kV line"
L100:DRIFT,L=1.00
L053:DRIFT,L=0.5314
L013:DRIFT,L=0.13
L001:DRIFT,L=0.01
L073:DRIFT,L=0.7314
! CONSTANTS FOR MATCHING
KF:=1
KD:=1
KE=1
! ELEMENTS
EDGE:=? *PI*KE
SBEND,L=? ,ANGLE=PI/? ,E1=EDGE,E2=EDGE,HGAP=0.0175,FINT=0.5
KQ:=? ! 10 KEV
QF:QUAD,L=0.08,K1=+0.39610*KQ*KF
QD:QUAD,L=0.08,K1=-0.35920*KQ*KD
M:MARKER
! Beam lines
! Symmetric triplet
TRIP:LINE=(L013,QF,L001,QD,QD,L001,QF,L013)
L25:LINE=(L100,SBEND,L100,M,L053,TRIP,L073)
USE,L25
BET=1.44
PRINT,#S/E
!
TWISS,BETX=BET,BETY=BET,SAVE=START
PLOT,TABLE=START,SPLINE,HAXIS=S,VMIN=0,VAXIS1=BETX,BETY,DX &
COLOUR=100,FILENAME=DES25
!
! stop
!
! Make bend double focusing and choose beta0
MATCH,BETX=BET,BETY=BET
VARY,KE,STEP=0.0001
CONSTRAINT,M, ?
MIGRAD,CALLS=1000,TOLE=1E-8
ENDMATCH
TWISS,BETX=BET,BETY=BET,SAVE=BM
PLOT,TABLE=BM,SPLINE,HAXIS=S,VMIN=0,VAXIS1=BETX,BETY,DX &
COLOUR=100,FILENAME=DES25
!
! Adjust quadrupole focusing
MATCH,BETX=BET,BETY=BET
VARY,KF,STEP=0.001
VARY,KD,STEP=0.001
CONSTRAINT,#E, ?
MIGRAD,CALLS=1000,TOLE=1E-8
ENDMATCH
TWISS,BETX=BET,BETY=BET,SAVE=TRIP
PLOT,TABLE=TRIP,SPLINE,HAXIS=S,VMIN=0,VAXIS1=BETX,BETY,DX &
COLOUR=100,FILENAME=DES25
!
STOP