forked from MethodicalAcceleratorDesign/MAD-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pitfalls.tex
156 lines (127 loc) · 6.9 KB
/
pitfalls.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
%%\title{MAD-X RECIPES AND PITFALLS}
\chapter{\madx recipes and pitfalls}
Find a loose collection of pitfalls that may be difficult to avoid in
particular for new users but also experienced user might profit from
this list.
\begin{description}
\item[Twiss calculation is 4D only!] The Twiss command will calculate
an approximate 6D closed orbit when the accelerator structure includes
an active \hyperref[sec:rf-cavity]{cavity}. However, the calculation of
the Twiss parameters are 4D only. This may result in apparently
non-closure of the beta values in the plane with non-zero
dispersion. The full 6D Twiss parameters can be calculated with the
\hyperref[chap:ptc-twiss]{\texttt{PTC\_TWISS}} command. The
\hyperref[chap:thintrack]{Thinlens Tracking} module presently suffers
from this deficiency since it requires the true 6d closed orbit and
not the approximate one as calculated by Twiss. In this context one
has to mention that the coordinate system for the Twiss module is not
x, px in the horizontal plane as the advertised canonical coordinates
instead x, x' have been used (same for the vertical plane).
Be careful that for \texttt{TWISS} with the \texttt{CENTRE} attribute
activated, \textsl{i.e.} looking inside the element, the closed orbit
includes the misalignment of the element.
\item[Dispersion for machines with small relativistic beta]
\madx uses the PT coordinate as the canonical momentum in the
longitudinal plane. The derivative of e.g. dispersion is therefore
not taken wrt delta-p over p but PT. Therefore one unfortunately finds the
dispersion being divided by the relativistic beta which is annoying
for low energy machines. PTC allows to change the coordinate system
to delta-p over p with the "time=false" option of the
\hyperref[sec:ptc-create-layout]{\texttt{PTC\_CREATE\_LAYOUT}}
command which delivers the proper dispersion with the
%\hyperref{sec:ptc-twiss}{\texttt{PTC\_TWISS}} command.
\item[Non-standard definition of DDX, DDPX, DDY, DDPY]
The \madx proper defintion of \texttt{DDX, DDPX, DDY, DDPY} is
\textbf{not} the second order derivative with respect to deltap/p.
In order to get the second order derivative you need to multiply the value by 2.
The corresponding values from
\hyperref[chap:ptc-normal]{\texttt{PTC\_NORMAL}} and in
\hyperref[chap:ptc-twiss]{\texttt{PTC\_TWISS}} are the proper
derivaties to all orders.
\item[Chromaticity calculation in presence of coupling]
Chromaticity calculations are typically in order and agree with \ptc
and other codes. However, it was recently discovered that in
presences of coupling \madx simply seems to ignore coupling when the
chromaticity is calculated. This is surprising since the eigentunes
Q1, Q2 are properly calculated for a given (small!) dp/p. The issue
is under investigation.
\item[Field errors in thick elements]
Only a very limited number of field error components are
considered in \hyperref[chap:twiss]{\texttt{TWISS}} calculations for
some thick elements. Find below a complete list of all those field
error components that are taking into account for a particular thick
element. It should be mentioned that
\hyperref[sec:bend]{\texttt{BEND}}s also allow a skew quadrupole
component K1s but NOT in the body of the magnet. It is only active in
the edge effect for radiation (expert use only).
{\renewcommand{\arraystretch}{2}
\begin{tabular}{c | c | c}
\hline
\textbf{Magnet Type} & \textbf{Normal Field Components} & \textbf{Skew Field Components} \\
\hline
& Dipole & ---\\
Bend & Quadrupole & ---\\
& Sextupole & ---\\
\hline
HKicker & Dipole & ---\\
\hline
VKicker & --- & Dipole\\
\hline
Quadrupole & Quadrupole & Quadrupole \\
\hline
Sextupole & Sextupole & Sextupole \\
\hline
Octupole & Octupole & Octupole \\
\hline
\end{tabular}
}
\item[\madx versus \ptc]
The user has to understand that \ptc exists inside of \madx as a
library. \madx offers the interface to \ptc, i.e. the \madx input
file is used as input for \ptc. Internally, both \ptc and \madx have
their own independent databases which are linked via the
interface. With the
\hyperref[sec:ptc-create-layout]{\texttt{PTC\_CREATE\_LAYOUT}}
command, only numerical numbers are transferred from the \madx
database to the \ptc database. Any modification to the \madx
database is ignored in \ptc until the next call to
\hyperref[sec:ptc-create-layout]{\texttt{PTC\_CREATE\_LAYOUT}}
For example, a deferred expression of \madx after a
\hyperref[sec:ptc-create-layout]{\texttt{PTC\_CREATE\_LAYOUT}}
command is ignored within \ptc.
When introducing a cavity with the \texttt{HARMON} attribute instead
of the \texttt{FREQ} attribute (highly discouraged!) a problem arises
for \hyperref[sec:ptc-twiss]{\texttt{PTC\_TWISS}} due to the fact that
internally \texttt{HARMON} is transferred to \texttt{FREQ} too late. A
simple \hyperref[chap:twiss]{\texttt{TWISS}} command executed before \ptc
start-up will help. However, avoiding \texttt{HARMON} is advantageous.
\item[SLOW attribute in matching]
The \texttt{SLOW} attribute enforces the old matching procedure and is
considerably slower. Therefore we did not make it the default
option. Recently a number of parameters, like \texttt{RE56}, have been
added to the list of matchable parameters in the default and fast
version. Nevertheless, some parameters are only available when using
the \texttt{SLOW} attribute. Therefore it is advisable to check with the
\texttt{SLOW} attribute if there are doubts about the matching procedure.
\item[Validity of Twiss parameters]
The standard Teng-Edwards Twiss parameters suffer from a deficiency near
full coupling: i.e. the "donuts" of linear motion in x-x' and y-y' phase
space have no hole anymore. This means that all energy is transfered
from one plane to the other. In this case the Twiss parameters and the
coupling matrix (\texttt{R11, R12, R21, R22}) become large or even infinite or
the beta functions might become negative. The Ripken-Mais Twiss
parameters are always well defined (they are the "average" amplitude
functions of their proper phase space region), i.e. at full coupling we
have: beta11 $\sim$ beta12 and beta21 $\sim$ beta22. Using the \texttt{RIPKEN}
flag \hyperref[chap:twiss]{\texttt{TWISS}} calculates the Mais-Ripken
parameters via a transformation from the Teng-Edwards Twiss
parameters. Obviously this fails when the Teng-Edwards Twiss
parameters are ill defined. In this case one has to rely on
\hyperref[chap:ptc-twiss]{\texttt{PTC\_TWISS}}.
\item[MAKETHIN might invalidate a sequence]
Several \madx commands such as {\texttt{EALIGN}}, {\texttt{EFCOMP}}
won't work on sequences produced by {\texttt{MAKETHIN}}. In order to
use such commands on thin sequences, it is advisable to save the
sequence on a file, and then re-load it.
\end{description}
%EOF