libs.elements.components package

Submodules

libs.elements.components.ComponentTemplate module

class libs.elements.components.ComponentTemplate.ComponentTemplate(*args, **kwargs)

Bases: Component

convert_to_si() None

Calls the init method and converts the parameters from gui units to SI units.

classmethod from_dict(dictionary: Dict[any]) ComponentTemplate
Method to init an instance of the SensorTemplate class by passing a dictionary with the corresponding

arguments.

Returns:

Instance of the ComponentTemplate class.

Return type:

ComponentTemplate

gui() ComponentTemplate

Returns a copy of the class with attributes converted to units used in the gui.

Returns:

Object of the ComponentTemplate class.

Return type:

ComponentTemplate

gui_dict() Dict[str, any]

Method creates a dictionary of the class members that will be stored in the ini file. Variables not passed to the init method are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

reset() None

Calls the init method with the actual class attributes.

classmethod template() ComponentTemplate

Class method to init the class with a set of default values.

Returns:

Object of the SensorTemplate class.

Return type:

SensorTemplate

to_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

update(t: float) None

Method to update the states of a time dependent component.

Parameters:

t (float) – Current time stamp.

libs.elements.components.Gear module

class libs.elements.components.Gear.Gear(pos: ndarray, axis_0: ndarray, omega: float, diameter: ndarray, length: float, tooth_height: float, tooth_width: float, n: int, display_teeth_angle: ndarray, tooth_flank_angle: float, mu_r: float, eccentricity: float, wobble_angle: float, chamfer_depth: float, chamfer_angle: float, dev_tooth_num: int, tooth_deviations: ndarray, maxh: float, rotate_mesh: bool, rotate_mesh_max_angle: float, theta: float | None = None)

Bases: Component

Contains all the parameters to describe the position, rotation, shape and movement of the gear in the simulation.

Parameters:
  • pos (numpy.ndarray) – Position of the gear in the 3D space.

  • axis_0 (numpy.ndarray) – The direction of the rotation axis of the gear without wobbling.

  • omega (float) – Angular velocity of the gear.

  • diameter (float) – Inner and outer diameter of the gear.

  • length (float) – Length of the gear.

  • tooth_height (float) – Tooth height.

  • tooth_width (float) – Tooth width.

  • n (int) – Total number of teeth.

  • display_teeth_angle (np.ndarray) – Opening angle related to the sensors position in which the gear teeth are drawn.

  • tooth_flank_angle (float) – Tooth flank angle in radians.

  • mu_r (float) – Permeability of the gear.

  • eccentricity (float) – Rotation eccentricity of the gear.

  • wobble_angle (float) – Wobble angle around the rotation axis in radians.

  • chamfer_depth (float) – Extension of the phase along the phases normal.

  • chamfer_angle (float) – Angle of the chamfer based on the flanks.

  • dev_tooth_num (int) – Number of the tooth with deviating geometry.

  • tooth_deviations (numpy.ndarray) – Array containing the tooth deviations specified by n_dev. The first entry describes the deviation of the left flank, the middle entry the top deviation and the last entry describes the deviation of the right flank.

  • maxh (float) – Mesh size of the gear.

  • rotate_mesh (bool) – Specifies wether to use the rotated mesh approach or to build up the mesh at every time step from scratch for the specific gear.

  • rotate_mesh_max_angle (float) – Maximum permissible angle of rotation of the gear before the mesh is rebuilt.

  • theta (float) – Current rotation angle of the gear.

axis_0: ndarray
chamfer_angle: float
chamfer_depth: float
convert_to_si() None

Calls the init method and converts the parameters from gui units to SI units.

dev_tooth_num: int
diameter: ndarray
display_teeth_angle: ndarray
eccentricity: float
eccentricity_vector(angle: float) ndarray
Method for calculation the eccentricity vector containing the position shift along the three coordinate

system axes due eccentricity.

Parameters:

angle (float) – Gear rotation angle.

Returns:

Eccentricity vector.

Return type:

numpy.ndarray

classmethod from_dict(dictionary: Dict[any]) Gear
Method to init an instance of the Gear class by passing a dictionary with the corresponding

arguments. Arguments that are in the dictionary and not in the class are ignored while arguments missing in the dictionary get initialised with the standard values defined in the template class method.

Returns:

Instance of the Gear class.

Return type:

Gear

gui() Gear

Returns a copy of the class with attributes converted to units used in the gui.

gui_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

length: float
maxh: float
mu_r: float
n: int
omega: float
pos: ndarray
position(angle: float) ndarray

Method to calculate the angle based center of the gear with eccentricity.

Parameters:

angle (float) – Gear rotation angle.

Returns:

Gear position with eccentricity.

Return type:

numpy.ndarray

reset()

Calls the init method with the actual class attributes.

rotate_mesh: bool
rotate_mesh_max_angle: float
rotation_axis(angle: float) ndarray

Method to calculate the final rotation axis considering the wobble angle.

Parameters:

angle (float) – Gear rotation angle.

Returns:

Final rotation axis including the wobble angle.

Return type:

numpy.ndarray

static rotation_matrix(angle: float) ndarray

Method to calculate the rotation matrix of the gear.

Parameters:

angle (float) – Gear rotation angle.

Returns:

Rotation matrix of the gear.

Return type:

numpy.ndarray

classmethod template() Gear

Class method to init the class with a set of standard values.

Returns:

Object of the Gear class.

Return type:

Gear

theta: float
to_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

tooth_deviations: ndarray
tooth_flank_angle: float
tooth_height: float
tooth_width: float
static transformation_matrix(axis: ndarray) ndarray
Method for calculating the transformation matrix to transform the global coordinate system into the

body-fixed coordinate system, where the z-axis points in the direction of the rotation axis.

Parameters:

axis (numpy.ndarray) – The rotation axis of the gear.

Returns:

The transformation matrix.

Return type:

numpy.ndarray

update(t: float) None

Method to update the gear rotation angle theta for the next simulation step.

Parameters:

t (float) – Current time stamp.

wobble_angle: float

libs.elements.components.GearRack module

class libs.elements.components.GearRack.GearRack(pos: ndarray, dim: ndarray, rot: ndarray, velocity: ndarray, tooth_height: float, tooth_width: float, tooth_pitch: float, tooth_flank_angle: float, mu_r: float, chamfer_depth: float, chamfer_angle: float, maxh: float, shift: ndarray | None = None)

Bases: Component

Contains all the parameters to describe the position, rotation, shape and movement of the gear in the simulation.

Parameters:
  • pos (np.ndarray) – Position of the gear in the 3D space.

  • dim (numpy.ndarray) – Dimension of the gear rack body along the body-fixed coordinate axes.

  • rot (numpy.ndarray) – Rotation of the gear rack in the 3D space in radians.

  • velocity (np.ndarray) – Velocity of the gear rack along the global coordinate axes.

  • tooth_height (float) – Tooth height.

  • tooth_width (float) – Tooth width.

  • tooth_pitch (float) – Distance between two adjacent teeth.

  • tooth_flank_angle (float) – Tooth flank angle in radians.

  • mu_r (float) – Permeability of the gear.

  • chamfer_depth (float) – Extension of the phase along the phases normal.

  • chamfer_angle (float) – Angle of the chamfer based on the flanks.

  • maxh (float) – Mesh size of the gear.

  • pos – Current position of the gear rack.

chamfer_angle: float
chamfer_depth: float
convert_to_si() None

Calls the init method and converts the parameters from gui units to SI units.

dim: ndarray
classmethod from_dict(dictionary: Dict[any]) GearRack
Method to init an instance of the Gear class by passing a dictionary with the corresponding

arguments. Arguments that are in the dictionary and not in the class are ignored while arguments missing in the dictionary get initialised with the standard values defined in the template class method.

Returns:

Instance of the GearRack class.

Return type:

GearRack

gui() GearRack

Returns a copy of the class with attributes converted to units used in the gui.

gui_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

maxh: float
mu_r: float
pos: ndarray
position() ndarray

Method to calculate the angle based center of the gear with eccentricity.

Returns:

Gear Rack position with eccentricity.

Return type:

numpy.ndarray

reset()

Calls the init method with the actual class attributes.

rot: ndarray
classmethod template() GearRack

Class method to init the class with a set of standard values.

Returns:

Object of the GearRack class.

Return type:

GearRack

to_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

tooth_flank_angle: float
tooth_height: float
tooth_pitch: float
tooth_width: float
transformation_matrix() ndarray
Method for calculating the transformation matrix to transform the global coordinate system into the

body-fixed coordinate system.

Returns:

The transformation matrix.

Return type:

numpy.ndarray

update(t: float) None

Method to update the gear rotation angle theta for the next simulation step.

Parameters:

t (float) – Current time stamp.

velocity: ndarray

libs.elements.components.Shaft module

class libs.elements.components.Shaft.Shaft(pos: ndarray, axis: ndarray, diameter: ndarray, length: float, mu_r: float, maxh: float)

Bases: Component

Contains all the parameters to describe the position, rotation and shape of a shaft.

Parameters:
  • pos (numpy.ndarray) – Position of the shaft in the 3D space.

  • axis (numpy.ndarray) – The direction of the rotation axis of the shaft without wobbling.

  • diameter (float) – Inner and outer diameter of the shaft.

  • length (float) – Length of the shaft.

  • mu_r (float) – Permeability of the shaft.

  • maxh (float) – Mesh size of the shaft.

axis: ndarray
convert_to_si() None

Calls the init method and converts the parameters from gui units to SI units.

diameter: ndarray
classmethod from_dict(dictionary: Dict[any]) Shaft
Method to init an instance of the Gear class by passing a dictionary with the corresponding

arguments. Arguments that are in the dictionary and not in the class are ignored while arguments missing in the dictionary get initialised with the standard values defined in the template class method.

Returns:

Instance of the Shaft class.

Return type:

Shaft

gui() Shaft

Returns a copy of the class with attributes converted to units used in the gui.

gui_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

length: float
maxh: float
mu_r: float
pos: ndarray
reset()

Calls the init method with the actual class attributes.

classmethod template() Shaft

Class method to init the class with a set of standard values.

Returns:

Object of the Shaft class.

Return type:

Shaft

to_dict() Dict[str, any]
Method creates a dictionary of the class members that will be stored in the HDF5 file. Variables created

automatically when instantiating an object of the class are excluded from the dictionary. This creates the opportunity to initiate an instance of the class by parsing the dictionary as argument.

Returns:

The dictionary of the classes members.

Return type:

Dict[str, any]

update(t: float) None

Stub

Module contents