CIRCLE, RECTANGLE, ELLIPSE,
RECTCIRCLE, a superposition of an CIRCLE and a RECTANGLE,
LHCSCREEN, an alias for RECTCIRCLE,
RECTELLIPSE, a superposition of an ELLIPSE and a RECTANGLE,
and RACETRACK.
Note that the MARGUERITE aperture type (two RECTCIRCLEs crossing at right angle) is no longer supported.
APERTYPE | # of values | meaning of values |
---|---|---|
CIRCLE | 1 | radius of circle |
ELLIPSE | 2 | horizontal and vertical semi-axes of ellipse |
RECTANGLE | 2 | half width and half height of rectangle |
RECTCIRCLE | 3 | half width and half height of rectangle, radius of circle |
LHCSCREEN | 3 | half width and half height of rectangle, radius of circle |
RECTELLIPSE | 4 | half width and half height of rectangle, horizontal and vertical semi-axes of ellipse |
RACETRACK | 3 | horizontal and vertical offsets (g and s) of the circle center, radius (r) of the circular part (see figure below) |
filename | 0 | where the file contains a list of x and y coordinates outlining the shape. This option is only supported by the aperture module, see below. |
The following sets an ELLIPTICAL aperture for the main dipoles for the LHC.
MB: SBEND, L=l.MB, APERTYPE=ELLIPSE, APERTURE={0.02202,0.02202};When the aperture is specified in a specific file the only aperture parameter is the filename:
MB: SBEND, L=l.MB, APERTYPE=myfile;where "myfile" contains the list of x-y coordinates defining the aperture shape:
x0 y0 xi yi ... xn ynNotes:
select,flag=twiss,clear; select,flag=twiss,column=name,s,betx,alfx,mux,bety,alfy,muy,apertype,aper_1,aper_2;and a subsequent TWISS command will put the aperture information together with the specified TWISS parameters into the TWISS table.
Syntax: APER_TOL = {r, g, s}; MB : SBEND, L := l.MB, APER_TOL={1.5, 1.1, 0};
The APERTURE module computes the n1 values for a piece of machine. Each element is sliced into thick subelements at given intervals, and the available aperture is computed at the end of each slice. The computation is based on the last Twiss table, so it is important to run the Twiss and aperture commands on the same period or sequence, see the aperture example below. Also showed in the example is how n1 values can be plotted.
The minimum n1 for each element is written to the last Twiss table, to allow for matching by aperture.
APERTURE, RANGE=range, EXN=real, EYN=real, DQF=real, DPARX=real, DPARY=real, BETAQFX=real, BBEAT=real, DP=real, COR=real, NCO=integer, HALO={real,real,real,real}, HALOFILE=filename, INTERVAL=real, SPEC=real, NOTSIMPLE=logical, TRUEPROFILE=filename, OFFSETELEM=filename, FILE=filename;where the parameters have the following meaning:
Important note regarding emittances:
The APERTURE module sets the actual emittance from the normalized values given as input using
ex = exn / gamma,
while the BEAM command in MAD-X uses the definition
ex = exn / (4 * beta * gamma)
magnet.name1 So X Y Si X Y Si X Y Sn X Y magnet.name2 So X Y Si X Y Si X Y Sn X Y ...
!This is the start of the file. !Comments are made with exclamation marks. mb.a14r1.b1 0 0.0002 0.000004 7.15 1.4e-5 0.3e-3 14.3 0.0000000032 4e-6 !further comments can of course be added mq.22r1.b1 0 0.3e-5 1.332e-4 1.033 0.00034 0.3e-9 2.066 0 0.00e-2 3.1 4.232e-4 0.00000003 !This is the end of the file.
X_act(s) = DDX_OFF * s^2 + DX_OFF * s + X_OFFand
Y_act(s) = DDY_OFF * s^2 + DY_OFF * s + Y_OFF
The resulting offset, in each plane, which is taken into account in the aperture calculation, is the difference between reference position and actual position:
X_offset(s) = X_ref(s) - X_act(s)and
Y_offset(s) = Y_ref(s) - Y_act(s)
The offsets are only calculated for elements for which actual positions have been given through the OFFSETELEM file mechanism.
The file must be given in TFS format according to the following template, with mandatory header and any number of data lines, one per element.
@ NAME %06s "OFFSET" @ TYPE %06s "OFFSET" @ REFERENCE %10s "reference-element-name" * NAME S_IP X_OFF DX_OFF DDX_OFF Y_OFF DY_OFF DDY_OFF $ %s %le %le %le %le %le %le %le "elementname" real real real real real real real
Note that the column S_IP is actually not used, and the values are ignored, but the column and values are parsed nevertheless and must be present. The absence of this column will trigger an error.
Example:
@ NAME %06s "OFFSET" @ TYPE %06s "OFFSET" @ REFERENCE %10s "mq.12r1.b1" * NAME S_IP X_OFF DX_OFF DDX_OFF Y_OFF DY_OFF DDY_OFF $ %s %le %le %le %le %le %le %le "mq.12r1.b1" 0.0 -3.0 -2.56545 0.0 0.0 -2.3443666 0.0 "mcbxa.3r2" 0.0 -0.84 32.443355 0.3323 0.0 32.554363 0.2522
As an example we see in the picture below how the horizontal axes of elements m1 and m2 does not coincide with the reference trajectory.
Note that prior to MAD-X version 4, the layout of the file was different and not formatted as TFS file:
reference-element-name elementname DDX_OFF DX_OFF X_OFF DDY_OFF DY_OFF Y_OFF
Example:
!comment can be given anywhere with an exclamation mark mq.12r1.b1 !Then we give a list of elements and their displacement !w.r.t. the reference point. mcbxa.3l2 0 -2.56545 -3 0 -2.3443666 0 !The next element use the same reference point. !Elements offset w.r.t. another point must be given in another file, !together with the new reference point. mcbxa.3r2 0.3323 32.443355 -0.84 0.2522 32.554363 0.0 !This is the end of the file.
The aperture module needs a Twiss table to operate on. It is important not to USE another period or sequence between the Twiss and aperture module calls, else aperture looses its table. One can choose the ranges for Twiss and aperture freely, they need not be the same.
Use, period=lhcb1; Select, flag=twiss, range=mb.a14r1.b1/mb.a17r1.b1, column=keyword,name,parent,k0l,k1l,s,betx,bety,n1; Twiss, file=twiss.b1.data, betx=beta.ip1, bety=beta.ip1, x=+x.ip1, y=+y.ip1, py=+py.ip1; Plot, haxis=s, vaxis=betx,bety, colour=100; Select, flag=aperture, column=name,n1,x,dy; Aperture, range=mb.b14r1.b1/mb.a17r1.b1, spec=5.235; Plot, table=aperture, noline,vmin=0, vmax=10, haxis=s, vaxis=n1, spec, on_elem, style=100;
The select command can be
used to choose which columns to print in the output file.
Column names:
name, n1, n1x_m, n1y_m, apertype,
aper_1, aper_2, aper_3, aper_4,
rtol, xtol, ytol,
s, betx, bety, dx, dy, x, y,
on_ap, on_elem, spec
n1 is the maximum beam size in sigma, while n1x_m and n1y_m is the n1 values in SI units in the x- and y-direction.
Note that specifying the apertype column automatically selects also the
aper_1, aper_2, aper_3 and aper_4 columns.
The statement
Select, flag=aperture, column=apertype;
is equivalent to
Select, flag=aperture, column=apertype, aper_1, aper_2, aper_3, aper_4;
aper_# means for all apertypes but racetrack:
aper_1 = half width rectangle
aper_2 = half heigth rectangle
aper_3 = horizontal semi-axis ellipse (or radius if circle)
aper_4 = vertical semi-axis ellipse
For racetrack, the aperture parameters will have the same meaning as the tolerances:
aper_1 and xtol = horizontal displacement of radial part
aper_2 and ytol = vertical displacement of radial part
aper_3 and rtol = radius
aper_4 = not used
On_elem indicates whether the node is an element or a drift, and on_ap whether it has a valid aperture. The Twiss parameters are the interpolated values used for aperture computation.
When one wants to plot the aperture, the table=aperture parameter is necessary. The normal line of hardware symbols along the top is not compatible with the aperture table, so it is best to include noline. Plot instead the column on_elem along the vaxis to have a simple picture of the hardware. Spec can be used for giving a limit value for n1, to have something to compare with on the plot. This example provides a plot,
where we see the n1, beta functions and the hardware symbolized by on_elem.