helper module
Set initial values/limits in DesignSpaceFactory.
- same_value_as_nominal(variable, reference_element, **kwargs)[source]
- Overloads:
variable (GETTABLE_ELT_T), reference_element (Element), kwargs → float
variable (GETTABLE_FIELD_MAP_T), reference_element (FieldMap), kwargs → float
- Parameters:
variable (Literal['dat_idx', 'elt_idx', 'idx', 'idx_in_lattice', 'lattice', 'length_m', 'name', 'nature', 'section', 'abs_mesh', 'd_z', 'n_steps', 'rel_mesh', 's_in', 's_out', 'transf_mat_function', 'aperture_flag', 'field_map_filename', 'field_map_folder', 'geometry', 'acceptance_energy', 'acceptance_phi', 'field', 'freq_cavity_mhz', 'k_e', 'omega_0_rf', 'phi_ref', 'phi_rf', 'phi_s', 'reference', 'rf_field', 'status', 'v_cav_mv', 'phi_0_abs', 'phi_0_rel'])
- Return type:
Return
variablevalue inreference_element.This is generally a good initial value for optimisation.
- Parameters:
variable (
Literal['dat_idx','elt_idx','idx','idx_in_lattice','lattice','length_m','name','nature','section'] |Literal['abs_mesh','d_z','n_steps','rel_mesh','s_in','s_out','transf_mat_function'] |Literal['aperture_flag','field_map_filename','field_map_folder','geometry'] |Literal['acceptance_energy','acceptance_phi','field','freq_cavity_mhz','k_e','omega_0_rf','phi_ref','phi_rf','phi_s','reference','rf_field','status','v_cav_mv'] |Literal['phi_0_abs','phi_0_rel','phi_s'])
- Return type:
- phi_s_limits(reference_element, max_increase_sync_phase_in_percent, max_absolute_sync_phase_in_deg=0.0, min_absolute_sync_phase_in_deg=-90.0, **kwargs)[source]
Return classic limits for the synchronous phase.
Minimum is
min_absolute_sync_phase_in_deg, which is -90 degrees by default. Maximum is nominal synchronous phase +max_increase_in_percent, ormax_absolute_sync_phase_in_degwhich is 0 degrees by default.- Parameters:
reference_element (
FieldMap) – Element in its nominal tuning.max_increase_in_percent – Maximum increase of the synchronous phase in percent.
max_absolute_sync_phase_in_deg (
float, default:0.0) – Maximum absolute synchronous phase in radians. The default is 0.min_absolute_sync_phase_in_deg (
float, default:-90.0) – Minimum absolute synchronous phase in radians. The default is \(-\pi / 2\).max_increase_sync_phase_in_percent (
float)
- Return type:
- Returns:
Lower and upper limits for the synchronous phase.
- k_e_limits(reference_element, max_decrease_k_e_in_percent, max_increase_k_e_in_percent, maximum_k_e_is_calculated_wrt_maximum_k_e_of_section=False, reference_elements=None, **kwargs)[source]
Get classic limits for
k_e.- Parameters:
reference_element (
FieldMap) – The nominal element.max_decrease_in_percent – Allowed decrease in percent with respect to the nominal
k_e.max_increase_in_percent – Allowed increase in percent with respect to the nominal
k_e.maximum_k_e_is_calculated_wrt_maximum_k_e_of_section (
bool, default:False) – Use this flag to compute allowed increase ofk_ewith respect to the maximumk_eof the section, instead of thek_eof the nominal cavity. This is what we used in [PB22].reference_elements (
list[Element] |None, default:None) – List of the nominal elements. Must be provided ifmaximum_k_e_is_calculated_wrt_maximum_k_e_of_sectionis True.max_decrease_k_e_in_percent (
float)max_increase_k_e_in_percent (
float)
- Return type:
- Returns:
Lower and upper bounds for
k_e.