variable module
Define Variable, which stores an optimisation variable.
It keeps it’s name, bounds, initial value, etc.
- IMPLEMENTED_VARIABLES = ('k_e', 'phi_0_abs', 'phi_0_rel', 'phi_s')
- class Variable(name: str, element_name: str, limits: tuple[float, float], x_0: float)
Bases:
DesignSpaceParameterA single variable.
It can be a cavity amplitude, absolute phase, relative phase or synchronous phase with an initial value and limits.
- Parameters:
name (str) – Name of the parameter. Must be compatible with the
SimulationOutput.get()method, and be inIMPLEMENTED_VARIABLES.element_name (str) – Name of the element concerned by the parameter.
limits (tuple[float, float]) – Lower and upper bound for the variable.
np.nandeactivates a bound.x_0 (float) – Initial value.
- classmethod from_floats(name: str, element_name: str, x_min: float, x_max: float, x_0: float = nan) Self
Initialize object with
x_min,x_maxinstead oflimits.- Parameters:
name (str) – Name of the parameter. Must be compatible with the
SimulationOutput.get()method, and be inIMPLEMENTED_VARIABLES.element_name (str) – Name of the element concerned by the parameter.
x_min (float) – Lower limit.
np.nanto deactivate lower bound.x_max (float) – Upper limit.
np.nanto deactivate lower bound.x_0 (float) – Initial value.
- Returns:
A Variable with limits = (x_min, x_max).
- Return type:
Self
- classmethod from_pd_series(name: str, element_name: str, pd_series: Series) Self
Init object from a pd series (file import).
- __post_init__()
Convert values in deg for output if it is angle.
- _abc_impl = <_abc._abc_data object at 0x7fd3c8ad1500>