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, element_name, limits, x_0)[source]

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, element_name, x_min, x_max, x_0=nan)[source]

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, element_name, pd_series)[source]

Init object from a pd series (file import).

Parameters:
Return type:

Self

__post_init__()[source]

Convert values in deg for output if it is angle.

__init__(name, element_name, limits, x_0)
Parameters:
_abc_impl = <_abc._abc_data object at 0x73dca697d0c0>