The undulator is the periodic arrangement of several dipole magnets arranged in Halbach configuration. In the standard method, the undulator is a uniform gap undulator and the energy exchange is limited due to detuning of the resonance between the electron beam and the radiation.