The relative energy error DELTAP may be entered in one of the 2 forms
DELTAP=real{,real}The first form lists several numbers, which may be general expressions, separated by commas. The second form specifies an initial value, a final value, and a step, which must be constant expressions, separated by colons.
DELTAP=initial:final:step
Examples:
DELTAP=0.001 ! a single valueIf DELTAP is missing, MAD-X uses the value 0.0.
DELTAP=0.001,0.005 ! two values
DELTAP=0.001:0.007:0.002 ! four values
Further attributes of the TWISS statements are:
Please note that this option is needed for a proper calculation of the chromaticities in the presence of coupling!
TWISS, DELTAP=real{,value},CHROM,It computes the periodic solution for the specified beam line for all values of DELTAP entered (or for DELTAP = 0, if none is entered).
TABLE=table_name;
Example:
USE,period=OCT;This example computes the periodic solution for the linear lattice and chromatic functions for the beam line OCT. The DELTAP value used is 0.001. Apart from saving computing time, it is equivalent to the command sequence
TWISS,DELTAP=0.001,CHROM;
RING: LINE=(4*(OCT,-OCT));
USE,period=RING;
TWISS,DELTAP=0.001,CHROM;
TWISS, DELTAP=real{,value},LINE=beam-line,No other attributes should appear in the command. For each value of DELTAP MAD-X first searches for the periodic solution for the beam line mentioned in LINE=beam-line: The result is used as an initial condition for the lattice function tracking.
MUX=real,MUY=real,
TABLE=table_name;
Example:
CELL: LINE=(...);For four values of DELTAP the following happens: First MAD-X finds the periodic solution for the beam line CELL: Then it uses this solution as initial conditions for tracking the lattice functions of the beam line CELL: Output is also written on the file TWISS:
INSERT: LINE=(...);
USE,period=INSERT;
TWISS,LINE=CELL,DELTAP=0.0:0.003:0.001,CHROM,FILE;
If any of the beam lines was defined with formal arguments, actual arguments must be provided:
CELL(SF,SD): LINE=(...);
INSERT(X): LINE=(...);
USE,period=INSERT;
TWISS,LINE=CELL(SF1,SD1);
TWISS, BETX=real,ALFX=real,MUX=real,All initial values for linear lattice functions and chromatic functions are permitted, but BETX and BETY are required. Moreover, a beta0 block can be added as filled by the savebeta command or see below. The lattice parameters are taken from this block, but will be overwritten by explicitly stated lattice parameters. As entered, the initial conditions cannot depend on DELTAP, and can thus be correct only for one such value.
BETY=real,ALFY=real,MUY=real,
DX=real,DPX=real,DY=real,DPY=real,
X=real,PX=real,Y=real,PY=real,
T=real,PT=real,
WX=real,PHIX=real,DMUX=real,
WY=real,PHIY=real,DMUY=real,
DDX=real,DDY=real,DDPX=real,DDPY=real,
R11=real,R12=real,R21=real,R22=real, !coupling matrix
TABLE=table_name,
TOLERANCE=real,
DELTAP=real:real:real;
It should be mentioned that parameters can be also accessed from tables using the table access function.
USE,period=...;When reaching the place in the sequence "s_name" during execution of TWISS, MAD-X will save a beta0 block with the label name: This block is filled with the values of all lattice parameters in place. Example 1:
SAVEBETA,LABEL=name,PLACE=place,SEQUENCE=s_name;
TWISS,...;
USE,period=CELL;This first example calculates the periodic solution of the line CELL, and then track lattice parameters through INSERT, using all end conditions (including orbit) in CELL to start.
SAVEBETA,LABEL=END,PLACE=#E,SEQUENCE=CELL;
TWISS;
USE,period=INSERT;
TWISS,BETA0=END;
Example 2:
USE,period=CELL;
SAVEBETA,LABEL=END,PLACE=#E,SEQUENCE=CELL;
TWISS;
USE,period=INSERT;
TWISS,BETX=END->BETY,BETY=END->BETX;
This is similar to the first example,
but the beta functions are interchanged (overwritten).