Tracks through a wiggler using canonical integration routines of Y. Wu (Duke University).
Parallel capable? : yes
GPU capable? : no
Backtracking capable? : no
Parameter Name  Units  Type  Default  Description 
L  M  double  0.0  Total length 
B_MAX  T  double  0.0  Maximum onaxis magnetic field. 
BX_MAX  T  double  0.0  Maximum onaxis magnetic field. Ignored if B_MAX is nonzero. 
BY_MAX  T  double  0.0  Maximum onaxis magnetic field. Ignored if B_MAX is nonzero. 
TGU_GRADIENT  1∕M  double  0.0  Transverse gradient divided by maximum onaxis field, used if TGU=1. 
TGU_COMP_FACTOR  NULL  double  1  Use to adjust constant field component to reduce trajectory error. 
POLE1_FACTOR  NULL  double  1  Use to adjust first and last pole strength, e.g., to reduce trajectory error. 
POLE2_FACTOR  NULL  double  1  Use to adjust second and penultimate pole strength, e.g., to reduce trajectory error. 
POLE3_FACTOR  NULL  double  1  Use to adjust third and thirdfrom=last pole strength, e.g., to reduce trajectory error. 
DX  M  double  0.0  Misaligment. 
DY  M  double  0.0  Misaligment. 
DZ  M  double  0.0  Misaligment. 
TILT  RAD  double  0.0  Rotation about beam axis. 
PERIODS  long  0  Number of wiggler periods. 

STEPS_PER_PERIOD  long  10  Integration steps per period. 

INTEGRATION_ORDER  short  4  Integration order (2 or 4). 

BY_FILE  STRING  NULL  Name of SDDS file with By harmonic data. 

CWIGGLER continued
Tracks through a wiggler using canonical integration routines of Y. Wu (Duke University).
Parameter Name  Units  Type  Default  Description 
BX_FILE  STRING  NULL  Name of SDDS file with Bx harmonic data. 

BY_SPLIT_POLE  short  0  Use ”splitpole” expansion for By? 

BX_SPLIT_POLE  short  0  Use ”splitpole” expansion for Bx? 

SYNCH_RAD  short  0  Include classical, singleparticle synchrotron radiation? 

ISR  short  0  Include incoherent synchrotron radiation (quantum excitation)? 

ISR1PART  short  1  Include ISR for singleparticle beam only if ISR=1 and ISR1PART=1 

SINUSOIDAL  short  0  Ideal sinusoidal wiggler? If nonzero, BX_FILE and BY_FILE are not used. 

VERTICAL  short  0  If SINUSOIDAL is nonzero, then setting this to nonzero gives a vertical wiggler. Default is horizontal. 

HELICAL  short  0  Ideal helical wiggler? If nonzero and SINUSOIDAL is also nonzero, BX_FILE and BY_FILE are not used. 

TGU  short  0  Ideal transverse gradient undulator? If nonzero and SINUSOIDAL is also nonzero, BX_FILE and BY_FILE are not used. Give gradient in TGU_GRADIENT. 

FORCE_MATCHED  short  1  Force matched dispersion for first harmonics? If nonzero, start and end of magnetic field will be inset from the ends of the device if phase is not 0 or π. 

CWIGGLER continued
Tracks through a wiggler using canonical integration routines of Y. Wu (Duke University).
Parameter Name  Units  Type  Default  Description 
FIELD_OUTPUT  STRING  NULL  Name of file to which field samples will be written. Slow, so use only for debugging. 

VERBOSITY  short  0  A higher value requires more detailed printouts related to computations. 

GROUP  string  NULL  Optionally used to assign an element to a group, with a userdefined name. Group names will appear in the parameter output file in the column ElementGroup 

This element simulates a wiggler or undulator using a modified version of Ying Wu’s canonical integration code for wigglers. To use the element, one must supply an SDDS file giving harmonic analysis of the wiggler field. The field expansion used by the code for a horizontallydeflecting wiggler is (Y. Wu, Duke University, private communication).
 (35) 
where is the peak value of the onaxis magnetic field, the C_{mn} give the relative amplitudes of the harmonics, the wavenumbers statisfy k_{ym}^{2} = k_{xl}^{2} + k_{zn}^{2}, and θ_{zn} is the phase.
The file must contain the following columns:
In Version 17.3 and later, for matrix computations elegant uses a firstorder matrix derived from particle tracking when it encounterse a CWIGGLER. Tests show that this gives good agreement in the tunes from tracking and Twiss parameter calculations. For radiation integrals, an idealized sinusoidal wiggler model is used with bending radius equal to Bρ∕(B_{0} ∑ C_{mn}) for each plane. Energy loss, energy spread, and horizontal emittance should be estimated accurately.
elegant allows specifying field expansions for onaxis B_{y} and B_{x} components, so one can model a helical wiggler. However, in this case one set of components should have θ_{zn} = 0 or θ_{zn} = π, while the other should have θ_{zn} = ±π∕2. Using Wu’s code, the latter set will not have matched dispersion. Our modified version solves this by delaying the beginning of the field components in question by λ∕4 and ending the field prematurely by 3λ∕4. This causes all the fields to start and end at the crest, which ensures matched dispersion. The downside is that the (typically) vertical wiggler component is missing a full period of field. One can turn off this behavior by setting FORCE_MATCHED=0.
Additional field expansions
Y. Wu’s code included field expansions for a verticallydeflecting wiggler as well as the horizontallydeflecting wiggler given above. In both cases, these expansions are suitable for a wiggler with two poles that are above/below or left/right of the beam axis. They are not always suitable for devices with more complex pole geometries.
Another geometry that is important is a “split pole” wiggler, in which each pole is made from two pieces. Such configurations are seen, for example, in devices used to produce variable polarization. In such cases, the expansion given above may not be appropriate. Here, we summarize the form of the various expansions that elegant supports. For brevity, we show the form of a single harmonic component.
Horizontal wiggler, normal poles, produces B_{y} only onaxis. Specified by setting BY_SPLIT_POLE=0, and giving BY_FILE or SINUSOIDAL=1 with VERTICAL=0.
Experimental feature: Horizontal wiggler, normal poles, with transverse gradient, produces B_{y} only onaxis. Specified by setting BY_SPLIT_POLE=0, SINUSOIDAL=1, TGU=1, VERTICAL=0. The TGU normalized gradient is given using the TGU_GRADIENT parameter. Taking a as the normalized gradient, the fields are[54]
Horizontal wiggler, split poles, produces B_{y} only onaxis. Specified by setting BY_SPLIT_POLE=1, and giving BY_FILE or SINUSOIDAL=1 with VERTICAL=0.
Vertical wiggler, normal poles, produces B_{x} only onaxis. Specified by setting BX_SPLIT_POLE=0, and giving BX_FILE or SINUSOIDAL=1 with either VERTICAL=1 or HELICAL=1.
Vertical wiggler, split poles, produces B_{x} only onaxis. Specified by setting BX_SPLIT_POLE=1, and giving BX_FILE or SINUSOIDAL=1 with either VERTICAL=1 or HELICAL=1.
DRIF