BW3

For a given energy ONLINE calculates an optimum gap size from this formula (P. Gürtler):


\begin{displaymath}
gap\_size' = -10\times\frac{\lambda_0^j}{\pi{}f^j}
\ln \left...
...} \times
\sqrt{\frac{1900 i E^2_B}{E \lambda_0^j} - 2}\right)
\end{displaymath}

The letter $i$ is the harmonic number, $j$ indicates that the quantities $\lambda_0$, $B_r$, $f$ and $\kappa$ depend on the undulator type ( $j$ = 1, 2, 3). Their values are part of the program code. $E_B$ is the beam energy [GeV], $E$ is the requested energy. Since the formula is is only an approximation, a linear correction is applied:


\begin{displaymath}
gap\_size = gap\_a0 + gap\_a1 \times gap\_size'
\end{displaymath}

The constants $gap\_a0$ and $gap\_a1$ are supplied as symbols in /online_dir/exp_ini.exp. They have to be determined for every undulator.

The following commands allow the user to specify the harmonic and the undulator type.

ONLINE$>$ harmonic = 3
ONLINE$>$ undulator = 1

The function

ONLINE$>$ $*$ = calc_gap(energy_value)

returns the gap size for the specified energy [eV].