MADX Demo: Elements

coverpage copyright

  • I Elements, Beamlines and Sequences
    • 1 Definition of Elements

Part I Elements, Beamlines and Sequences

Definition of Elements


Element Input Format


All physical elements are defined by statements of the form \madbox label: keyword {,attribute}; where


label is a name to be given to the element. \ttitemkeyword is an element type keyword. \ttitemattribute normally – with exception for multipoles – takes one of the two forms: \madxmpattribute-name =̄ attribute-value
attribute-name := attribute-value {madlist} \ttitemattribute-name selects the attribute, as defined for the element type keyword. \ttitemattribute-value provides a value to the attribute_name. The value may be specified by an expression. The ”=” assigns the value on the right to the attribute at the time of definition, regardless of any further change of the right hand side; the ”:=” re-evaluates the expression at the right every time the attribute is being used. For constant right hand sides, ”=” and ”:=” are of course equivalent.

Omitted attributes are assigned a default value.

Example: \madxmpQF: QUADRUPOLE, L=1.8, K1=0.015832;

A special format is used for a multipole: \madxmp M: MULTIPOLE, K̄N= kn0, kn1, kn2, …, knmax,
KS= ks0, ks1, ks2, …, ksmax; where KN and KS give the integrated normal and skew strengths, respectively. The commas are mandatory, each strength can be an expression; their position defines the order. example: \madxmpM: MULTIPOLE, KN=0,0,0,myoct*lrad, KS=0,0,0,0,-1.e-5; defines a multipole with a normal octupole component and a skew decapole component.

Editing Element Definitions


An element definition can be changed in two ways:

  • Entering a new definition: The element will be replaced in the main beam line expansion.

  • Entering the element name together with new attributes: