-
Notifications
You must be signed in to change notification settings - Fork 1
/
twiss_mad8.tex
236 lines (210 loc) · 8.67 KB
/
twiss_mad8.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
%%\title{PRINT / SELECT}
% Changed by: Chris ISELIN, 27-Jan-1997
% Changed by: Frank Schmidt, 28-Jun-2002
% Changed by: Hans Grote, 23-Sep-2002
\section{Output Selection Statements}
\line(1,0){300}
%\href{beam.html}{
%%\includegraphics{/icons/left.gif} BEAM: Set Beam Parameters}\href{action.html}{
%%\includegraphics{/icons/up.gif} Action Commands}\href{split.html}{
%%\includegraphics{/icons/right.gif} SPLIT: Request Interpolation for OPTICS}
\line(1,0){300}
Each position in the beam line carries several associated selection
flags. They are initially cleared by the USE command when the beam line
is expanded. Output is \href{ranges.html}{selected} by setting some of
these flags by one of the commands
\begin{verbatim}
PRINT,RANGE=range{,range},TYPE=type{,type},FULL,CLEAR
SELECT,FLAG=name,RANGE=range{,range},TYPE=type{,type},FULL,CLEAR
\end{verbatim}
(See \href{ranges.html}{obsolete element selection}). As from Version
8.18 the \href{new_select.html}{new element selection} is used:
\begin{verbatim}
PRINT,RANGE=range,CLASS=class,PATTERN=pattern[,FULL][,CLEAR]
SELECT,FLAG=name,RANGE=range,CLASS=class,PATTERN=pattern[,FULL][,CLEAR]
\end{verbatim}
The PRINT command always affects the print flag for
\href{survey.html}{SURVEY}, or \href{survey.html}{TWISS}. In SELECT the
flag type is chosen by the attribute FLAG: Three of its possible values
affect action commands:
TWISS: A SELECT,TWISS statement is equivalent to PRINT: The two commands
\begin{verbatim}
PRINT, FULL
SELECT, FLAG=TWISS,FULL
\end{verbatim}
have identical effect.
OPTICS: Selects output positions for \href{optics.html}{OPTICS}.
TRACK: Selects print positions for \href{track.html}{TRACK}. Care must
be taken in using this option, as it may generate a lot of output.
Four more values are intended for debugging only:
\begin{itemize}
\item FIRST: Selects dumping of first-order transfer matrices for
selected elements during closed orbit search in TWISS:
\item SECOND: Selects dumping of second-order TRANSPORT maps for
selected elements during their accumulation in TWISS:
\item REFER: Selects dumping of first-order transfer matrices for
selected elements during accumulation for adjusting RF cavities.
\item LIE: Selects dumping of Lie-algebraic maps during their accumulation.
\item ERROR: Selects error definition and/or printing for the
commands \href{error_align.html}{EALIGN},
\href{error_field.html}{EFIELD}, \href{error_field.html}{EFCOMP},
and \href{error_print.html}{EPRINT}.
\end{itemize}
PRINT and/or SELECT command(s) must be placed after the USE command, and
before any action command (e.g. TWISS) to be affected. Regardless of the
setting of print flags, start and end points of the computation range
are always printed by NORMAL, SURVEY, and TWISS:
Examples:
\begin{verbatim}
USE,OCT ! print at beginning and end only
PRINT,#35/37 ! print at positions number 35 to 37
SELECT,TWISS,FULL ! set all print flags
PRINT,CLEAR ! clear all print flags
PRINT,OCT ! set all print flags
PRINT,CELL[3],CLEAR ! clear all flags,
! then set flags for all of third CELL
\end{verbatim}
\subsection{\href{example}{Examples for Element Selections}}
First example:
\begin{verbatim}
! Define element classes for a simple cell:
B: SBEND,L=35.09, ANGLE = 0.011306116
QF: QUADRUPOLE,L=1.6,K1=-0.02268553
QD: QUADRUPOLE,L=1.6,K1=0.022683642
SF: SEXTUPOLE,L=0.4,K2=-0.13129
SD: SEXTUPOLE,L=0.76,K2=0.26328
! Define the cell as a sequence:
CELL: SEQUENCE
B1: B, AT=19.115
SF1: SF, AT=37.42
QF1: QF, AT=38.70
B2: B, AT=58.255,ANGLE=B1[ANGLE]
SD1: SD, AT=76.74
QD1: QD, AT=78.20
ENDM: MARKER, AT=79.0
ENDSEQUENCE
USE,CELL
SELECT,OPTICS,SBEND,QUAD,SEXT
OPTICS,FILENAME="cell.optics.f",EXIT,COLUMN=NAME,S,BETX,BETY
\end{verbatim}
The resulting table file is:
\begin{verbatim}
@ GAMTR %f 64.3336
@ ALFA %f 0.241615E-03
@ XIY %f -.455678
@ XIX %f 2.05279
@ QY %f 0.250049
@ QX %f 0.249961
@ CIRCUM %f 79.0000
@ DELTA %f 0.000000E+00
@ COMMENT %20s "DATA FOR TEST CELL"
@ ORIGIN %24s "MAD 8.01 IBM - VM/CMS"
@ DATE %08s "19/06/89"
@ TIME %08s "09.47.40"
* NAME S BETX BETY
$ %16s %f %f %f
B1 36.6600 24.8427 126.380
SF1 37.6200 23.8830 130.925
QF1 39.5000 23.6209 132.268
B2 75.8000 124.709 25.2153
SD1 77.1200 130.933 23.8718
QD1 79.0000 132.277 23.6098
\end{verbatim}
Second Example. The following is an excerpt of the LEP description:
\begin{verbatim}
! Bending magnet pairs:
! The definitions take into account the different magnetic length
! for the inner and outer pairs of a group of six.
B2: RBEND, L=11.55,ANGLE=KMB2,K1=KQB,K2=KSB, \&
E1=-.25*B2[ANGLE],E2=-.25*B2[ANGLE]
B2OUT: B2, ANGLE=1.00055745184472*KMB2, \&
E1=-.25*B2OUT[ANGLE],E2=-.25*B2OUT[ANGLE]
B2MID: B2, ANGLE=1.00111490368947*KMB2, \&
E1=-.25*B2MID[ANGLE],E2=-.25*B2MID[ANGLE]
! Quadrupoles:
MQ: QUADRUPOLE,L=1.6 ! standard quadrupoles =
QD: MQ, K1=KQD ! cell quadrupoles, defocussing
QF: MQ, K1=KQF !cell quadrupoles, focussing
! Sextupoles:
MSF: SEXTUPOLE, L=0.40 ! F sextupoles
MSD: SEXTUPOLE, L=0.76 ! D sextupoles
SF1.2: MSF, K2=KSF1.2 ! F family 1, circuit 2
SF2.2: MSF, K2=KSF2.2 ! F family 2, circuit 2
SF3.2: MSF, K2=KSF3.2 ! F family 3, circuit 2
SD1.2: MSD, K2=KSD1.2 ! D family 1, circuit 2
SD2.2: MSD, K2=KSD2.2 ! D family 2, circuit 2
SD3.2: MSD, K2=KSD3.2 ! D family 3, circuit 2
! Orbit correctors and monitors:
CH: HKICK, L=0.4 ! Horizontal orbit correctors
CV: VKICK, L=0.4 ! Vertical orbit correctors
MHV: MONITOR, L=0 ! Orbit position monitors
LEP:SEQUENCE
...
QF23.R1: QF, AT=639.180037
SF2.QF23.R1: SF2.2, AT=640.460037
B2L.QF23.R1: B2OUT, AT=647.257037
B2M.QD24.R1: B2MID, AT=659.147037
B2R.QD24.R1: B2OUT, AT=671.037037
CV.QD24.R1: CV, AT=677.392037, KICK=KCV24.R1
PU.QD24.R1: MHV, AT=677.712037
QD24.R1: QD, AT=678.680037
SD2.QD24.R1: SD2.2, AT=680.140037
B2L.QD24.R1: B2OUT, AT=686.757037
B2M.QF25.R1: B2MID, AT=698.647037
B2R.QF25.R1: B2OUT, AT=710.537037
CH.QF25.R1: CH, AT=716.942037, KICK=KCH25.R1
QF25.R1: QF, AT=718.180037
SF1.QF25.R1: SF1.2, AT=719.460037
B2L.QF25.R1: B2OUT, AT=726.257037
B2M.QD26.R1: B2MID, AT=738.147037
B2R.QD26.R1: B2OUT, AT=750.037037
CV.QD26.R1: CV, AT=756.392037, KICK=KCV26.R1
PU.QD26.R1: MHV, AT=756.712037
QD26.R1: QD, AT=757.680037
SD1.QD26.R1: SD1.2, AT=759.140037
B2L.QD26.R1: B2OUT, AT=765.757037
B2M.QF27.R1: B2MID, AT=777.647037
B2R.QF27.R1: B2OUT, AT=789.537037
QF27.R1: QF, AT=797.180037
SF3.QF27.R1: SF3.2, AT=798.460037
B2L.QF27.R1: B2OUT, AT=805.257037
B2M.QD28.R1: B2MID, AT=817.147037
B2R.QD28.R1: B2OUT, AT=829.037037
PU.QD28.R1: MHV, AT=835.712037
QD28.R1: QD, AT=836.680037
SD3.QD28.R1: SD3.2, AT=838.140037
B2L.QD28.R1: B2OUT, AT=844.757037
B2M.QF29.R1: B2MID, AT=856.647037
B2R.QF29.R1: B2OUT, AT=868.537037
CH.QF29.R1: CH, AT=874.942037, KICK=KCH29.R1
...
ENDSEQUENCE
\end{verbatim}
In the above structure it is easy to select many sets of observation points:
Print at all F sextupoles:
\begin{verbatim}
PRINT, MSF
\end{verbatim}
Split all quadrupoles at 1/3 of their length for OPTICS command:
\begin{verbatim}
SPLIT,QUADRUPOLE,FACTOR=1/3
\end{verbatim}
Misalign two quadrupole QF25.R1 and QD26.R1:
\begin{verbatim}
EALIGN, QF25.R1, QD26.R1, DX=0.001*GAUSS(), DY=0.0005*GAUSS()
\end{verbatim}
Print first-order matrices for elements B2L.QD24.R1 through CV.QD26.R1:
\begin{verbatim}
SELECT, FIRST, B2L.QD24.R1[1]/CV.QD24.R1[1]
\end{verbatim}
Print lattice functions at all F-sextupoles of the first family, if connected to the second circuit:
\begin{verbatim}
PRINT,SF1.2
\end{verbatim}
\line(1,0){300}
%\href{beam.html}{
%%\includegraphics{/icons/left.gif} BEAM: Set Beam Parameters}\href{action.html}{
%%\includegraphics{/icons/up.gif} Action Commands}\href{split.html}{
%%\includegraphics{/icons/right.gif} SPLIT: Request Interpolation for OPTICS}
\line(1,0){300}
%\href{http://www.cern.ch/Hans.Grote/hansg_sign.html}{hansg}, January 27, 1997