Chapter 5: Insertion devices

Below is a set of python codes associated with Chapter 5 of Daniele Pelliccia and David M. Paganin, “Synchrotron Light: A Physics Journey from Laboratory to Cosmos” (Oxford University Press, 2025).

In order to run any of these python codes, you will need to include the following header file.

Electron trajectory

See Fig. 5.4.

Plots of the deflection angle

These plots are obtained using the magnetic field as a parameter, as in Fig. 5.5(a).

These plots are obtained using the Lorentz factor as a parameter, as in Fig. 5.5(b).

Plots of the electron trajectory

These plots are obtained using the wiggler period as a parameter, as in Fig. 5.5(c).

These plots are obtained using the Lorentz factor as a parameter, as in Fig. 5.5(d).

Electron trajectory and critical energy

See Fig. 5.7.

Electron trajectory: figure-eight

See Fig. 5.8.

The opening angle of the figure-eight, shown in Fig. 5.9, can be plotted with the following code.

Interference factor \mathcal{I}

See Fig. 5.15.

Transition between undulator and wiggler

See Fig. 5.16.

Relativistic effects in the undulator spectrum

Plot of the first two harmonics in different reference frames, as in Fig. 5.20.

Numerical solution for the electron trajectory, as in Fig. 5.21.

Polarisation ellipses

Portion of the polarisation ellipses for circularly polarised plane waves, as in Fig. 5.22.

Polarisation ellipses corresponding to eqn (5.145), as in Fig. 5.23.

Lissajous figures

See Fig. 5.27.