Skip to content

Lattice Elements

ChristopherMayes edited this page Sep 6, 2017 · 14 revisions

General Syntax for Defining a Lattice Element

<lattice_name>: <element_type>, <param1> = <val1>, <param2> = <val2>, ...

Example:

d1: drift, l = 1.2   ! 1.2 m drift space called "d1"
mk: marker           ! Marker element called "mk".

Notes:

  • Marker elements have zero length.

Quadrupole Elements

Example:

beginning[beta_a] = 10.     ! m  a-mode beta function
beginning[beta_b] = 10.     ! m  b-mode beta function
parameter[p0c] = 1e6        ! Set reference momentum * c_light in eV.
parameter[geometry] = open  ! or closed

q1: quad, l = 0.6, k1 = 0.14
q2: quad, l = 0.6, b1_gradient = parameter[p0c] * q1[k1] / c_light

lat: line =	(q1, q2)
use, lat

Put this lattice into a file called "quad.bmad" and run Tao:

> tao -lat quad.bmad

Tao> show ele 2
 Element #                2
 Element Name: Q2
 Key: Quadrupole
 S_start, S:    0.600000,    1.200000
 Ref_time:  4.495094E-09

 Attribute values [Only non-zero/non-default values shown]:
    1   L                            =  6.0000000E-01 m
    4   K1                           =  1.4000000E-01 1/m^2    ! Same as Q1 !!!
   13   SPIN_FRINGE_ON               =  T (1)
   31   L_HARD_EDGE                  =  6.0000000E-01 m
   45   B1_GRADIENT                  =  4.6698973E-04 T/m
   47   PTC_CANONICAL_COORDS         =  1.0000000E+00
   50   DELTA_REF_TIME               =  2.2475468E-09 sec
   53   P0C                          =  1.0000000E+06 eV            BETA            =  0.890475155
   54   E_TOT                        =  1.1229960E+06 eV            GAMMA           =  2.1976483E+00
... etc...
         FIELD_MASTER                 =  T

This illustrates that the quadrupole field gradient can be set using the normalized gradient k1 or the "unnormalized" field itself using b1_gradient.

Roughly, the angular deflection an on-energy particle with offset delta_x from the center line feels going through the quad is

delta x' = k1 * L * delta_x

Notes:

  • Positive k1 gives focusing in the horizontal plane and defocusing in the vertical plane.
  • If k1 is specified, Bmad will compute b1_gradient and vice versa.
  • To tilt a quadrupole use the tilt parameter.

Bend Elements

If the e1 and e2 face angles are zero, rbends are "rectangular" shaped bending magnets and sbends are "sector" shaped bending magnets.

Main Bend parameters are:

angle Bending angle α (radians).
rho Bending radius (m).
g Bending strength = 1 / rho.
l length of element. Note: For an rbend, l is the chord length!
e1, e2 Face rotation angles (radians).

Example:

b: sbend, l = 3.2, angle = 90*deg, e1 = b[angle]/2, e2 = b[angle]/2

Notes:

  • angle, rho, g and l are not all independent. You must specify two and only two (and not rho and g together) and Bmad will compute the other two.
  • Internally, Bmad converts all rbends to sbends. Never search for rbends when running Tao. You will not find any.
  • When an rbend is converted to an sbend, l -> l_chord.

More Info

Bmad has many element types to choose from: