-
Notifications
You must be signed in to change notification settings - Fork 39
/
elements.tex
1875 lines (1533 loc) · 73.2 KB
/
elements.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\chapter{Element Types}
\label{chap:elements}
\section{Marker}
\label{sec:marker}
\ttindex{marker}
\madbox{
label: MARKER;
}
The simplest element which can occur in a beam line is a
\texttt{MARKER}. It has zero length and has no effect on the beam, but
it allows one to identify a position in the beam line, for example to
apply a matching constraint.
\textbf{Example:}
\madxmp{M27: MARKER;}
\section{Drift Space}
\label{sec:drift}
\ttindex{drift}
\madbox{
label: DRIFT, L=real;
}
A drift space has one real attribute:
\begin{madlist}
\ttitem{L} The drift length (Default: 0 m)
\end{madlist}
\textbf{Example:}
\madxmp{
DR1: \= DRIFT, \= L=1.5; \\
DR2: \> DRIFT, \> L=DR1->L;
}
The length of DR2 is always equal to the length of DR1.
The \hyperref[subsec:local-straight]{straight reference system} for a drift
space is a Cartesian coordinate system.
\section{Bending Magnet}
\ttindex{bend}
\label{sec:bend}
Two different type keywords are recognised for bending magnets, they are
distinguished only by the reference system used:
\begin{madlist}
\ttitem{SBEND}\label{bend-sbend} is a sector bending magnet. \\
The planes of the pole faces intersect at the centre of curvature of
the curved \hyperref[subsec:local-rbend]{sbend reference system}.
\ttitem{RBEND}\label{bend-rbend} is a specific case of SBEND. \\
The pole faces are parallel. The reference system is the curved
\hyperref[subsec:local-rbend]{rbend reference system}.
\end{madlist}
Bendig magnets are defined by the statements:
\madbox{
label: SBEND, \= L=real, ANGLE=real, TILT=real, \\
\> K0=real, K1=real, K2=real, K1S=real,\\
\> E1=real, E2=real, FINT=real, FINTX=real,\\
\> HGAP=real, H1=real, H2=real,\\
\> KTAP=real, THICK=logical;\\
\> \\
\> \\
label: RBEND, \> L=real, ANGLE=real, TILT=real, \\
\> K0=real, K1=real, K2=real, K1S=real,\\
\> E1=real, E2=real, FINT=real, FINTX=real, \\
\> HGAP=real, H1=real, H2=real, \\
\> KTAP=real, THICK=logical, \\
\> ADD\_ANGLE='array';
}
Bending magnets have the following attributes:
\begin{madlist}
\ttitem{L} The length of the magnet (default: 0 m). \\
For sector bends the declared length is the arc length
of the reference orbit. \\
For rectangular bends the declared length is normally the length of a
straight line joining the entry and exit points, as in the
Figure. \\
Internally \madx only uses the arc length of the reference orbit for
both bend types.\\
\textbf{In order to define \texttt{RBEND}'s with a declared length equal to the
arc length of the reference orbit, the option \texttt{RBARC} must be
previously set to FALSE in \madx with \texttt{Option, RBARC=false;}}
\ttitem{ANGLE} The bend angle (default: 0 rad). \\
A positive bend angle represents a bend to the right, i.e. towards
negative \textit{x} values. Please notice that \texttt{ANGLE} is used to
define bend strength, \texttt{K0}. To define the roll angle use \texttt{TILT}.
\ttitem{ADD\_ANGLE} An array of (maximum 5) bending angles for
multiple passes. See \texttt{ADD\_PASS} option of the
\hyperref[chap:sequence]{\texttt{SEQUENCE}} command. This is only
allowed for \texttt{RBEND} elements and is ignored for \texttt{SBEND}
elements.
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad, i.e. a horizontal bend). \\
A positive angle represents a clockwise rotation. \\
An attribute \texttt{TILT=pi/2} turns a horizontal into a vertical
bend, and a positive \texttt{ANGLE} then denotes a downwards
deflection.
\ttitem{K1} The quadrupole coefficient (Default: 0 m$^{-2}$)\\
$K_1 = (1/B\rho) (\partial B_y / \partial x)$. \\
A positive quadrupole strength implies horizontal focussing of particles,
irrespective of their charge. K1 is taken into account in thick bend transfer map.
Only K0 and K1 are considered for think transfer map, not any other
strengths (like K2, K1S).
% positively charged particles. % Ghislain: sera changé dans le futur!
\ttitem{E1} The rotation angle for the entrance pole face (Default: 0 rad).
\ttitem{E2} The rotation angle for the exit pole face (Default: 0 rad). \\
The pole face rotation angles are referred to the magnet model for
\hyperref[F-RBND]{rectangular bend} and \hyperref[F-SBND]{sector
bend} respectively. If \texttt{E1} and \texttt{E2} are of the same
sign as the bending angle, they reduce the external length
(i.e. opposite to the centre of curvature) of the magnet. \texttt{E1}
and \texttt{E2} must be specified as half of the bending angle of the
magnet to get a \texttt{SBEND} with parallel faces, i.e. turning it
into a \texttt{RBEND}. \texttt{E1} and \texttt{E2} must be specified
as {\it minus} half of the bending angle of the magnet to get a
\texttt{RBEND} with sector faces, i.e. turning it into a
\texttt{SBEND}.
\ttitem{FINT} The fringe field integral at entrance and exit of the
bend. (Default: 0).
\ttitem{FINTX} If defined and positive, the fringe field integral at
the exit of the element, overriding \texttt{FINT} for the
exit. (Default: =\texttt{FINT}) \\
This allows to set different fringe field integrals at entrance
(\texttt{FINT}) and exit (\texttt{FINTX}) of the element.
\ttitem{HGAP} The half gap of the magnet (default: 0 m).
\ttitem{K2} The sextupole coefficient. (Default: 0 m$^{-3}$) \\
$K_2 = (1/B\rho) (\partial^2 B_y / \partial x^2)$. Please note that \texttt{K2}
is not taken into account for bend transfer map.
\ttitem{K1S} The skew quadrupole coefficient
$K_{s} = 1/(2 B \rho) (\partial B_x / \partial x - \partial B_y / \partial y)$\\
where (x,y) is a coordinate system rotated by $-45^\circ$ around s
with respect to the normal one. The default is 0 m$^{-2}$. A
positive skew quadrupole strength implies \textsl{defocussing},
irrespective of the charge of the particles,
in the (x,s) plane rotated by $45^\circ$
around \textit{s} (particles in this plane have \texttt{x = y $>$ 0}).
Please note that \texttt{K1S} is not taken into account for bend transfer map.
\ttitem{H1}The curvature of the entrance pole face.
(Default: 0 m$^{-1}$).
\ttitem{H2} The curvature of the exit pole face. (Default: 0 m$^{-1}$) \\
A positive pole face curvature induces a negative sextupole
component; i.e. for positive \texttt{H1} and \texttt{H2} the centres
of curvature of the pole faces are placed inside the magnet.
\ttitem{K0} Please take note that $K_0$ and $K_0S$ are left in the
data base but are no longer used for the MAP of the bends,
instead \texttt{ANGLE} and \texttt{TILT} are used exclusively. \\
However, \texttt{K0} is assignment of \textbf{relative} field errors
to a bending magnet because
\texttt{K0} is used for the normalization instead of the
\texttt{ANGLE}. (see \hyperref[sec:efcomp]{\texttt{EFCOMP}}).\\
With $K_0 = (1 / B \rho) B_y$, one gets \texttt{K0 = ANGLE / arclength}.
\ttitem{KTAP} The relative change of the dipole strength (See
\texttt{K0} above) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the dipole is calculated as \texttt{K0 * L = ANGLE
* (1 + KTAP)}. See the \hyperref[chap:taper]{\texttt{TAPER}}
command. (Default:~0)
\ttitem{THICK} If this logical flag is set to true the bending
magnet is kept as a thick-element, instead of being
converted into thin-lenses after MAKETHIN. Note that
if used in tracking without a MAKETHIN command it will
remain THICK even if this attribute is false. \\
(Default: false)
\ttitem{KILL\_ENT\_FRINGE} If this logical flag is set to true the
fringe fields on the entrance of the element are not taken into
account (not calculated). \\
(Default: false)
\ttitem{KILL\_EXI\_FRINGE} If this logical flag is set to true the
fringe fields on the exit of the element are not taken into account
(not calculated). \\
(Default: false)
\end{madlist}
\textbf{Note:} Additional attributes can be given to bending magnets; They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.
\vskip 5mm
\textbf{\underline{Fringe Fields:}}
\vskip 3mm
The quantities \texttt{FINT} and \texttt{HGAP} specify the finite extent
of the fringe fields as defined in SLAC-75 \cite{slac75}:
\begin{equation}
\mathrm{FINT}=\int_{-\infty}^\infty \frac{B_y(s)(B_0-B_y(s))}{g \cdot
B_0^2}\,\mathrm{d}s ,\quad\quad g=2\cdot \mathrm{HGAP}.
\end{equation}
The default values of zero corresponds to the hard-edge approximation,
i.e. a rectangular field distribution. For other approximations, enter
the correct value of the half gap, and one of the following values for
\texttt{FINT}:
\begin{center}
\begin{tabular}{l l}
Linear Field drop-off & 1/6 \\
Clamped "Rogowski" fringing field & 0.4 \\
Unclamped "Rogowski" fringing field & 0.7 \\
"Square-edged" non-saturating magnet & 0.45
\end{tabular}
\end{center}
Entering the keyword \texttt{FINT} alone sets the integral to 0.5, which is a
reasonable average of the above values.
Note also that the possibility to specify both \texttt{FINT} and
\texttt{FINTX} allows one to set different values at entrance and exit
of a bend element. \\
This can be particularly useful to set the fringe field integral to zero
on one side only, \textsl{e.g.} when slicing a dipole.
\textbf{\underline {Examples:}}
\madxmp{
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\= \kill
BR: RBEND, L=5., ANGLE=+0.001; \>! Deflection to the right \\
BD: RBEND, L=5., ANGLE=+0.001, TILT= pi/2; \>! Deflection down \\
BL: RBEND, L=5., ANGLE=+0.001, TILT= pi; \>! Deflection to the left \\
BU: RBEND, L=5., ANGLE=+0.001, TILT=-pi/2; \>! Deflection up
}
\section{Dipole edge}
\ttindex{dipedge}
\label{sec:dipedge}
A thin element describing the edge focusing of a dipole has been
introduced in order to make it possible to track trajectories in the
presence of dipoles with pole face angles. Only linear terms are
considered since the higher order terms would make the tracking
non-symplectic. The transformation of the machine elements into thin
lenses leaves dipole edge (\texttt{DIPEDGE}) elements untouched and splits
correctly the \texttt{SBEND}'s.
It does not make sense to use a \texttt{DIPEDGE} alone.
It can be specified at the entrance and the exit of a \texttt{SBEND}.
A dipole edge element is defined by the command:
\madbox{
label: DIPEDGE, \= H=real, E1=real, FINT=real, \\
\> HGAP=real, TILT=real;
}
A \texttt{DIPEDGE} has zero length and five attributes.
\begin{madlist}
\ttitem{H} Is angle/length or 1/rho (default: 0 m$^{-1}$ - for the
default the dipedge element has no effect). (must be equal to that
of the associated \texttt{SBEND})
\ttitem{E1} The rotation angle for the pole face. The sign convention is
as for a \hyperref[bend-sbend]{\texttt{SBEND}} bending magnet. Note that it is
different for an entrance and an exit. (default: 0 rad).
\ttitem{FINT} field integral as for \texttt{SBEND}
\hyperref[F-SBND]{sector bend}. Note that each
\texttt{DIPEDGE} has its own \texttt{FINT}, so that specifying
\texttt{FINTX} is no longer necessary.
\ttitem{HGAP} half gap height of the associated \hyperref[bend-sbend]{\texttt{SBEND}}
bending magnet.
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad, \textsl{i.e.} a horizontal bend). A positive angle represents a
clockwise rotation.
\end{madlist}
% Changed by: Andrea Latina, 6-May-2013
\section{Quadrupole}
\ttindex{quadrupole}
\label{sec:quadrupole}
\madbox{
label: QUADRUPOLE, \= L=real, K1=real, K1S=real, TILT=real,\\
\> KTAP=real, THICK=logical;
}
A \texttt{QUADRUPOLE} has six attributes:
\begin{madlist}
\ttitem{L} The quadrupole length (default: 0 m).
\ttitem{K1} The normal quadrupole coefficient:
$K_1 = 1/(B \rho) (\partial B_y / \partial x)$.\\
The default is 0 m$^{-2}$. A positive normal quadrupole strength
implies horizontal focussing, irrespective of the charge of the particles.
% of positively charged particles.
\ttitem{K1S} The skew quadrupole coefficient
$K_{1s} = 1/(2 B \rho) (\partial B_x / \partial x - \partial B_y / \partial y)$\\
where (x,y) is now a coordinate system rotated by $-45^\circ$ around s
with respect to the normal one. The default is 0 m$^{-2}$. A
positive skew quadrupole strength implies \textsl{defocussing},
irrespective of the charge of the particles,
% of positively charged particles
in the (x,s) plane rotated by $45^\circ$
around \textit{s} (particles in this plane have \texttt{x = y $>$ 0}).
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad, i.e. a normal quadrupole). A positive angle represents a
clockwise rotation. A \texttt{TILT=pi/4} turns a positive normal quadrupole
into a negative skew quadrupole.
\textbf{Please note that contrary to \madeight one has to
specify the desired TILT angle, otherwise it is taken as
0 rad. This was needed to avoid the confusion in \madeight
about the actual meaning of the \texttt{TILT} attribute for
various elements.}
\ttitem{KTAP} The relative change of the quadrupoles strengths (both
\texttt{K1} and \texttt{K1S}) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the quadrupole is calculated as \texttt{K1act = K1
* (1 + KTAP)}. See the \hyperref[chap:taper]{\texttt{TAPER}}
command. (Default:~0)
\ttitem{THICK} If this logical flag is set to true the bending
magnet is kept as a thick-element, instead of being
converted into thin-lenses after MAKETHIN. Note that
if used in tracking without a MAKETHIN command it will
remain THICK even if this attribute is false. \\
(Default: false)
\end{madlist}
\textbf{Note also that $K_1$ or $K_{1s}$ can be considered as
the normal or skew quadrupole components of the magnet on
the bench, while the TILT attribute can be considered as a
tilt alignment error in the machine. In fact, a positive
$K_1$ with a \texttt{TILT = 0} is equivalent to a positive $K_{1s}$
with \texttt{TILT = +$\pi/4$ }}
Example:
\madxmp{QF: QUADRUPOLE, L=1.5, K1=0.001, THICK=true;}
\textbf{Note:} Quadrupoles cannot have any of the attributes of other
magnetic elements, for example, bend (\texttt{K0}) or sextupole
(\texttt{K2} opr \texttt{K2S}). If these have to be considered in
the element, one should use the \texttt{MULTIPOLE} element.
\textbf{Note:} Additional attributes can be given to quadrupoles; They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.
The \hyperref[subsec:local-straight]{straight reference system} for
a quadrupole is a Cartesian coordinate system.
\section{Sextupole}
\ttindex{sextupole}
\label{sec:sextupole}
\madbox{
label: SEXTUPOLE, L=real, K2=real, K2S=real, TILT=real, KTAP=real;
}
A \texttt{SEXTUPOLE} has five real attributes:
\begin{madlist}
\ttitem{L} The sextupole length (default: 0 m).
\ttitem{K2} The normal sextupole coefficient $K_2 = \frac{1}{B \rho}
(\partial^2 B_y / \partial x^2)$. \\
(default: 0 m$^{-3}$).
\ttitem{K2S} The skew sextupole coefficient
$K_{2S} = \frac{1}{B \rho} (\partial^2 B_x / \partial x^2)$ \\
%% 2013-Jul-05 17:58:30 ghislain: error reported by Christian Carli
% \textit{K}$_{2S}$ = 1/(2 \textit{B} rho)
% ($\partial$$^2$\textit{B$_x$}/$\partial$ \textit{x}$^2$ -
% $\partial$$^2$\textit{B$_y$}/$\partial$ \textit{y}$^2$).
where (x,y) is now a coordinate system rotated by $-30^\circ$ around s with
respect to the normal one. (default: 0 m$^{-3}$). A positive skew
sextupole strength implies \textsl{defocussing} (!)
irrespective of the charge of the particles,
% of positively charged particles
in the (x,s) plane rotated by $30^\circ$ around s (particles in
this plane have $x > 0$, $y > 0$).
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad, i.e. a normal sextupole). A positive angle represents a
clockwise rotation. A \texttt{TILT = pi/6} turns a positive normal
sextupole into a negative skew sextupole.
\textbf{Please note that contrary to \madeight one has to specify the
desired \texttt{TILT} angle, otherwise it is taken as
0~rad. This was needed to avoid the confusion in \madeight about
the actual meaning of the \texttt{TILT} attribute for various
elements.}
\ttitem{KTAP} The relative change of the sextupole strengths (both
\texttt{K2} and \texttt{K2S}) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the sextupole is calculated as
\texttt{K2act = K2 * (1 + KTAP)}. See the \texttt{TAPER}
command.\ref{chap:taper}. (Default:~0)
\end{madlist}
\textbf{Note also that $K_2$ or $K_{2s}$ can be considered as the normal
or skew sextupole components of the magnet on the bench, while the
\texttt{TILT} attribute can be considered as an tilt alignment error in the
machine. In fact, a positive $K_2$ with a $\mathtt{TILT} = 0$ is equivalent to a
positive $K_{2s}$ with positive $\mathtt{TILT} = \pi/6$.}
Example:
\madxmp{S: SEXTUPOLE, L=0.4, K2=0.00134;}
\textbf{Note:} Sextupoles cannot have any of the attributes of other
magnetic elements, for example, bend (\texttt{K0}) or
quadrupole (\texttt{K1} or \texttt{K1S}). If these have to be considered
in the element, one should use the \texttt{MULTIPOLE} element.
\textbf{Note:} Additional attributes can be given to sextupoles; They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.
The \hyperref[subsec:local-straight]{straight reference system} for a
sextupole is a Cartesian coordinate system.
\section{Octupole}
\ttindex{octupole}
\label{sec:octupole}
\madbox{
label: OCTUPOLE, L=real, K3=real, K3S=real, TILT=real;
}
An \texttt{OCTUPOLE} has four real attributes:
\begin{madlist}
\ttitem{L} The octupole length (default: 0 m).
\ttitem{K3} The normal octupole coefficient
$K_3 = \frac{1}{B \rho} (\partial^3B_y / \partial x^3)$ \\
(default: 0 m$^{-4}$).
\ttitem{K3S} The skew octupole coefficient
%% 2013-Jul-05 18:00:59 ghislain: to be checked wrt error reported on
%% K2S for sextupoles
$K_{3S} = \frac{1}{2 B\rho} (\partial^3B_x/\partial x^3 -
\partial^3B_y/\partial y^3)$ \\
where (x,y) is now a coordinate system rotated by -22.5$^o$ around
s with respect to the normal one. (default: 0 m$^{-4}$). A positive
skew octupole strength implies \textsl{defocussing} (!)
irrespective of the charge of the particles,
% of positively charged particles
in the (x,s) plane rotated by 22.5$^o$ around s
(particles in this plane have x $>$ 0, y $>$ 0).
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad, i.e. a normal octupole). A positive angle represents a
clockwise rotation. A \texttt{TILT=pi/8} turns a positive normal octupole
into a negative skew octupole.
\textbf{Please note that contrary to \madeight one has to specify the
desired TILT angle, otherwise it is taken as 0 rad. This was
needed to avoid the confusion in \madeight about the actual meaning of
the TILT attribute for various elements. }
\end{madlist}
\textbf{Note also that $K_3$ or $K_{3S}$ can be considered as the normal or
skew quadrupole components of the magnet on the bench, while the
\texttt{TILT} attribute can be considered as an tilt alignment error
in the machine. In fact, a positive $K_3$ with a \texttt{TILT=0} is
equivalent to a positive $K_{3S}$ with positive \texttt{TILT=+pi/8}.}
Example:
\madxmp{O3: OCTUPOLE, L=0.3, K3=0.543;}
\textbf{Note:} Additional attributes can be given to octupoles; They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.
The \hyperref[subsec:local-straight]{straight reference system} for a
octupole is a Cartesian coordinate system. Octupoles are normally
treated as thin lenses, except when tracking by Lie-algebraic methods.
\section{General Thin Multipole}
\ttindex{multipole}
\label{sec:multipole}
A \texttt{MULTIPOLE} is a thin-lens magnet of arbitrary order, including a
dipole component.
\madbox{
label: MULTIPOLE, \= LRAD=real, TILT=real, \\
\> KNL=\{real, \ldots \}, KSL=\{real, \ldots \};
}
The deflection imparted by a
magnetic multipole on a particle is expressed as \textit{integrated
multipole magnetic strength}.
The $n$-th order integrated normal- and skew- magnetic strengths, respectively $K_{\textnormal{N},n}L$ and $K_{\textnormal{S},n}L$, are defined as:
\begin{equation}
\begin{aligned}K_{\textnormal{N},n}L & =\frac{L}{B\rho}\frac{\partial^{n}B_{y}}{\partial x^{n}};\quad\text{and}\quad K_{\textnormal{S,}n}L=\frac{L}{B\rho}\frac{\partial^{n}B_{x}}{\partial x^{n}},\end{aligned}
\label{eq:STRENGHT-1}
\end{equation}
as mentioned in section \ref{sec:normalskew}.
They are both expressed in $[\mathrm{m}^{-n}]$.
\begin{madlist}
\ttitem{LRAD} A fictitious length, originally only used to
compute synchrotron radiation effects. \\
A non-zero \texttt{LRAD} in conjunction with
\hyperref[sec:option]{\texttt{OPTION, THIN\_FOC=true}}
takes into account the weak focussing of bending magnets.
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad). A positive angle represents a clockwise rotation of the
multipole element. The roll angle affects all components.
\ttitem{KNL} An array of the integrated normal multipole coefficients,
starting from order zero and up to the maximum order (currently 20).
The parameters are positional in the array, therefore
zeros must be filled in for components that do not exist. \\
The coefficient of rank $i$ in the array corresponds to the integrated
strength $K_i L = B_i . L / (B\rho)$ where the strength is given by
equation \ref{eq:kn}.
Hence the first argument of the array, the argument for a normal
multipole of order zero, $K_0 L = B_0 . L / (B\rho)$ is equal to
the normal horizontal rotation angle of the thin dipole.
\ttitem{KSL} An array of the integrated skew multipole coefficients,
starting from order zero and up to the maximum order (currently 20). The
parameters are positional in the array, therefore zeros must be
filled in for components that do not exist.
% Hence the first argument of the array, the argument for a skew
% multipole of order zero, $K_0 L = B_0 . L / (B\rho)$ is equal to
% the skew or vertical rotation angle of the thin dipole.
\end{madlist}
Both \texttt{KNL} and \texttt{KSL} may be specified for the same multipole.
Contrary to \madeight the desired \texttt{TILT} angle must be explicitly
specified, and defaults otherwise to 0 rad. The roll angle specified
with \texttt{TILT} is global to all multipolar components.
Hence the \texttt{KNL} and \texttt{KSL} components can be considered as the
normal or skew multipole components of the magnet as measured on the
bench, while the \texttt{TILT} attribute can be considered as an alignment
error as measured in the machine.
A multipole with no dipole component has no effect on the reference
orbit, i.e. the reference system at its exit is the same as at its
entrance. If it includes a dipole component, it has the same effect on
the reference orbit as a dipole with zero length, total deflection
\texttt{angle} defined by: %and \texttt{tilt} defined by:
\begin{equation}
\begin{aligned}
% \mathtt{angle} &= \mathtt{KNL}(0) \\
\mathtt{angle} &= \sqrt{ \mathtt{KNL}(0)^2 + \mathtt{KSL}(0)^2 }\\
\mathtt{tilt} &= \mathtt{TILT} - \arctan (\mathtt{KSL}(0) / \mathtt{KNL}(0))
\end{aligned}
\end{equation}
Note that the \texttt{TILT} attribute of the \texttt{MULTIPOLE}
is added to the intrinsic tilt calculated from \texttt{KNL} and \texttt{KSL}.
%In order to know the current maximum order of a given multipole, use the
%command \texttt{HELP, MULTIPOLE;} and count.
\textbf{Examples:}\\
A thin-lens sextupole:
\madxmp{ms: MULTIPOLE, KNL=\{0, 0, k2l\};}
A thin-lens skew octupole:
\madxmp{mso: MULTIPOLE, KSL=\{0, 0, 0, k3sl\};}
A thin-lens multipole with a normal octupole component and a skew decapole
component:
\madxmp{mod: MULTIPOLE, KNL=\{0,0,0,myoct*lrad\}, KSL=\{0,0,0,0,-1.e-5\};}
A thin-lens dipole bending to the right and down for a total angle of
2 milliradians and a tilt of $\pi/4$ can be equivalently defined as:
\madxmp{
hvbend: MULTIPOLE, KNL=\{1.414e-3\}, KSL=\{1.414e-3\};\\
hvbend: MULTIPOLE, KNL=\{2.e-3\}, TILT= pi/4;\\
hvbend: MULTIPOLE, KSL=\{2.e-3\}, TILT=-pi/4;
}
% moved from element format above
% commented by Ghislain on 2014-01-01
%A special format is used for a \href{multipole.html}{multipole}\index{multipole}:
%\madxmp{
%m: multipole, \= knl= \{kn0, kn1, kn2, ..., knmax\}, \\
% \> ksl= \{ks0, ks1, ks2, ..., ksmax\};
%}
%where knl and ksl give the integrated normal and skew strengths,
%respectively. The commas are mandatory, each strength can be an
%expression; their position defines the order.
% Changed by: Alexander Koschik, 16-May-2006
\section{Solenoid}
\ttindex{solenoid}
\label{sec:solenoid}
Solenoids can be defined in two forms, a thick and a thin version:
\madbox{
xxxxxxxxxxxxxxxxxxxxxxxxxx\=xxxxxxxxxxxxxxxxxxx\= \kill
label: SOLENOID, L=real, \>KS=real; \> ! thick version \\
label: SOLENOID, L=0, \>KS=real, KSI=real; \> ! thin version
}
A \texttt{SOLENOID} has three real attributes:
\begin{madlist}
\ttitem{L} The length of the solenoid (default: 0 m)
\ttitem{KS} The solenoid strength $K_s = B_0 / B\rho$ (default: 0
rad/m). For positive \texttt{KS} and positive particle charge, the
solenoid field points in the direction of increasing $s$.
\ttitem{KSI} The solenoid integrated strength $K_s L$
(default: 0 rad). This additional attribute is needed only when
using the thin solenoid, where $L=0$.
\end{madlist}
Example:
\madxmp{
xxxxxxxxxx\=xxxxxxxxxxxxxxxxxxxx\= \kill
SOLO: \> SOLENOID, L = 2., \> KS = 0.001; \\
THINSOLO: \> SOLENOID, L = 0, \> KS = 0.001, KSI = 0.002;
}
\textbf{Note:} Additional attributes can be given to solenoids. They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.
In particular multipole coefficients \texttt{KNL} and \texttt{KSL} can
also be specified for solenoids. They have no effect in \madx proper but
are used in \ptc for solenoid with multipoles.
The \hyperref[subsec:local-straight]{straight reference system} for a
solenoid is a Cartesian coordinate system.
\section{Nonlinear Lens with Elliptic Potential}
\ttindex{nllens}
\label{sec:nllens}
\madbox{
label: NLLENS, KNLL=real, CNLL=real;
}
The \texttt{NLLENS} element represents a thin nonlinear lens with the potential
of 'Elliptic' type as specified in \cite{danilov2010}. The lens is used
to create fully integrable 2D nonlinear accelerator lattice with very
large nonlinear tune spread/shift. The \texttt{NLLENS} element is recognized by
the thin tracking module. The quadrupole term of the potential is
included in the transport map and, consequently, affects the calculation
of tunes and Twiss functions.
\begin{madlist}
\ttitem{KNLL} The integrated strength of lens (m). The strength is
parametrized so that the quadrupole term of the multipole
expansion is \texttt{k1=2*KNLL/CNLL\textasciicircum2}.
\ttitem{CNLL} The dimensional parameter of lens (m). The singularities
of the potential are located at X=-CNLL,+CNLL and Y=0.
\end{madlist}
The scalar potential function of the element is given by
\begin{equation}
U(x,y)=\frac{k}{c}\frac{\xi\sqrt{\xi^2-1} \, \text{acosh}\xi +
\eta\sqrt{1-\eta^2}(\text{acos}\eta-\pi/2)}{\xi^2-\eta^2}
\end{equation}
\\ where \textit{k} = KNLL, \textit{c} = CNLL and
\begin{equation}
\xi = \frac{\sqrt{(x+c)^2+y^2}+\sqrt{(x-c)^2+y^2}}{2c},
\quad \eta = \frac{\sqrt{(x+c)^2+y^2}-\sqrt{(x-c)^2+y^2}}{2c},
\end{equation}
Figure below shows the contour plot of the scalar potential: \\
\begin{figure}
\centering
%\includegraphics[width=220bp]{png/nllens_potential-2D.png}
\includegraphics[width=220bp]{jpg/nllens_potential-2D.jpg}
\caption{Contour plot of the scalar potential}
\label{fig:nllens-potential}
\end{figure}
The multipole expansion of the scalar potential is \\
\begin{equation}
U(x,y)=k\cdot Re\left\{ \left(\dfrac{x + i y}{c}\right)^2 +
\frac{2}{3}\left(\dfrac{x + i y}{c}\right)^4 +
\frac{8}{15}\left(\dfrac{x + i y}{c}\right)^6 +
\frac{16}{35}\left(\dfrac{x + i y}{c}\right)^8 + \cdots \right\}
\end{equation}
\\
Note that this expansion is only valid inside the \textit{r=c} circle on
the x,y plane.
In order to create integrable optics, one needs to shape the potential
along z axis according to the beta-function. Below is an example
nonlinear section representing the necessary nonlinear field with 20
thin lenses:
\begin{verbatim}
mu0 = 0.3; ! phase advance over straight section
l0 = 2.0; ! length of the straight section
nn = 20; ! number of nonlinear elements
tn = 0.45; ! strength of nonlinear lens
cn = 0.01; ! dimentional parameter of nonlinear lens
musect = mu0 + 0.5;
f0 = l0/4.0*(1.0+1.0/tan(pi*mu0)^2);
betae = l0/sqrt(1.0-(1.0-l0/2.0/f0)^2);
alfae = l0/2.0/f0/sqrt(1.0-(1.0-l0/2.0/f0)^2);
betas = l0*(1-l0/4.0/f0)/sqrt(1.0-(1.0-l0/2.0/f0)^2);
value, f0, betae, alfae, betas;
ncreate(ii,kk,cc): macro = {n.ii: nllens, knll=kk, cnll=cc;};
i=0;
while(i < nn)
{
i = i+1;
sn = l0/nn*(i-0.5);
bn = l0*(1-sn*(l0-sn)/l0/f0)/sqrt(1.0-(1.0-l0/2.0/f0)^2);
knn = l0*tn*cn^2/nn/bn;
cnn = cn*sqrt(bn);
exec, ncreate($i,knn,cnn);
value, i, bn, cnn, knn;
};
\end{verbatim}
%% To be moved in References at the end of the document
%% References:
%% \begin{enumerate}
%% \item V. Danilov, S. Nagaitsev, Phys. Rev. ST Accel. Beams \textbf{13},
%% 084002 (2010).
%% \item A. Valishev, S. Nagaitsev, V. Kashikhin, V. Danilov, in
%% Proceedings of 2011 Particle Accelerator Conference, New York, NY,
%% USA, WEP070.
%% \end{enumerate}
%A. Valishev, March 19, 2012
% Changed by: Frank Schmidt, 28-Aug-2003
% Changed by: Werner Herr, 22-May-2007
\section{Closed Orbit Corrector}
\ttindex{kicker}\index{orbit corrector}
\label{sec:closed-orbit-cor}\label{sec:kicker}
Three types of magnetic closed orbit correctors are available:
\begin{madlist}
\ttitem{HKICKER} a corrector for the horizontal plane,
\ttitem{VKICKER} a corrector for the vertical plane,
\ttitem{KICKER} a corrector for both planes.
\end{madlist}
\madbox{
xxxxxxxxxxxxxxxx\=xxxxxxxxxxxxxxxxxxxx\= \kill
label: HKICKER, \>L=real, KICK=real, \>TILT=real; \\
label: VKICKER, \>L=real, KICK=real, \>TILT=real; \\
label: KICKER, \>L=real, HKICK=real, \>VKICK=real, TILT=real;
}
\textbf{The type \texttt{KICKER} should not be used when an orbit corrector
kicks only in one plane.}
The attributes have the following meaning:
\begin{madlist}
\ttitem{L} The length of the closed orbit corrector (default: 0 m).
\ttitem{KICK} The momentum change $\delta PX = \delta p_x/p_0$ or
$\delta PY = \delta p_y / p_0$ for respectively horizontal or vertical
correctors. (default: 0).
\ttitem{HKICK} The horizontal momentum change
$\delta PX = \delta p_x/p_0$ for a corrector acting in both planes
(default: 0).
\ttitem{VKICK} The vertical momentum change
$\delta PY = \delta p_y/p_0$ for a corrector acting in both planes
(default: 0).
\ttitem{TILT} The roll angle about the longitudinal axis (default: 0
rad). A positive angle represents a clockwise rotation of the
kicker.
\end{madlist}
A positive kick increases $p_x$ or $p_y$ respectively. This
means that a positive horizontal kick bends to the left, i.e. to
positive $x$ which is opposite of what is true for bends.
The deviation angle $\theta$ of the particle trajectory is related to
the momentum change through $\sin \theta = \delta P = \delta p / p_0$.
It should be noted that the kick values assigned to an orbit corrector
like above are not overwritten by an orbit correction using the
\hyperref[sec:correct]{\texttt{CORRECT}}
command. Instead the kicks computed by an orbit correction and the
assigned values are added when the correctors are used.
Examples:
\madxmp{
xxxxxxx\=xxxxxxxxxx\=xxxxxxxxxxxxxxxxx\= \kill
HK1: \>HKICKER, \>KICK = 0.001; \\
VK3: \>VKICKER, \>KICK = 0.0005; \\
VK4: \>VKICKER, \>KICK := AVK4; \\
KHV1: \>KICKER, \>HKICK = 0.001, \>VKICK = 0.0005; \\
KHV2: \>KICKER, \>HKICK := AKHV2H, \>VKICK := AKHV2V;
}
The assignment in the form of a deferred expression has the advantage
that the values can be assigned and/or modified at any time (and
matched!).
The \hyperref[subsec:local-straight]{straight reference system} for an
orbit corrector is a Cartesian coordinate system.
Please note that there is a new feature introduced by Stefan Sorge from
GSI. Here his decription:
The elements \texttt{KICKER, HKICKER}, and \texttt{VKICKER} can also be used as
magnetic exciters providing sinusoidal momentum kicks. The usage in this case
is:
\madxmp{
xykick: KICKER, \= SINKICK=integer, SINPEAK=real, SINTUNE=real, SINPHASE=real; \\
xkick : HKICKER, \> SINKICK=integer, SINPEAK=real, SINTUNE=real, SINPHASE=real; \\
ykick : VKICKER, \> SINKICK=integer, SINPEAK=real, SINTUNE=real, SINPHASE=real;
}
where a sinusoidal momentum kick \texttt{dpz} as a function of the revolution
number \texttt{n} given by\\
\texttt{dpz(n)=SINPEAK * sin(2*PI*SINTUNE*n + SINPHASE), pz=px,py} \\
is provided.
The \texttt{KICKER} element generates synchronous kicks in both horizontal and
vertical planes. \texttt{HKICKER} generates only a horizontal kick, and
\texttt{VKICKER} generates only a vertical kick.
The variables are
\begin{madlist}
\ttitem{SINKICK} must be set to 1 to switch on the sinusoidal
signal, default: 0.
\ttitem{SINPEAK} amplitude of the bending angle (rad); default: 0
rad.
\ttitem{SINTUNE} frequency of the signal times the revolution
frequency. Hence, the phase per revolution is 2*PI*SINTUNE;
default: 0.
\ttitem{SINPHASE} initial phase; default: 0 rad.
\end{madlist}
The momentum kick of a kicker has only a single frequency. An element
having a finite bandwidth can approximately created by defining thin
kickers with all amplitudes \texttt{SINPEAK}, frequencies
\texttt{SINTUNE}, and initial phases \texttt{SINPHASE} desired and
putting them at the same position \textit{s} in the accelerator.
%From S.Sorge@gsi.de
% Created by: Laurent Deniau, 15-Sep-2011
\section{Transverse Kicker}
\ttindex{tkicker}
\label{sec:tkicker}
The type \texttt{TKICKER} should be used to create horizontal, vertical or
combined transverse magnetic kickers physically equivalent to elements of type
\texttt{KICKER}, but \textbf{not used} by the \hyperref[sec:correct]{CORRECT}
command of the closed orbit correction module.
Examples of elements that may use the type \texttt{TKICKER}:
\begin{itemize}
\item Fast kickers for injection, dump and tune
\item Magnetic septa towards beam dump
\item Dampers of transverse beam oscillations
\item Undulator and Wiggler magnets
\end{itemize}
For further information on element type \texttt{TKICKER} and its attributes, look
at the documentation of the orbit corrector type
\hyperref[sec:kicker]{\texttt{KICKER}}.
\section{RF Cavity}
\ttindex{RFcavity}
\label{sec:rf-cavity}\label{sec:rfcavity}
\madbox{
label: RFCAVITY, \= L=real, VOLT=real, LAG=real, \\
\> FREQ=real, HARMON=integer, \\
\> N\_BESSEL=integer, NO\_CAVITY\_TOTALPATH=logical;
}
An \texttt{RFCAVITY} has eight real attributes and one integer attribute:
\begin{madlist}
\ttitem{L} The length of the cavity (DEFAULT: 0 m)
\ttitem{VOLT} The peak electrical RF voltage (DEFAULT: 0 MV). The effect of
the cavity is \\
delta(\textit{E}) = VOLT * sin(2$\pi$ * (LAG - HARMON * \textit{f$_0$ t})).
\ttitem{LAG} The phase lag [$2\pi$] (DEFAULT: 0).
\ttitem{FREQ} The frequency [MHz] (no DEFAULT). \\[3mm]
\textbf{Note that if the RF frequency is not given, it is computed
from the harmonic number and the revolution frequency
\textit{f$_0$}. For accelerating structures this makes no sense,
and the input of the frequency is mandatory.}
\ttitem{HARMON} The harmonic number \textit{h} (no DEFAULT). This
attribute is only used if the frequency is not given.
\end{madlist}
\textbf{Caveats:}
\begin{itemize}
\item Please take note, that the following \madeight attributes:
\texttt{BETRF, PG, SHUNT} and \texttt{TFILL} are currently not implemented in
\madx.
% \item BETRF: RF coupling factor (DEFAULT: 0).
% \item PG: The RF power per cavity (DEFAULT: 0 MW).
% \item SHUNT: The relative shunt impedance (DEFAULT: 0 MOhm/m).
% \item TFILL: The filling time of the cavity $T_{fill}$ (DEFAULT: 0 microseconds).
\item Important Note: The \hyperref[chap:twiss]{\texttt{TWISS}} command
is 4D only. As a consequence the \texttt{TWISS} parameters in the plane
of non-zero dispersion may not close as expected. Therefore, it is best
to perform \texttt{TWISS} in 4D only, \textsl{i.e.} with cavities
switched off. If 6D is needed one has to use the
\hyperref[sec:ptc-twiss]{\texttt{PTC\_TWISS}} command.
Please refer to \hyperref[sec:ptc-setswitch]{\texttt{PTC\_SETSWITCH}} command,
in particular to \texttt{TIME} and \texttt{TOTALPATH} switches,
concerning RF behaviour of cavities in PTC.
\item The charge is not taken into account by the RF-cavity.
\item The RF-cavity has to be thin for TRACKING in MAD-X. This is handled by
\texttt{MAKETHIN} but note that it is always sliced into a single slice.
\end{itemize}
The \texttt{RFCAVITY} can also have attributes that only become active in
\ptc:
\begin{madlist}
\ttitem{N\_BESSEL} (DEFAULT: 0): \\
Transverse focussing effects are typically ignored in the cavity in
\madx or even \ptc. This effect is being calculated to order
\texttt{n\_bessel}, with \texttt{n\_bessel=0} disregarding this
effect and with a correct treatment when \texttt{n\_bessel} goes to
infinity.
\ttitem{NO\_CAVITY\_TOTALPATH} (Default: false): \\
flag to select whether the transit time factor in the cavity is to be
considered (\texttt{NO\_CAVITY\_TOTALPATH = false}) or if the particle is
kept on constant RF phase when passing through cavity. (\texttt{NO\_CAVITY\_TOTALPATH = true}).
\end{madlist}
A cavity requires the particle \hyperref[sec:beam]{\texttt{ENERGY}}
and the particle \hyperref[sec:beam]{\texttt{CHARGE}} to be set by a
\hyperref[sec:beam]{\texttt{BEAM}} command before any calculations are
performed.
Example:
\madxmp{
BEAM, PARTICLE=ELECTRON, ENERGY=50.0; \\
CAVITY: RFCAVITY, L=10.0, VOLT=150.0, LAG=0.0, HARMON=31320;
}
The \hyperref[subsec:local-straight]{straight reference system} for a
cavity is a Cartesian coordinate system.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Travelling Wave Cavity}
\ttindex{TWcavity}
\label{sec:tw-cavity}\label{sec:twcavity}
\madbox{
label: TWCAVITY, \= L=real, VOLT=real, FREQ=real, LAG=real, \\
\> PSI=real, DELTA\_LAG=real ;
}
The travelling wave cavities model the accelerating structures of linacs
where wavefront moves together with the accelerated particles.
This element is implemented only by PTC and is treated as drift
by native MADX commands. The phase velocity is fixed to speed of light
and can not be varied.
\begin{madlist}
\ttitem{L} The length of the cavity (DEFAULT: 0 m)
\ttitem{VOLT} The peak electrical RF voltage (DEFAULT: 0 MV).
\ttitem{FREQ} The frequency [MHz] (no DEFAULT). \\[3mm]
\ttitem{LAG} The phase lag [$2\pi$] (DEFAULT: 0). Zero lag means the highest acceleration,
i.e. the reference particle (starting at x=0, px=0, y=0, py=0,t=0, pt=0)
is on the crest of the wave. Please note that it is different from
the \texttt{RFCAVITY} nomenclature.