source: PSPA/madxPSPA/doc/usrguide/twiss/twiss_mad8.html @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 8.6 KB
Line 
1<head>
2<title>PRINT / SELECT</title>
3<!-- Changed by: Chris ISELIN, 27-Jan-1997 -->
4<!-- Changed by: Frank Schmidt, 28-Jun-2002 -->
5<!-- Changed by: Hans Grote, 23-Sep-2002 -->
6</head>
7
8<body bgcolor="#ffffff">
9
10<h1>Output Selection Statements</h1>
11
12<hr>
13<a href="beam.html">
14<img src="/icons/left.gif" alt="Previous:" align=middle>
15BEAM: Set Beam Parameters</a>
16<a href="action.html">
17<img src="/icons/up.gif" alt="Up:" align=middle>
18Action Commands</a>
19<a href="split.html">
20<img src="/icons/right.gif" alt="Next:" align=middle>
21SPLIT: Request Interpolation for OPTICS</a>
22<hr>
23
24Each position in the beam line carries several associated selection flags.
25They are initially cleared by the USE command when the beam line is expanded.
26Output is <a href="ranges.html">selected</a> by setting some of these flags
27by one of the commands
28<pre>
29PRINT,RANGE=range{,range},TYPE=type{,type},FULL,CLEAR
30SELECT,FLAG=name,RANGE=range{,range},TYPE=type{,type},FULL,CLEAR
31</pre>
32(See <a href="ranges.html">obsolete element selection</a>).
33As from Version 8.18 the <a href="new_select.html">new element selection</a>
34is used:
35<pre>
36PRINT,RANGE=range,CLASS=class,PATTERN=pattern[,FULL][,CLEAR]
37SELECT,FLAG=name,RANGE=range,CLASS=class,PATTERN=pattern[,FULL][,CLEAR]
38</pre>
39The PRINT command always affects the print flag for
40<a href="survey.html">SURVEY</a>, or
41<a href="survey.html">TWISS</a>.
42In SELECT the flag type is chosen by the attribute FLAG:
43Three of its possible values affect action commands:
44<p>TWISS:
45A SELECT,TWISS statement is equivalent to PRINT:
46The two commands
47<pre>
48PRINT,  FULL
49SELECT, FLAG=TWISS,FULL
50</pre>
51have identical effect.
52<p>OPTICS:
53Selects output positions for <a href="optics.html">OPTICS</a>.
54<p>TRACK:
55Selects print positions for <a href="track.html">TRACK</a>.
56Care must be taken in using this option, as it may generate a lot of
57output.
58<p>
59Four more values are intended for debugging only:
60<ul>
61<li>FIRST:
62Selects dumping of first-order transfer matrices for selected
63elements during closed orbit search in TWISS:
64<li>SECOND:
65Selects dumping of second-order TRANSPORT maps for selected
66elements during their accumulation in TWISS:
67<li>REFER:
68Selects dumping of first-order transfer matrices for selected
69elements during accumulation for adjusting RF cavities.
70<li>LIE:
71Selects dumping of Lie-algebraic maps during their accumulation.
72<li>ERROR:
73Selects error definition and/or printing for the commands
74<a href="error_align.html">EALIGN</a>,
75<a href="error_field.html">EFIELD</a>,
76<a href="error_field.html">EFCOMP</a>, and
77<a href="error_print.html">EPRINT</a>.
78</ul>
79PRINT and/or SELECT command(s)
80must be placed after the USE command,
81and before any action command (e.g. TWISS) to be affected.
82Regardless of the setting of print flags,
83start and end points of the computation range are always printed
84by NORMAL, SURVEY, and TWISS:
85<p>
86Examples:
87<pre>
88USE,OCT                ! print at beginning and end only
89PRINT,#35/37           ! print at positions number 35 to 37
90SELECT,TWISS,FULL      ! set all print flags
91PRINT,CLEAR            ! clear all print flags
92PRINT,OCT              ! set all print flags
93PRINT,CELL[3],CLEAR    ! clear all flags,
94                       ! then set flags for all of third CELL
95</pre>
96
97<H2><a name=example>Examples for Element Selections</a></H2>
98First example:
99<pre>
100! Define element classes for a simple cell:
101B:     SBEND,L=35.09, ANGLE = 0.011306116
102QF:    QUADRUPOLE,L=1.6,K1=-0.02268553
103QD:    QUADRUPOLE,L=1.6,K1=0.022683642
104SF:    SEXTUPOLE,L=0.4,K2=-0.13129
105SD:    SEXTUPOLE,L=0.76,K2=0.26328
106! Define the cell as a sequence:
107CELL:  SEQUENCE
108   B1:    B,      AT=19.115
109   SF1:   SF,     AT=37.42
110   QF1:   QF,     AT=38.70
111   B2:    B,      AT=58.255,ANGLE=B1[ANGLE]
112   SD1:   SD,     AT=76.74
113   QD1:   QD,     AT=78.20
114   ENDM:  MARKER, AT=79.0
115ENDSEQUENCE
116USE,CELL
117SELECT,OPTICS,SBEND,QUAD,SEXT
118OPTICS,FILENAME=&quot;cell.optics.f&quot;,EXIT,COLUMN=NAME,S,BETX,BETY
119</pre>
120The resulting table file is:
121<pre>
122@ GAMTR            %f    64.3336
123@ ALFA             %f   0.241615E-03
124@ XIY              %f   -.455678
125@ XIX              %f    2.05279
126@ QY               %f   0.250049
127@ QX               %f   0.249961
128@ CIRCUM           %f    79.0000
129@ DELTA            %f   0.000000E+00
130@ COMMENT          %20s "DATA FOR TEST CELL"
131@ ORIGIN           %24s "MAD 8.01    IBM - VM/CMS"
132@ DATE             %08s "19/06/89"
133@ TIME             %08s "09.47.40"
134* NAME             S              BETX           BETY
135$ %16s             %f             %f             %f
136  B1                  36.6600        24.8427        126.380
137  SF1                 37.6200        23.8830        130.925
138  QF1                 39.5000        23.6209        132.268
139  B2                  75.8000        124.709        25.2153
140  SD1                 77.1200        130.933        23.8718
141  QD1                 79.0000        132.277        23.6098
142</pre>
143Second Example.
144The following is an excerpt of the LEP description:
145<pre>
146! Bending magnet pairs:
147! The definitions take into account the different magnetic length
148! for the inner and outer pairs of a group of six.
149B2:    RBEND,     L=11.55,ANGLE=KMB2,K1=KQB,K2=KSB, &amp;
150                  E1=-.25*B2[ANGLE],E2=-.25*B2[ANGLE]
151B2OUT: B2,        ANGLE=1.00055745184472*KMB2, &amp;
152                  E1=-.25*B2OUT[ANGLE],E2=-.25*B2OUT[ANGLE]
153B2MID: B2,        ANGLE=1.00111490368947*KMB2, &amp;
154                  E1=-.25*B2MID[ANGLE],E2=-.25*B2MID[ANGLE]
155 
156! Quadrupoles:
157MQ:    QUADRUPOLE,L=1.6       ! standard quadrupoles =
158QD:    MQ,        K1=KQD      ! cell quadrupoles, defocussing
159QF:    MQ,        K1=KQF      !cell quadrupoles, focussing
160 
161! Sextupoles:
162MSF:   SEXTUPOLE, L=0.40      ! F sextupoles
163MSD:   SEXTUPOLE, L=0.76      ! D sextupoles
164SF1.2: MSF,       K2=KSF1.2   ! F family 1, circuit 2
165SF2.2: MSF,       K2=KSF2.2   ! F family 2, circuit 2
166SF3.2: MSF,       K2=KSF3.2   ! F family 3, circuit 2
167SD1.2: MSD,       K2=KSD1.2   ! D family 1, circuit 2
168SD2.2: MSD,       K2=KSD2.2   ! D family 2, circuit 2
169SD3.2: MSD,       K2=KSD3.2   ! D family 3, circuit 2
170 
171! Orbit correctors and monitors:
172CH:    HKICK,     L=0.4       ! Horizontal orbit correctors
173CV:    VKICK,     L=0.4       ! Vertical orbit correctors
174MHV:   MONITOR,   L=0         ! Orbit position monitors
175 
176LEP:SEQUENCE
177    ...
178QF23.R1:        QF,    AT=639.180037
179   SF2.QF23.R1: SF2.2, AT=640.460037
180   B2L.QF23.R1: B2OUT, AT=647.257037
181   B2M.QD24.R1: B2MID, AT=659.147037
182   B2R.QD24.R1: B2OUT, AT=671.037037
183   CV.QD24.R1:  CV,    AT=677.392037, KICK=KCV24.R1
184   PU.QD24.R1:  MHV,   AT=677.712037
185QD24.R1:        QD,    AT=678.680037
186   SD2.QD24.R1: SD2.2, AT=680.140037
187   B2L.QD24.R1: B2OUT, AT=686.757037
188   B2M.QF25.R1: B2MID, AT=698.647037
189   B2R.QF25.R1: B2OUT, AT=710.537037
190   CH.QF25.R1:  CH,    AT=716.942037, KICK=KCH25.R1
191QF25.R1:        QF,    AT=718.180037
192   SF1.QF25.R1: SF1.2, AT=719.460037
193   B2L.QF25.R1: B2OUT, AT=726.257037
194   B2M.QD26.R1: B2MID, AT=738.147037
195   B2R.QD26.R1: B2OUT, AT=750.037037
196   CV.QD26.R1:  CV,    AT=756.392037, KICK=KCV26.R1
197   PU.QD26.R1:  MHV,   AT=756.712037
198QD26.R1:        QD,    AT=757.680037
199   SD1.QD26.R1: SD1.2, AT=759.140037
200   B2L.QD26.R1: B2OUT, AT=765.757037
201   B2M.QF27.R1: B2MID, AT=777.647037
202   B2R.QF27.R1: B2OUT, AT=789.537037
203QF27.R1:        QF,    AT=797.180037
204   SF3.QF27.R1: SF3.2, AT=798.460037
205   B2L.QF27.R1: B2OUT, AT=805.257037
206   B2M.QD28.R1: B2MID, AT=817.147037
207   B2R.QD28.R1: B2OUT, AT=829.037037
208   PU.QD28.R1:  MHV,   AT=835.712037
209QD28.R1:        QD,    AT=836.680037
210   SD3.QD28.R1: SD3.2, AT=838.140037
211   B2L.QD28.R1: B2OUT, AT=844.757037
212   B2M.QF29.R1: B2MID, AT=856.647037
213   B2R.QF29.R1: B2OUT, AT=868.537037
214   CH.QF29.R1:  CH,    AT=874.942037, KICK=KCH29.R1
215    ...
216ENDSEQUENCE
217</pre>
218In the above structure it is easy to select many sets of observation
219points:
220<p>Print at all F sextupoles:
221<pre>
222PRINT,MSF
223</pre>
224<p>Split all quadrupoles at 1/3 of their length for OPTICS command:
225<pre>
226SPLIT,QUADRUPOLE,FACTOR=1/3
227</pre>
228<p>Misalign two quadrupole QF25.R1 and QD26.R1:
229<pre>
230EALIGN,QF25.R1,QD26.R1,DX=0.001*GAUSS(),DY=0.0005*GAUSS()
231</pre>
232<p>Print first-order matrices for elements B2L.QD24.R1
233through CV.QD26.R1:
234<pre>
235SELECT,FIRST,B2L.QD24.R1[1]/CV.QD24.R1[1]
236</pre>
237<p>Print lattice functions at all F-sextupoles of the first family,
238if connected to the second circuit:
239<pre>
240PRINT,SF1.2
241</pre>
242
243<hr>
244<a href="beam.html">
245<img src="/icons/left.gif" alt="Previous:" align=middle>
246BEAM: Set Beam Parameters</a>
247<a href="action.html">
248<img src="/icons/up.gif" alt="Up:" align=middle>
249Action Commands</a>
250<a href="split.html">
251<img src="/icons/right.gif" alt="Next:" align=middle>
252SPLIT: Request Interpolation for OPTICS</a>
253<hr>
254
255<address>
256<a href="http://www.cern.ch/Hans.Grote/hansg_sign.html">hansg</a>,
257January 27, 1997
258</address>
259
260</body>
Note: See TracBrowser for help on using the repository browser.