As mentioned in the introduction, elegant uses a variant of the MAD input format for describing accelerators. With some exceptions, the accelerator description for one program can be read by the other with no modification. Among the differences:
link_elements
namelist command
can be used for this purpose, and is actually more flexible than the
method used by MAD. Also, rpn
-style equations may be given
in double-quotes; these are evaluated once only when the lattice
is parsed.
elegant's lattice parser translates all input into upper case, except where the input is protected by double quotes. However, various commands (such as vary_element or link_elements) that accept element names as input do not perform any translation. Hence, when referring to element names in commands, the user must enter the names in upper case unless they are protected by double quotes in the lattice file.
elegant's print_dictionary
command allows the user to
obtain a list of names and short descriptions of all accelerator
elements recognized by the program, along with the names, units,
types, and default values of all parameters of each element.
The present output of this command is listed in the next section.
The reader is referred to the MAD manual[2] for details on sign
conventions for angles, focusing strength, and so forth.
Comments may be embedded in the lattice file by starting a line with an exclamation point (``!''). Rpn expressions may be embedded separately from an element definition by starting a line with a percent sign (``For example
! Define pi % 1 atan 4 * sto Pi % Pi 40 / sto myAngle ! Define a rectangular bend for a ring with 80 equal bends B1: SBEN,L=1.0,ANGLE=''myAngle'',E1=''myAngle 2 /'',E2=''myAngle 2 /''(Note that pi is already defined in the standard defns.rpn file.)