# Recirculated Wave Undulators for Compact FELs
## 8 FEL Radiation: Numerical Simulations  
We have developed a numerical code in Python for solving the 1D FEL Equation (23) and to propagate the electron beam from one interaction point to the other self-consistently via Equation (28). This choice has been made (instead of using other available codes) to have more control on the approximations done in the model and in such a way to easily extend it for the forthcoming works where the design will be reconsidered including further effects towards an even more realistic description of the machine. In this section we report on simulation results, in particular showing the longitudinal phase-space evolution of the electron beam while interacting with the electromagnetic undulator and with the magnetic chicane. The parameters used for the chicane considered in this paper are \(L_{c}=2.1\) m, \(f_{p}=150\) mm, \(f_{l}=300\) mm, \(L_{s}=150\) mm, \(B=1.16\) T and \(\theta=72^{\circ}\). The chosen length of the dipoles has been \(d=200\) mm and the reciprocal distance \(L=100\) mm. Considering an electron bunch of duration 300 fs and charge \(1\)\(nC\) the correction due to CSR is \(\kappa=1.6\%\), which is not fully negligible, and it has been implemented in the Python code. The effect of the energy losses due to CSR in the magnetic chicane onto the bandwidth of the wave undulator FEL spectrum is not the main goal of the present paper, but it shall be addressed in a future work. The first result is given in Figure 4, showing the randomly distributed initial longitudinal phase-space relative to one bucket of ponderomotive phase (top-left), the bunched longitudinal phase-space after the interaction with the laser at the waist \(w_{1}\) of Figure 1 (top-right), the emitted FEL power during the interaction with the CO\({}_{2}\) laser over one Rayleigh length (bottom-left), and finally the evolution of the bunching factor over the same length (bottom-right). The pixel level in the top-left and top-right figure is in arbitrary units but the two plots are normalized on the same scale.  
Figure 5 shows the longitudinal phase-space of the electron beam after passing through the magnetic chicane. In order to calculate it, the top-right phase-space of Figure 4 has been propagated according to Equation (28), i.e., for every particle individuated by the pair \((\psi,\delta)\) the relative energy deviation has been shifted due to CSR and the ponderomotive phase has been shifted by a quantity depending on the element \(R_{56}\). The result is shown in Figure 5, where it is possible to observe that the electron microbunching is preserved to some extent. The last simulation result is reported in Figure 6, showing the same distribution in Figure 5 (top-left), the bunched longitudinal phase-space after the interaction with the laser at the waist \(w_{2}\) of Figure 2 (top-right), the emitted FEL power during the interaction with the CO\({}_{2}\) laser over one Rayleigh length (bottom-left), and finally the evolution of the bunching factor over the same length (bottom-right). The second interaction is evidently more efficient in terms of the FEL power emitted. This is essentially due to the preservation of some order in the longitudinal phase-space after the magnetic chicane which favors the FEL mechanism at the interaction point \(w_{2}\) even more than at \(w_{1}\). The laser is considered essentially not affected by the roundtrip, since the cavity losses are reasonably supposed negligible. Nevertheless, the presence of two interaction points is overall of great advantage since it increases the average output power. Indeed, the time structure of the FEL radiation is a two-pulse structure, and it is worth noting that the fact of having two interaction points does not affect the peak power, but only the average one.  
Figure 4: Simulation results with FEL1D code in Python, concerning the first interaction point of Figure 2.