variable module
Define Variable, which stores an optimisation variable.
It keeps it’s name, bounds, initial value, etc.
- class Variable(name, element_name, limits, x_0)[source]
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 theSimulationOutput.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, element_name, x_min, x_max, x_0=nan)[source]
Initialize object with
x_min,x_maxinstead oflimits.- Parameters:
name (
str) – Name of the parameter. Must be compatible with theSimulationOutput.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, default:nan) – Initial value.
- Return type:
Self- Returns:
A Variable with limits = (x_min, x_max).
- classmethod from_pd_series(name, element_name, pd_series)[source]
Init object from a pd series (file import).
- __init__(name, element_name, limits, x_0)
- _abc_impl = <_abc._abc_data object at 0x7318f8f785c0>