Parallel capable? : yes

Parameter Name | Units | Type | Default | Description |

L | double | 0.0 | Total length | |

B_MAX | double | 0.0 | Maximum on-axis magnetic field at gap=GAP0 and equal longitudinal phases of PHASE_1,2,3,4 | |

SHIM_SCALE | double | 1 | Scaling factor of shim correction field. | |

DX | double | 0.0 | Misaligment. | |

DY | double | 0.0 | Misaligment. | |

DZ | double | 0.0 | Misaligment. | |

TILT | double | 0.0 | Rotation about beam axis. | |

PERIODS | long | `0` |
Total number of wiggler periods. Include end poles | |

STEP | long | 1 | Number of normal periods to track for each step | |

ORDER | long | `0` |
Order=3 including the 3rd order terms. Otherwise using 2nd order formula. | |

END_POLE | long | 1 | The ending poles are treated as 2 half periods at each sides of the wiggler with reducing field strength, such as 0.25, -0.75, ..., 0.75, -0.25. Periods has to 2 | |

SHIM_ON | long | `0` |
Include shim correction | |

INPUT_FILE | STRING | NULL | Name of SDDS file with By harmonic data given at GAP0 and equal longitudinal phases. | |

SHIM_INPUT | STRING | NULL | Name of SDDS file with shim field integral harmonic data given at GAP0. | |

SYNCH_RAD | long | `0` |
Include classical synchrotron radiation? | |

ISR | long | `0` |
Include incoherent synchrotron radiation (scattering)? |

Tracks through a wiggler using generate function method of J. Bahrdt and G. Wuestefeld (BESSY, Berlin, Germany).

Parameter Name | Units | Type | Default | Description |

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

X0 | double | 0.0 | Offset of magnet row center in meter. | |

GAP0 | double | 0.0 | Nominal magnetic gap. | |

D_GAP | double | 0.0 | Delta gap: actual gap - nominal gap | |

PHASE_1 | double | 0.0 | Longitudinal phase of the first row (top right) | |

PHASE_2 | double | 0.0 | Longitudinal phase of the second row (top left) | |

PHASE_3 | double | 0.0 | Longitudinal phase of the third row (bottom left) | |

PHASE_4 | double | 0.0 | Longitudinal phase of the fourth row (bottom right) | |

VERBOSITY | long | `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 user-defined name. Group names will appear in the parameter output file in the column ElementGroup |

N.B.: at present this element is *not* included in computations
of beam moments (`moments_output`

command).

This element simulates a wiggler or undulator using the generate function method given by J. Bahrdt and G. Wüstefeld (``Symplectic tracking and compensation of dynamic field integrals in complex undulator structures,'' PRSTAB 14, 040703, 2011.).

To use the element, one must supply an SDDS file giving harmonic
analysis of the wiggler field. The field expansion used by the code is
for a wiggler working at the nominal gap and provide pure horizontal
deflecting to the on-axis beam. See `CWIGGLER`

, horizontal
wiggler with normal poles, for detail explaination of the field
expansion and format of the input file. Besides the required columns
of `Cmn`, `KxOverKw`, `KyOverKw`, and `KzOverKw` by
the `CWIGGLER`

elements, two more input columns are needed:

- The longitudinal harmonic number, , in column
`zHarm`. - The horizontal harmonic number of , in column
`xHarm`.

`CWIGGLER`

and
`GFWIGGLER`

then user can use either of the both methods for
simulating a horizontal planar wiggler.
An universal wiggler field, which be used for generating an arbitrary
polarization, can be derived by given different longitudinal phase
parameters: `PHASE_1,2,3,4`. The photon energy can be varied by a
non-zero `D_GAP` value.