ross.CouplingElement#

class ross.CouplingElement(m_l, m_r, Ip_l, Ip_r, Id_l=0, Id_r=0, kt_x=0, kt_y=0, kt_z=0, kr_x=0, kr_y=0, kr_z=0, ct_x=0, ct_y=0, ct_z=0, cr_x=0, cr_y=0, cr_z=0, o_d=None, L=None, n=None, tag=None, scale_factor=1, color='#647e91')#

A coupling element.

This class creates a coupling element from input data of inertia and mass from the left station and right station, and also translational and rotational stiffness and damping values. The matrices will be defined considering the same local coordinate vector of the ShaftElement.

Parameters:
m_lfloat, pint.Quantity

Mass of the left station of coupling element (kg).

m_rfloat, pint.Quantity

Mass of the right station of coupling element (kg).

Ip_lfloat, pint.Quantity

Polar moment of inertia of the left station of the coupling element (kg).

Ip_rfloat, pint.Quantity

Polar moment of inertia of the right station of the coupling element (kg.m²).

Id_lfloat, pint.Quantity, optional

Diametral moment of inertia of the left station of the coupling element (kg.m²). If not given, it is assumed to be half of Ip_l.

Id_rfloat, pint.Quantity, optional

Diametral moment of inertia of the right station of the coupling element (kg.m²). If not given, it is assumed to be half of Ip_r.

kt_xfloat, optional

Translational stiffness in x (N/m). Default is 0.

kt_yfloat, optional

Translational stiffness in y (N/m). Default is 0.

kt_zfloat, optional

Axial stiffness (N/m). Default is 0.

kr_xfloat, optional

Rotational stiffness in x (N.m/rad). Default is 0.

kr_yfloat, optional

Rotational stiffness in y (N.m/rad). Default is 0.

kr_zfloat, optional

Torsional stiffness (N.m/rad). Default is 0.

ct_xfloat, optional

Translational damping in x (N.s/m). Default is 0.

ct_yfloat, optional

Translational damping in y (N.s/m). Default is 0.

ct_zfloat, optional

Axial damping (N.s/m). Default is 0.

cr_xfloat, optional

Rotational damping in x (N.m.s/rad). Default is 0.

cr_yfloat, optional

Rotational damping in y (N.m.s/rad). Default is 0.

cr_zfloat, optional

Torsional damping (N.m.s/rad). Default is 0.

o_dfloat, optional

Outer diameter (m). This parameter is primarily used for visualization purposes and does not affect calculations.

Lfloat, optional

Element length (m). This parameter is primarily used for visualization purposes and does not affect calculations.

nint, optional

Element number (coincident with it’s first node). If not given, it will be set when the rotor is assembled according to the element’s position in the list supplied to the rotor constructor.

tagstr, optional

A tag to name the element Default is None

scale_factor: float or str, optional

The scale factor is used to scale the coupling drawing. Default is 1.

colorstr, optional

A color to be used when the element is represented. Default is ‘#647e91’.

Examples

>>> # Coupling element with torsional stiffness
>>> m = 151.55
>>> Ip = 2.197
>>> torsional_stiffness = 3.04256e6
>>> coupling = CouplingElement(
...            m_l=m / 2, m_r=m / 2, Ip_l=Ip / 2, Ip_r=Ip / 2,
...            kr_z=torsional_stiffness
... )
>>> coupling.Id_l
0.54925

Methods

C()#

Damping matrix for an instance of a coupling element.

This method will return the damping matrix for an instance of a coupling element.

Returns:
Cnp.ndarray

A matrix of floats containing the values of the damping matrix.

Examples

>>> m = 151.55
>>> Ip = 2.197
>>> torsional_stiffness = 3.04256e6
>>> coupling = CouplingElement(
...            m_l=m / 2, m_r=m / 2, Ip_l=Ip / 2, Ip_r=Ip / 2,
...            kr_z=torsional_stiffness
... )
>>> coupling.C()[:6, :6]
array([[0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0.]])
G()#

Gyroscopic matrix for an instance of a coupling element.

This method will return the gyroscopic matrix for an instance of a coupling element.

Returns:
G: np.ndarray

Gyroscopic matrix for the coupling element.

Examples

>>> m = 151.55
>>> Ip = 2.197
>>> torsional_stiffness = 3.04256e6
>>> coupling = CouplingElement(
...            m_l=m / 2, m_r=m / 2, Ip_l=Ip / 2, Ip_r=Ip / 2,
...            kr_z=torsional_stiffness
... )
>>> coupling.G()[:6, :6]
array([[ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
       [ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
       [ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ],
       [ 0.    ,  0.    ,  0.    ,  0.    ,  1.0985,  0.    ],
       [ 0.    ,  0.    ,  0.    , -1.0985,  0.    ,  0.    ],
       [ 0.    ,  0.    ,  0.    ,  0.    ,  0.    ,  0.    ]])
K()#

Stiffness matrix for an instance of a coupling element.

This method will return the stiffness matrix for an instance of a coupling element.

Returns:
Knp.ndarray

A matrix of floats containing the values of the stiffness matrix.

Examples

>>> m = 151.55
>>> Ip = 2.197
>>> torsional_stiffness = 3.04256e6
>>> coupling = CouplingElement(
...            m_l=m / 2, m_r=m / 2, Ip_l=Ip / 2, Ip_r=Ip / 2,
...            kr_z=torsional_stiffness
... )
>>> coupling.K()[:6, :6]
array([[      0.,       0.,       0.,       0.,       0.,       0.],
       [      0.,       0.,       0.,       0.,       0.,       0.],
       [      0.,       0.,       0.,       0.,       0.,       0.],
       [      0.,       0.,       0.,       0.,       0.,       0.],
       [      0.,       0.,       0.,       0.,       0.,       0.],
       [      0.,       0.,       0.,       0.,       0., 3042560.]])
Kst()#

Dynamic stiffness matrix for an instance of a shaft element.

Stiffness matrix for the shaft element associated with the transient motion. It needs to be multiplied by the angular acceleration when considered in time dependent analyses.

Returns:
Kstnp.ndarray

Dynamic stiffness matrix for the shaft element.

Examples

>>> from ross.materials import steel
>>> Timoshenko_Element = ShaftElement(0.25, 0, 0.05, material=steel)
>>> Timoshenko_Element.Kst().shape
(12, 12)
M()#

Mass matrix for an instance of a coupling element.

This method will return the mass matrix for an instance of a coupling element.

Returns:
Mnp.ndarray

A matrix of floats containing the values of the mass matrix.

Examples

>>> m = 151.55
>>> Ip = 2.197
>>> torsional_stiffness = 3.04256e6
>>> coupling = CouplingElement(
...            m_l=m / 2, m_r=m / 2, Ip_l=Ip / 2, Ip_r=Ip / 2,
...            kr_z=torsional_stiffness
... )
>>> coupling.M()[:6, :6]
array([[75.775  ,  0.     ,  0.     ,  0.     ,  0.     ,  0.     ],
       [ 0.     , 75.775  ,  0.     ,  0.     ,  0.     ,  0.     ],
       [ 0.     ,  0.     , 75.775  ,  0.     ,  0.     ,  0.     ],
       [ 0.     ,  0.     ,  0.     ,  0.54925,  0.     ,  0.     ],
       [ 0.     ,  0.     ,  0.     ,  0.     ,  0.54925,  0.     ],
       [ 0.     ,  0.     ,  0.     ,  0.     ,  0.     ,  1.0985 ]])
__init__(m_l, m_r, Ip_l, Ip_r, Id_l=0, Id_r=0, kt_x=0, kt_y=0, kt_z=0, kr_x=0, kr_y=0, kr_z=0, ct_x=0, ct_y=0, ct_z=0, cr_x=0, cr_y=0, cr_z=0, o_d=None, L=None, n=None, tag=None, scale_factor=1, color='#647e91')#
create_modified(**attributes)#

Return a new shaft element based on the current instance.

Any attribute passed as an argument will be used to modify the corresponding attribute of the instance. Attributes not provided as arguments will retain their values from the current instance.

Parameters:
Lfloat, pint.Quantity, optional

Element length (m). Default is equal to value of current instance.

idlfloat, pint.Quantity, optional

Inner diameter of the element at the left position (m). Default is equal to value of current instance.

odlfloat, pint.Quantity, optional

Outer diameter of the element at the left position (m). Default is equal to value of current instance.

idrfloat, pint.Quantity, optional

Inner diameter of the element at the right position (m). Default is equal to value of current instance.

odrfloat, pint.Quantity, optional

Outer diameter of the element at the right position (m). Default is equal to value of current instance.

materialross.Material, optional

Shaft material. Default is equal to value of current instance.

nint, optional

Element number (coincident with it’s first node). Default is equal to value of current instance.

axial_forcefloat, optional

Axial force (N). Default is equal to value of current instance.

torquefloat, optional

Torque (N*m). Default is equal to value of current instance.

shear_effectsbool, optional

Determine if shear effects are taken into account. Default is equal to value of current instance.

rotary_inertiabool, optional

Determine if rotary_inertia effects are taken into account. Default is equal to value of current instance.

gyroscopicbool, optional

Determine if gyroscopic effects are taken into account. Default is equal to value of current instance.

shear_method_calcstr, optional

Determines which shear calculation method the user will adopt Default is equal to value of current instance.

alphafloat, optional

Mass proportional damping factor. Default is equal to value of current instance.

betafloat, optional

Stiffness proportional damping factor. Default is equal to value of current instance.

tagstr, optional

Element tag. Default is None.

Returns:
shaft_elementross.ShaftElement

An instance of the modified shaft element.

dof_local_index()#

Get the local index for a element specific degree of freedom.

Returns:
local_index: namedtupple

A named tuple containing the local index.

Examples

>>> # Example using BearingElement
>>> from ross.bearing_seal_element import bearing_example
>>> bearing = bearing_example()
>>> bearing.dof_local_index()
LocalIndex(x_0=0, y_0=1, z_0=2)
dof_mapping()#

Degrees of freedom mapping.

Returns a dictionary with a mapping between degree of freedom and its index.

The available keys corresponding to the degrees of freedom are as follows: x_0 - horizontal translation y_0 - vertical translation z_0 - axial translation alpha_0 - rotation around horizontal beta_0 - rotation around vertical theta_0 - torsion around axial

Returns:
dof_mappingdict

A dictionary containing the degrees of freedom and their indexes.

Examples

>>> from ross.materials import steel
>>> sh = ShaftElement(L=0.5, idl=0.05, odl=0.1, material=steel,
...                   rotary_inertia=True, shear_effects=True)
>>> sh.dof_mapping()["x_0"]
0
classmethod from_table(file, sheet_type='Simple', sheet_name=0)#

Instantiate one or more shafts using inputs from an Excel table.

A header with the names of the columns is required. These names should match the names expected by the routine (usually the names of the parameters, but also similar ones). The program will read every row bellow the header until they end or it reaches a NaN.

Parameters:
filestr

Path to the file containing the shaft parameters.

sheet_typestr, optional
Describes the kind of sheet the function should expect:

Simple: The input table should specify only the number of the materials to be used. They must be saved prior to calling the method. Model: The materials parameters must be passed along with the shaft parameters. Each material must have an id number and each shaft must reference one of the materials ids.

sheet_nameint or str, optional

Position of the sheet in the file (starting from 0) or its name. If none is passed, it is assumed to be the first sheet in the file.

Returns:
shaftlist

A list of shaft objects.

get_class_name_prefix(index=None)#

Extract prefix of the class name preceding ‘Element’, insert spaces before uppercase letters, and append an index number at the end.

Parameters:
indexint, optional

The index number to append at the end of the resulting string. Default is None.

Returns:
prefixstr

The processed class name prefix.

Examples

>>> # Example using BearingElement
>>> from ross.bearing_seal_element import bearing_example
>>> bearing = bearing_example()
>>> bearing.get_class_name_prefix()
'Bearing'
classmethod get_subclasses()#
classmethod load(file)#
classmethod read_toml_data(data)#

Read and parse data stored in a .toml file.

The data passed to this method needs to be according to the format saved in the .toml file by the .save() method.

Parameters:
datadict

Dictionary obtained from toml.load().

Returns:
The element object.

Examples

>>> # Example using BearingElement
>>> from tempfile import tempdir
>>> from pathlib import Path
>>> from ross.bearing_seal_element import bearing_example
>>> from ross.bearing_seal_element import BearingElement
>>> # create path for a temporary file
>>> file = Path(tempdir) / 'bearing1.toml'
>>> bearing1 = bearing_example()
>>> bearing1.save(file)
>>> bearing1_loaded = BearingElement.load(file)
>>> bearing1 == bearing1_loaded
True
save(file)#

Save the element in a .toml file.

This function will save the element to a .toml file. The file will have all the argument’s names and values that are needed to reinstantiate the element.

Parameters:
filestr, pathlib.Path

The name of the file the element will be saved in.

Examples

>>> # Example using DiskElement
>>> from tempfile import tempdir
>>> from pathlib import Path
>>> from ross.disk_element import disk_example
>>> # create path for a temporary file
>>> file = Path(tempdir) / 'disk.toml'
>>> disk = disk_example()
>>> disk.save(file)
classmethod section(L, ne, s_idl, s_odl, s_idr=None, s_odr=None, material=None, n=None, shear_effects=True, rotary_inertia=True, gyroscopic=True, alpha=0, beta=0)#

Shaft section constructor.

This method will create a shaft section with length ‘L’ divided into ‘ne’ elements.

Parameters:
i_dfloat

Inner diameter of the section.

o_dfloat

Outer diameter of the section.

Efloat

Young’s modulus.

G_sfloat

Shear modulus.

materialross.material

Shaft material.

nint, optional

Element number (coincident with it’s first node). If not given, it will be set when the rotor is assembled according to the element’s position in the list supplied to the rotor constructor.

axial_forcefloat

Axial force.

torquefloat

Torque.

shear_effectsbool

Determine if shear effects are taken into account. Default is False.

rotary_inertiabool

Determine if rotary_inertia effects are taken into account. Default is False.

gyroscopicbool

Determine if gyroscopic effects are taken into account. Default is False.

alphafloat, optional

Mass proportional damping factor. Default is zero.

betafloat, optional

Stiffness proportional damping factor. Default is zero.

Returns:
elementslist

List with the ‘ne’ shaft elements.

Examples

>>> # shaft material
>>> from ross.materials import steel
>>> # shaft inner and outer diameters
>>> s_idl = 0
>>> s_odl = 0.01585
>>> sec = ShaftElement.section(247.65e-3, 4, 0, 15.8e-3, material=steel)
>>> len(sec)
4
>>> sec[0].i_d
0.0
summary()#

Present a summary for the element.

A pandas series with the element properties as variables.

Returns:
A pandas series.

Examples

>>> # Example using DiskElement
>>> from ross.disk_element import disk_example
>>> disk = disk_example()
>>> disk.summary() 
n                             0
n_l                           0
n_r                           0...

Attributes

n

Set the element number as property.