Settings optimization problem

Optimisation objectives

The values for objective_preset are explained here:

Objectives preset

Corresponding keys

CorrectorAtExit

'CorrectorAtExit', 'experimental'

EnergyMismatch

'EnergyMismatch', 'rephased_ADS'

EnergyPhaseMismatch

'EnergyPhaseMismatch', 'simple_ADS'

EnergySeveralMismatches

'EnergySeveralMismatches'

EnergySyncPhaseMismatch

'EnergySyncPhaseMismatch', 'sync_phase_as_objective_ADS'

RegularEnvelope

'RegularEnvelope'

If you do not retrieve the beam absolute phase at the exit of the compensation zone (eg, if you use EnergyMismatch), you should probably rephase downstream cavities to keep RF/beam synchronicity. This is acheived by setting your beam_calculator.reference_phase_policy key to "phi_0_rel" or "phi_0_s". See also this notebook.

Note

You can subclass ObjectiveFactory to your liking, and pass the created object to run_simulation() directly.

config = process_config(toml_filepath, toml_keys)
fault_scenarios = run_simulation(
    config,
    objective_factory_class=MyObjectiveFactory,  # subclass of ObjectiveFactory
)

An example is provided in data/example/my_own_objectives.py.

Todo

Make it more explicit and easy to understand with a jupyter notebook.

Optimisation algorithms

Here are mappings of optimisation_algorithm key to actual OptimisationAlgorithm. Check the documentation of the optimisation algorithm you want to use, in particular if you want to tune it using optimisation_algorithm_kwargs key.

Optimisation algorithm

Corresponding keys

BayesianOptimizationLW

'bayesian_optimization', 'experimental'

DifferentialEvolution

'differential_evolution'

DownhillSimplex

'downhill_simplex', 'nelder_mead'

DownhillSimplexPenalty

'downhill_simplex_penalty', 'nelder_mead_penalty'

Explorator

'explorator'

LeastSquares

'least_squares'

LeastSquaresPenalty

'least_squares_penalty'

NSGA3Algorithm

'NSGA-III'

NSGA3AlgorithmMulti

'NSGA-III Multi-threaded'

SimulatedAnnealing

'simulated_annealing'