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: DesignSpaceParameter

A single variable.

It can be a cavity amplitude, absolute phase, relative phase or synchronous phase with an initial value and limits.

Parameters:
x_0: float
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_max instead of limits.

Parameters:
  • name (str) – Name of the parameter. Must be compatible with the SimulationOutput.get() method, and be in IMPLEMENTED_VARIABLES.

  • element_name (str) – Name of the element concerned by the parameter.

  • x_min (float) – Lower limit. np.nan to deactivate lower bound.

  • x_max (float) – Upper limit. np.nan to 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.

__init__(name: str, element_name: str, limits: tuple[float, float], x_0: float) None
_abc_impl = <_abc._abc_data object at 0x7f36f760a100>