1 | <head> |
---|
2 | <title>SEQUENCE</title> |
---|
3 | <!-- Changed by: Chris ISELIN, 27-Jan-1997 --> |
---|
4 | <!-- Changed by: Hans Grote, 30-Sep-2002 --> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body bgcolor="#ffffff"> |
---|
8 | |
---|
9 | <center> |
---|
10 | EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH |
---|
11 | <IMG SRC="http://cern.ch/madx/icons/mx7_25.gif" align=right> |
---|
12 | <h2>Beam Line Sequences</h2> |
---|
13 | </center> |
---|
14 | |
---|
15 | MAD-X accepts two forms of an accelerator definition: sequences and |
---|
16 | <a href="line.html">lines</a>. However, the sequence definition is the |
---|
17 | only one used internally; lines are converted into sequences when they |
---|
18 | are USEd. Consequently, only sequences can be saved (written onto a file) |
---|
19 | by MAD-X. |
---|
20 | <p> |
---|
21 | The corresponding sequence of statements defining a sequence is |
---|
22 | <pre> |
---|
23 | name: SEQUENCE,REFER=keyword,REFPOS=name,LENGTH=real,ADD_PASS=integer,NEXT_SEQU='seq_name' |
---|
24 | label: class,AT=real{,attributes} | class,AT=real | sequ_name, AT=real |
---|
25 | ... |
---|
26 | ENDSEQUENCE |
---|
27 | </pre> |
---|
28 | where "real" means a real number, variable, or expression. |
---|
29 | <p> |
---|
30 | The first line gives the sequence name, a REFER flag (entry, centre, |
---|
31 | or exit) which specifies at which part of the element its position along |
---|
32 | the beam line will be given (default: centre), a REFPOS argument used |
---|
33 | for sequence insertion, and the total length. |
---|
34 | The ADD_PASS=integer option specifies a number of additionnal passes (max. 5) |
---|
35 | through the structure; in case of an RBEND the angle will be overwritten in |
---|
36 | survey using the i-th component (1 <= i <= <tt>add_pass</tt> <= 5) of its <i>array_of_angles</i> |
---|
37 | (see <a href="bend.html">RBEND<a>). |
---|
38 | The NEXT_SEQU='seq_name' concatenates the sequence with name 'seq_name' |
---|
39 | to the end of the specified sequence. |
---|
40 | <p> |
---|
41 | Inside the sequence ... endsequence bracket three types of commands |
---|
42 | may be placed: |
---|
43 | <ul> |
---|
44 | <li>an element declaration as usual, with an additional "at" attribute |
---|
45 | giving the element position relative to the start of the sequence; |
---|
46 | CAUTION: an existing definition for an element with the same name will |
---|
47 | be replaced, however, defining the same element twice inside the same |
---|
48 | sequence results in a fatal error, since a unique object (this element) |
---|
49 | would be placed at two different positions.</li> |
---|
50 | <li>a class name with a position; this causes an instance of the class |
---|
51 | to be placed at the position given. For uses inside ranges, instances |
---|
52 | of the same class can be accessed with an occurrence count.</li> |
---|
53 | <li>a sequence name with a position; this causes the sequence with that |
---|
54 | name to be placed at the position indicated. The entry, centre, or exit |
---|
55 | of the inserted sequence are placed at the position given, UNLESS a "refpos" |
---|
56 | (the name of an element in the inserted sequence) is given, in which case |
---|
57 | the sequence is inserted such that the refpos element is |
---|
58 | at the insertion point.</li> |
---|
59 | </ul> |
---|
60 | When the sequence is expanded in a |
---|
61 | <a href="../control/general.html#use">USE</a> command, |
---|
62 | MAD generates the missing drift spaces. At this moment, overlapping elements |
---|
63 | will cause "negative drift length" errors. |
---|
64 | <p> |
---|
65 | For efficiency reasons MAD-X imposes an <b>important restriction</b> |
---|
66 | on element lengths and positions: once a sequence is expanded, the element |
---|
67 | positions and lengths are considered as fixed; in order to vary a position |
---|
68 | or element length, a re-expansion of the sequence becomes necessary. |
---|
69 | The MATCH command contains a special flag "vlength" to |
---|
70 | <a href="../match/match.html">match element lengths</a>. |
---|
71 | <p> |
---|
72 | <a name=example>Example:</a> |
---|
73 | <pre> |
---|
74 | ! define a default beam (otherwise fatal error) |
---|
75 | beam; |
---|
76 | ! Define element classes for a simple cell: |
---|
77 | b: sbend,l=35.09, angle = 0.011306116; |
---|
78 | qf: quadrupole,l=1.6,k1=-0.02268553; |
---|
79 | qd: quadrupole,l=1.6,k1=0.022683642; |
---|
80 | sf: sextupole,l=0.4,k2=-0.13129; |
---|
81 | sd: sextupole,l=0.76,k2=0.26328; |
---|
82 | ! define the cell as a sequence: |
---|
83 | sequ: sequence,l=79; |
---|
84 | b1: b, at=19.115; |
---|
85 | sf1: sf, at=37.42; |
---|
86 | qf1: qf, at=38.70; |
---|
87 | b2: b, at=58.255,angle=b1->angle; |
---|
88 | sd1: sd, at=76.74; |
---|
89 | qd1: qd, at=78.20; |
---|
90 | endm: marker, at=79.0; |
---|
91 | endsequence; |
---|
92 | </pre> |
---|
93 | |
---|
94 | <address> |
---|
95 | <a href="http://www.cern.ch/Hans.Grote/hansg_sign.html">hansg</a>, |
---|
96 | June 17, 2002 |
---|
97 | </address> |
---|
98 | |
---|
99 | </body> |
---|