ocelot-collab / ocelot

OCELOT is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources.
GNU General Public License v3.0
85 stars 58 forks source link

EuXFEL lattice generation functions: improvements/bugfixes 2 #216

Closed ZeugAusHH closed 6 months ago

ZeugAusHH commented 7 months ago

Introduces new parameter final_halfcell_complete to functions create_fel_beamline and create_fel_lattice. If True, all generated half-cells are identical, allowing matching of FODO lattice even for beamlines with just und_N=2 undulators. The default value is False, so unless specified the behavior of the functions remains unchanged.

Fixed remaining issue in function create_fel_lattice related to parameter und_N, not in all cases the requested number of undulators was returned.

Includes a demo script matching an undulator lattice with just two undulators. After matching the resulting beta functions are displayed.

image