component_model.variable

Functions

cartesian_to_cylindrical(vec[, deg])

Turn the vector 'vec' given in cartesian coordinates into cylindrical coordinates.

cartesian_to_spherical(vec[, deg])

Turn the vector 'vec' given in cartesian coordinates into spherical coordinates.

cylindrical_to_cartesian(vec[, deg])

Turn cylinder coordinate vector 'vec' (defined according to ISO (r,phi,z)) into cartesian coordinates.

linear(x, b[, a])

quantity_direction(quantity_direction[, ...])

Turn a 4-tuple, consisting of quantity (float) and a direction 3-vector to a direction 3-vector, where the norm denotes the direction and the length denotes the quantity.

spherical_to_cartesian(vec[, deg])

Turn spherical vector 'vec' (defined according to ISO 80000-2 (r,polar,azimuth)) into cartesian coordinates.

Classes

Check(value[, names, module, qualname, ...])

Flags to denote how variables should be checked with respect to units and range.

Variable(model, name[, description, ...])

Interface variable of an FMU.

Exceptions

VariableInitError

Special error indicating that something is wrong with the variable definition.

VariableRangeError

Special Exception class signalling that a value is not within the range.

VariableUseError

Special Exception class signalling that variable use was not in accordance with settings.

exception component_model.variable.VariableInitError

Special error indicating that something is wrong with the variable definition.

exception component_model.variable.VariableRangeError

Special Exception class signalling that a value is not within the range.

exception component_model.variable.VariableUseError

Special Exception class signalling that variable use was not in accordance with settings.

component_model.variable.cartesian_to_cylindrical(vec: ndarray | tuple, deg: bool = False) ndarray

Turn the vector ‘vec’ given in cartesian coordinates into cylindrical coordinates. (defined according to ISO, (r, phi, z), with phi right-handed wrt. x-axis).

component_model.variable.cartesian_to_spherical(vec: ndarray | tuple, deg: bool = False) ndarray

Turn the vector ‘vec’ given in cartesian coordinates into spherical coordinates. (defined according to ISO 80000-2, (r, polar, azimuth)).

component_model.variable.cylindrical_to_cartesian(vec: ndarray | tuple, deg: bool = False) ndarray

Turn cylinder coordinate vector ‘vec’ (defined according to ISO (r,phi,z)) into cartesian coordinates. The angle phi is measured with respect to x-axis, right hand.

component_model.variable.linear(x: float, b: float, a: float = 0.0)
component_model.variable.quantity_direction(quantity_direction: tuple, spherical: bool = False, deg: bool = False) ndarray

Turn a 4-tuple, consisting of quantity (float) and a direction 3-vector to a direction 3-vector, where the norm denotes the direction and the length denotes the quantity. The return vector is always a cartesian vector.

Parameters:
  • quantity_direction (tuple) – a 4-tuple consisting of the desired length of the resulting vector (in standard units (m or m/s)) and the direction 3-vector (in standard units)

  • spherical (bool) – Optional possibility to provide the input direction vector in spherical coordinates

  • deg (bool) – Optional possibility to provide the input angle (of spherical coordinates) in degrees. Only relevant if spherical=True

component_model.variable.spherical_to_cartesian(vec: ndarray | tuple, deg: bool = False) ndarray

Turn spherical vector ‘vec’ (defined according to ISO 80000-2 (r,polar,azimuth)) into cartesian coordinates.