optimisation.design_space section

This section parametrizes how the design space will be set, i.e. what are the variables, their limits and initial values, and what are the constraints and their limits. If you have any doubt, know that all these settings are passed down to DesignSpaceFactory.__init__() as design_space_kw.

There are two ways to define the design space limits and initial values; the first is to let LightWin calculate it from the nominal settings of the linac. This approach is easier to use for the first runs.

Entry

Type

Description

Allowed values

Mandatory?

design_space_preset

str

What are the variables and constraints.

(‘abs_phase_amplitude’, ‘rel_phase_amplitude’, ‘sync_phase_amplitude’, ‘abs_phase_amplitude_with_constrained_sync_phase’, ‘rel_phase_amplitude_with_constrained_sync_phase’, ‘everything’, ‘unconstrained’, ‘unconstrained_rel’, ‘constrained_sync_phase’, ‘sync_phase_as_variable’)

from_file

bool

If variable limits/constraints should be taken from a file.

max_increase_sync_phase_in_percent

float

Max relative increase of \(\phi_s\) wrt nominal in \(\mathrm{\%}\)

max_absolute_sync_phase_in_deg

float

Max absolute \(\phi_s\) in \(\mathrm{deg}\)

min_absolute_sync_phase_in_deg

float

Min absolute \(\phi_s\) in \(\mathrm{deg}\)

max_decrease_k_e_in_percent

float

Max decrease of \(k_e\) wrt nominal in \(\mathrm{\%}\)

max_increase_k_e_in_percent

float

Max increase of \(k_e\) wrt nominal in \(\mathrm{\%}\)

maximum_k_e_is_calculated_wrt_maximum_k_e_of_section

bool

If max \(k_e\) should be the same for all the cavities of the section

When from_file is True, you must provide a path to a .csv file containing, for every element, every variable, its initial value and limits. If the problem is constrained, you must also provide a .csv with, for every element, the limits of every constraint. This approach is more useful when you want to fine-tune the optimisation, as you can manually edit the .csv, for example to take into account the specific multipacting barriers of a rogue cavity. To generate the .csv files with the proper format, look at examples/generate_design_space_files.py.

Entry

Type

Description

Allowed values

Mandatory?

design_space_preset

str

What are the variables and constraints.

(‘abs_phase_amplitude’, ‘rel_phase_amplitude’, ‘sync_phase_amplitude’, ‘abs_phase_amplitude_with_constrained_sync_phase’, ‘rel_phase_amplitude_with_constrained_sync_phase’, ‘everything’, ‘unconstrained’, ‘unconstrained_rel’, ‘constrained_sync_phase’, ‘sync_phase_as_variable’)

from_file

bool

If variable limits/constraints should be taken from a file.

constraints_filepath

str or Path

Path to the .csv holding constraints. Mandatory if from_file is True.

variables_filepath

str or Path

Path to the .csv holding variables. Mandatory if from_file is True.

Ultimately, these settings will be passed down to DesignSpaceFactory.