10.23 CWIGGLER—Tracks through a wiggler using canonical integration routines of Y. Wu (Duke University).

Tracks through a wiggler using canonical integration routines of Y. Wu (Duke University).
Parallel capable? : yes
GPU capable? : no
Back-tracking capable? : no






Parameter Name Units Type Default

Description






L M double 0.0

Total length






B_MAX T double 0.0

Maximum on-axis magnetic field.






BX_MAX T double 0.0

Maximum on-axis magnetic field. Ignored if B_MAX is nonzero.






BY_MAX T double 0.0

Maximum on-axis magnetic field. Ignored if B_MAX is nonzero.






TGU_GRADIENT 1∕M double 0.0

Transverse gradient divided by maximum on-axis field, used if TGU=1.






TGU_COMP_FACTOR NULLdouble 1

Use to adjust constant field component to reduce trajectory error.






POLE1_FACTOR NULLdouble 1

Use to adjust first and last pole strength, e.g., to reduce trajectory error.






POLE2_FACTOR NULLdouble 1

Use to adjust second and penultimate pole strength, e.g., to reduce trajectory error.






POLE3_FACTOR NULLdouble 1

Use to adjust third and third-from=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 12

Integration steps per period. Must be 4*integer






INTEGRATION_ORDER short 4

Integration order (2 or 4).






BY_FILE STRINGNULL

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 UnitsType Default

Description






BX_FILE STRINGNULL

Name of SDDS file with Bx harmonic data.






BY_SPLIT_POLE short 0

Use ”split-pole” expansion for By?






BX_SPLIT_POLE short 0

Use ”split-pole” expansion for Bx?






SYNCH_RAD short 0

Include classical, single-particle synchrotron radiation?






ISR short 0

Include incoherent synchrotron radiation (quantum excitation)?






ISR1PART short 1

Include ISR for single-particle beam only if ISR=1 and ISR1PART=1






SINUSOIDAL short 0

Ideal sinusoidal wiggler? If non-zero, BX_FILE and BY_FILE are not used.






VERTICAL short 0

If SINUSOIDAL is non-zero, then setting this to non-zero gives a vertical wiggler. Default is horizontal.






HELICAL short 0

Ideal helical wiggler? If non-zero and SINUSOIDAL is also non-zero, BX_FILE and BY_FILE are not used.






TGU short 0

Ideal transverse gradient undulator? If non-zero and SINUSOIDAL is also non-zero, BX_FILE and BY_FILE are not used. Give gradient in TGU_GRADIENT.






FORCE_MATCHED short 1

Force matched dispersion for first harmonics? If non-zero, 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 UnitsType Default

Description






FIELD_OUTPUT STRINGNULL

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.






BX_CONSTANT T double 0.0

Constant horizontal magnetic field.






BY_CONSTANT T double 0.0

Constant vertical magnetic field.






GROUP string NULL

Optionally used to assign an element to a group, with a user-defined 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 horizontally-deflecting wiggler is (Y. Wu, Duke University, private communication).

            ∑
By =  - |B0 |   Cmn cos(kxlx)cosh(kymy)cos(kznz + θzn),
            m,n
(37)

where |B0 | is the peak value of the on-axis magnetic field, the Cmn give the relative amplitudes of the harmonics, the wavenumbers statisfy kym2 = kxl2 + kzn2, and θzn is the phase.

The file must contain the following columns:

In Version 17.3 and later, for matrix computations elegant uses a first-order 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ρ∕(B0 Cmn) for each plane. Energy loss, energy spread, and horizontal emittance should be estimated accurately.

elegant allows specifying field expansions for on-axis By and Bx 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 vertically-deflecting wiggler as well as the horizontally-deflecting 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 By only on-axis. Specified by setting BY_SPLIT_POLE=0, and giving BY_FILE or SINUSOIDAL=1 with VERTICAL=0.

B    =  |B | kx-cos(kzz-+-ϕ)sin(kxx)sinh(kyy)                   (38)
  x       0                ky
By   =  - |B0|cos(kxx)cos(kzz + ϕ )cosh(kyy)                   (39)
where ky2 = kx2 + kz2.

Experimental feature: Horizontal wiggler, normal poles, with transverse gradient, producesBy only on-axis. 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]

Bx   =  a-|B0-|sinh-kuycos-kuz                                      (40)
            (    ku                            )
                                      -aC-e|B0|
By   =  |B0|  (1 + ax)cosh kuycoskuz + 2k2uγmec                    (41)
B    =  - |B |(1+ ax )sinh k y sink  z,                             (42)
  z         0              u      u
where ku = ky = kz, kx = 0 is assumed, γ is the central relativistic factor for the beam and C is given by the TGU_COMP_FACTOR parameter. This factor, and the term it multiplies, is present in order to help suppress the trajectory error at the end of the device. It may require adjustment in order to achieve the desired level of correction. In addition, the user may need to adjust the pole-strength factors and include external misalignments and steering magnets in order to supress not only the trajectory error, but also dispersion errors.

Horizontal wiggler, split poles, produces By only on-axis. Specified by setting BY_SPLIT_POLE=1, and giving BY_FILE or SINUSOIDAL=1 with VERTICAL=0.

              kx-cos(kzz-+-ϕ)sin(kyy)sinh(kxx)
Bx   =  - |B0|               ky                                 (43)
B    =  - |B |cos(k y)cos(k z + ϕ )cosh (k x)                     (44)
  y         0      y       z            x
where kx2 = ky2 + kz2.

Vertical wiggler, normal poles, produces Bx only on-axis. Specified by setting BX_SPLIT_POLE=0, and giving BX_FILE or SINUSOIDAL=1 with either VERTICAL=1 or HELICAL=1.

Bx   =  |B0|cos(kyy)cos(kzz + ϕ )cosh(kxx )                      (45)
              ky cos(kzz + ϕ)sin(kyy)sinh (kxx)
By   =  - |B0|---------------k---------------                   (46)
                              x
where kx2 = ky2 + kz2.

Vertical wiggler, split poles, produces Bx only on-axis. Specified by setting BX_SPLIT_POLE=1, and giving BX_FILE or SINUSOIDAL=1 with either VERTICAL=1 or HELICAL=1.

B    =  |B |cos(k x)cos(k z + ϕ )cosh(k y)                     (47)
  x       0      x       z            y
B    =  |B | ky-cos(kzz-+-ϕ)sin(kxx)sinh(kyy)                   (48)
  y       0                kx
where ky2 = kx2 + kz2.

Splitting wigglers

The CWIGGLER element supports a limited ability to split a long element into parts using the element_divisions command or the divide_elements pararameter of the run_setup command.

In addition, if contiguous CWIGGLER elements are seen in a beamline, they will be treated as part of the same element. That means that the pole factors will be ignored except at the ends of the sequence. For this purpose, CWIGGLER elements separated only by MARK or WATCH elements are considered to be contiguous.

DRIF