{% include lib/mathjax.html %}
Using the main input file, one can define a single undulator to simulate in Puffin. However, the undulator line in a modern FEL is usually composed of several undulator modules, interspersed with beam optical elements such as focusing quadrupoles and delays or phase shifters. To simulate this, a lattice file can be supplied which describes the layout of the modules and other elements. If it is supplied, the single undulator described in the main input file is ignored.
All common lattice elements except from the undulators employed on the undulator line to focus or delay the beam are currently included as point transforms only. They are specified in the lattice file by their 2 letter identifier, followed by their required parameters.
Elements should be listed sequentially in the order they are placed in the beam line. An example layout is given below:
UN 'planepole' 29 1.0 0.0 30 1.0 1.0 0.0 0.0
DR 1.6455
CH 0.0 0.966 0.0
QU 2.39 -2.39
UN 'planepole' 29 1.0 0.0 30 1.0 1.0 0.0 0.0
DR 1.6455
CH 0.0 0.966 0.0
QU -2.39 2.39
UN 'planepole' 29 1.0 0.0 30 1.0 1.0 0.0 0.0
which will give an undulator (indicated by UN
), followed by a free-space drift (DR
), followed by a chicane (CH
), then a quadrupole (QU
), then an undulator, etc. The elements, their 2 letter ID's, and description of following parameters are given below.
Identifier: UN
Example line
UN 'planepole' 29 1.0 0.0 30 1.0 1.0 0.0 0.0
with parameters after the ID corresponding to, in order:
- undulator type, with choice of
'planepole', 'helical', 'curved'
, and''
(blank - indicating variable polarization) - The number of undulator periods
$$N_u$$ - The tuning of the undulator parameter
$$\alpha = a_u / a_{u0}$$ , where$$a_{u0}$$ is the 'reference' tuning in the main input file (the undulator period cannot be varied, so this is really the ratio of magnetic field strengths) - The undulator taper (linear)
$$d\alpha / d \bar{z}$$ - The number of integration steps to use per undulator period
- The relative size of the undulator
$$x$$ -polarised field strength$$u_x$$ (between$$0$$ and$$1$$ ) (ignored/overwritten if not using the variably polarized undulator) - The relative size of the undulator
$$y$$ -polarised field strength$$u_y$$ (between$$0$$ and$$1$$ ) (ignored/overwritten if not using the variably polarized undulator) - The strong in-undulator focusing wavenumber
$$\bar{k}_{\beta SF x}$$ - The strong in-undulator focusing wavenumber
$$\bar{k}_{\beta SF y}$$
Identifier: QU
Example line
QU 2.39 -2.39
For the quad, we must specify
$$ \frac{d x_j}{d z} \bigg|{new} = \frac{d x_j}{d z} \bigg|{old} + \frac{1}{F_x} x_j \ \frac{d y_j}{d z} \bigg|{new} = \frac{d y_j}{d z} \bigg|{old} + \frac{1}{F_y} y_j $$
which in the scaled notation becomes:
$$ \frac{d \bar{p}{xj}}{d \bar{z}} \bigg|{new} = \frac{d \bar{p}{xj}}{d \bar{z}} \bigg|{old} +\frac{\sqrt{\eta}}{2\rho\kappa} \frac{\bar{x}j}{\bar{F}x} \ \frac{d \bar{p}{yj}}{d \bar{z}} \bigg|{new} = \frac{d \bar{p}{yj}}{d \bar{z}} \bigg|{old} +\frac{\sqrt{\eta}}{2\rho\kappa} \frac{\bar{y}_j}{\bar{F}_y} $$
where $$\bar{F}{x,y} = \dfrac{F{x,y}}{l_g}$$.
In
where
Identifier: CH
Example
CH 0.0 0.966 0.0
For the chicane, one must specify physical length, slippage length, and dispersion enhancement (scaled
$$ \bar{z}{2} = \bar{z}{20} - 2D \left( \frac{\gamma - \gamma_r}{\gamma_r} \right) + \bar{l}_{slip}, $$
and
This approach of being able to vary the 3 parameters above is quite flexible, but at the expense of easy automatic checking of the physical relevance of the parameters. For example, one can disperse the beam 'in place', without shifting it w.r.t. the resonant wavelength, which is obviously unphysical. However, this may be useful for a quick setup of the beam for EEHG at the beginning of the undulator, for instance. If one is not sure of the physical length of the actual device, but knows the length between modules and the desired slippage (e.g. for mode locking the FEL), then one can specify the spatial drift between modules using a drift section, and then specify a chicane with zero physical length, but with the desired delay and
Identifier: DR
For the drift, one must specify length in units of the number of undulator periods.
Identifier: MO
For the modulation section, one may add an energy modulation to the beam specified by