MADX Demo: Elements

coverpage copyright

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

Part I Elements, Beamlines and Sequences

Definition of Elements

\label{chap:element_definition}

Element Input Format

\label{sec:element_input}

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

{madlist}\ttitem

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

\label{sec:element_editing}

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: The element will be updated in place, and the new attribute values will replace the old ones.

This example shows two ways to change the strength of a quadrupole: \madxmp xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx¯QF: QUADRUPOLE, L = 1, K1 = 0.01; ! Original definition of QF

QF: QUADRUPOLE, L = 2, K1 = 0.02; ! Replace whole definition of QF

QF, K1 = 0.03; ! Replace value of K1 for