ross.Rotor#

class ross.Rotor(shaft_elements, disk_elements=None, bearing_elements=None, point_mass_elements=None, motor_element=None, min_w=None, max_w=None, rated_w=None, modal_damping_ratio=None, default_damping_ratio=0.0, alpha=0.0, beta=0.0, tag=None)#

A rotor object.

This class will create a rotor with the shaft, disk, bearing and seal elements provided.

Parameters:
shaft_elementslist

List with the shaft elements

disk_elementslist

List with the disk elements

bearing_elementslist

List with the bearing elements

point_mass_elements: list

List with the point mass elements

motor_element: object

Motor element object

modal_damping_ratio: list, optional

List of modal damping ratio(s) for the first modes

default_damping_ratio: float, optional

Default modal damping ratio for the remaining modes. Default is zero.

alphafloat, optional

Mass proportional damping factor. Default is zero.

betafloat, optional

Stiffness proportional damping factor. Default is zero.

tagstr

A tag for the rotor

Attributes:
evaluesarray

Rotor’s eigenvalues.

evectorsarray

Rotor’s eigenvectors.

wnarray

Rotor’s natural frequencies in rad/s.

wdarray

Rotor’s damped natural frequencies in rad/s.

Returns:
A rotor object.

Examples

>>> #  Rotor without damping with 2 shaft elements 1 disk and 2 bearings
>>> import ross as rs
>>> steel = rs.materials.steel
>>> z = 0
>>> le = 0.25
>>> i_d = 0
>>> o_d = 0.05
>>> tim0 = rs.ShaftElement(le, i_d, o_d,
...                        material=steel,
...                        shear_effects=True,
...                        rotary_inertia=True,
...                        gyroscopic=True)
>>> tim1 = rs.ShaftElement(le, i_d, o_d,
...                        material=steel,
...                        shear_effects=True,
...                        rotary_inertia=True,
...                        gyroscopic=True)
>>> shaft_elm = [tim0, tim1]
>>> disk0 = rs.DiskElement.from_geometry(1, steel, 0.07, 0.05, 0.28)
>>> stf = 1e6
>>> bearing0 = rs.BearingElement(0, kxx=stf, cxx=0)
>>> bearing1 = rs.BearingElement(2, kxx=stf, cxx=0)
>>> rotor = rs.Rotor(shaft_elm, [disk0], [bearing0, bearing1])
>>> modal = rotor.run_modal(speed=0)
>>> modal.wd[0]
215.3707...

Methods

A(speed=0, frequency=None, synchronous=False)#

State space matrix for an instance of a rotor.

Parameters:
speed: float, optional

Rotor speed. It multiplies the gyroscopic matrix and is the value at which speed-dependent bearing and seal coefficients are evaluated. Default is 0.

frequencyfloat, optional

Excitation (whirl) frequency at which frequency-dependent bearing and seal coefficients are evaluated. Default is the rotor speed (synchronous evaluation).

synchronousbool, optional

If True the gyroscopic matrix is folded into the mass matrix (Rouch’s formulation for a synchronous analysis). Default is False.

Returns:
Anp.ndarray

State space matrix for the rotor.

Examples

>>> rotor = rotor_example()
>>> np.round(rotor.A()[75:83, :2]) + 0.
array([[     0.,  10927.],
       [-10924.,      0.],
       [     0.,      0.],
       [  -174.,      0.],
       [     0.,   -174.],
       [     0.,      0.],
       [     0.,  10723.],
       [-10719.,      0.]])
C(frequency, speed=None)#

Damping matrix for an instance of a rotor.

Parameters:
frequencyfloat

Excitation (whirl) frequency at which frequency-dependent bearing and seal coefficients are evaluated.

speedfloat, optional

Rotor speed at which speed-dependent bearing and seal coefficients are evaluated. Default is the excitation frequency (synchronous evaluation).

Returns:
C0np.ndarray

Damping matrix for the rotor.

Examples

>>> rotor = compressor_example()
>>> rotor.C(0)[:4, :4]
array([[ 0.,  0.,  0.,  0.],
       [ 0.,  0.,  0., -0.],
       [ 0.,  0.,  0.,  0.],
       [ 0., -0.,  0.,  0.]])
G()#

Gyroscopic matrix for an instance of a rotor.

Returns:
G0np.ndarray

Gyroscopic matrix for the rotor.

Examples

>>> rotor = rotor_example()
>>> rotor.G()[:4, :4]
array([[ 0.        ,  0.01943344,  0.        , -0.00022681],
       [-0.01943344,  0.        ,  0.        ,  0.        ],
       [ 0.        ,  0.        ,  0.        ,  0.        ],
       [ 0.00022681,  0.        ,  0.        ,  0.        ]])
K(frequency, speed=None)#

Stiffness matrix for an instance of a rotor.

Parameters:
frequencyfloat

Excitation (whirl) frequency at which frequency-dependent bearing and seal coefficients are evaluated.

speedfloat, optional

Rotor speed at which speed-dependent bearing and seal coefficients are evaluated. Default is the excitation frequency (synchronous evaluation).

Returns:
K0np.ndarray

Stiffness matrix for the rotor.

Examples

>>> rotor = rotor_example()
>>> np.round(rotor.K(0)[:4, :4] / 1e6)
array([[ 4.700e+01,  0.000e+00,  0.000e+00,  0.000e+00],
       [ 0.000e+00,  4.600e+01,  0.000e+00, -6.000e+00],
       [ 0.000e+00,  0.000e+00,  1.657e+03,  0.000e+00],
       [ 0.000e+00, -6.000e+00,  0.000e+00,  1.000e+00]])
Ksdt()#

Dynamic stiffness matrix for an instance of a rotor.

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

Returns:
Ksdt0np.ndarray

Dynamic stiffness matrix for the rotor.

Examples

>>> rotor = rotor_example_6dof()
>>> np.round(rotor.Ksdt()[:6, :6] * 1e3, 2)
array([[  0.  , -23.  ,   0.  ,   0.48,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ],
       [  0.  ,  -0.48,   0.  ,   0.16,   0.  ,   0.  ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ]])
M(frequency=None, speed=None, synchronous=False)#

Mass matrix for an instance of a rotor.

Parameters:
frequencyfloat, optional

Excitation (whirl) frequency at which frequency-dependent bearing and seal mass coefficients are evaluated. Default is 0.

speedfloat, optional

Rotor speed at which speed-dependent bearing and seal mass coefficients are evaluated. Default is the excitation frequency (synchronous evaluation).

synchronousbool, optional

If True the gyroscopic matrix is folded into the mass matrix (Rouch’s formulation for a synchronous analysis). Default is False.

Returns:
M0np.ndarray

Mass matrix for the rotor.

Examples

>>> rotor = rotor_example()
>>> rotor.M(0)[:4, :4]
array([[ 1.42050794,  0.        ,  0.        ,  0.        ],
       [ 0.        ,  1.42050794,  0.        , -0.04931719],
       [ 0.        ,  0.        ,  1.27790826,  0.        ],
       [ 0.        , -0.04931719,  0.        ,  0.00231392]])
__init__(shaft_elements, disk_elements=None, bearing_elements=None, point_mass_elements=None, motor_element=None, min_w=None, max_w=None, rated_w=None, modal_damping_ratio=None, default_damping_ratio=0.0, alpha=0.0, beta=0.0, tag=None)#
add_elements(new_elements)#

Add elements to rotor.

This method returns a new rotor with the given elements added to it. It is valid for shaft elements only when appending new elements to the end of the shaft or inserting new elements around the existing shaft.

Parameters:
new_elementslist

List with the new elements.

Returns:
A rotor object.

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()
>>> seal = rs.SealElement(n=3, kxx=1e6, kyy=0.8e6, cxx=2e2, cyy=1.5e2)
>>> disk = rs.DiskElement(n=5, m=32, Id=0.2, Ip=0.3)
>>> new_rotor = rotor.add_elements([seal, disk])
>>> len(new_rotor.elements)
12
add_nodes(new_nodes_pos)#

Add nodes to rotor.

This method returns the modified rotor with additional nodes according to the positions of the new nodes provided. Disks, bearings, seals, point masses and the motor keep their positions; their nodes, the housing nodes (n_link) and the sensor nodes of magnetic bearings are renumbered as refine() renumbers them.

Parameters:
new_nodes_poslist

List with the position of the new nodes, in m. Positions that are already nodes, or that are off the shaft, are ignored.

Returns:
A rotor object.

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()
>>> new_rotor = rotor.add_nodes([0.62, 1.11])
>>> shaft_elements = new_rotor.shaft_elements
>>> len(shaft_elements)
8
>>> round(shaft_elements[3].L, 2)
0.13
>>> round(shaft_elements[6].L, 2)
0.14
api617_unbalance(mode, maximum_continuous_speed, num_modes=12)#

Unbalance amount and placement for a mode as defined by API 617.

Follows API 617 (9th edition, 6.8.2.7 and Figure 2). The unbalance is placed at the antinodes of the selected forward mode shape, evaluated at the maximum continuous speed, with magnitude \(U_a = 2 U_r\), where \(U_r\) is the maximum allowable residual unbalance in g·mm:

\[U_r = 6350 \frac{W}{N_{mc}} \; (N_{mc} < 25000 \text{ rpm}), \qquad U_r = \frac{W}{3.937} \; (N_{mc} \geq 25000 \text{ rpm})\]

with \(W\) in kg and \(N_{mc}\) in rpm.

The placement and the load \(W\) follow the mode shape:

  • a single antinode between the journal bearings (translatory or first bending mode): one unbalance at that antinode, with \(W\) equal to the sum of the journal static loads;

  • several antinodes between the bearings (conical or second bending mode): one unbalance per antinode, 180° out of phase where the shape changes sign, each with \(W\) equal to the static load of the nearest journal bearing;

  • an antinode outboard of the bearings (overhung or coupling mode) is used when it holds the largest deflection of the mode, or when its deflection is at least half of the largest; \(W\) is then the mass of the rotor outboard of the adjacent bearing.

Antinodes between the bearings with less than 10 % of the largest deflection are ignored.

The forward modes are the lateral modes whose amplitude-weighted whirl ratio (orbit minor-to-major axis ratio, positive for forward precession) is above FORWARD_WHIRL_RATIO (0.25); nearly planar mixed modes, which often appear as heavily damped pairs, are skipped. When no mode passes that threshold, the modes with positive whirl ratio are used and a warning is issued.

Parameters:
modeint

Index of the forward whirl mode, counted over the forward modes only (0 is the first forward mode, which corresponds to the first critical speed of API 617). The index of the mode in the run_modal() results is returned as "mode_index".

maximum_continuous_speedfloat, pint.Quantity

Maximum continuous speed \(N_{mc}\) (rad/s). The mode shape is evaluated at this speed.

num_modesint, optional

Number of modes computed by run_modal(). Default is 12.

Returns:
unbalancedict

Dictionary with the keys:

  • "node" : list of nodes where the unbalance is applied;

  • "unbalance_magnitude" : list of magnitudes (kg·m);

  • "unbalance_phase" : list of phases (rad);

  • "static_load" : list with the load \(W\) used for each unbalance (kg);

  • "mode_index" : index of the mode in the run_modal() results;

  • "mode_frequency" : damped natural frequency of the mode (rad/s).

Examples

>>> import ross as rs
>>> from ross.units import Q_
>>> rotor = rs.rotor_example()
>>> unbalance = rotor.api617_unbalance(
...     mode=0, maximum_continuous_speed=Q_(9000, "RPM")
... )
>>> unbalance["node"]
[3]
>>> unbalance["unbalance_phase"]
[0.0]
classmethod concatenate(*rotors)#

Concatenate a sequence of rotors into a single rotor.

The nodes of the concatenated rotor will be the maximum node of the last rotor in the list.

Parameters:
*rotorsRotor

Sequence of rotors to be concatenated, in the order they should be combined. A single list or tuple of rotors is also accepted as one argument (e.g. Rotor.concatenate([rotor1, rotor2])).

Returns:
Rotor object.
classmethod from_section(leng_data, idl_data, odl_data, idr_data=None, odr_data=None, material_data=None, disk_data=None, brg_seal_data=None, min_w=None, max_w=None, rated_w=None, nel_r=1, tag=None)#

Build rotor from sections.

This class is an alternative to build rotors from separated sections. Each section has the same number (n) of shaft elements.

Parameters:
leng_datalist

List with the lengths of rotor regions.

idl_datalist

List with the inner diameters of rotor regions (Left Station).

odl_datalist

List with the outer diameters of rotor regions (Left Station).

idr_datalist, optional

List with the inner diameters of rotor regions (Right Station). Default is equal to idl_data (cylindrical element).

odr_datalist, optional

List with the outer diameters of rotor regions (Right Station). Default is equal to odl_data (cylindrical element).

material_dataross.material or list of ross.material

Defines a single material for all sections or each section can be defined by a material individually.

disk_datadict, optional

Dict holding disks datas. Example : disk_data=DiskElement.from_geometry(n=2,

material=steel, width=0.07, i_d=0, o_d=0.28 )

*See ‘disk_element.py’ docstring for more information*

brg_seal_datadict, optional

Dict holding lists of bearings and seals datas. Example : brg_seal_data=BearingElement(n=1, kxx=1e6, cxx=0,

kyy=1e6, cyy=0, kxy=0, cxy=0, kyx=0, cyx=0)

*See ‘bearing_seal_element.py’ docstring for more information*

nel_rint, optional

Number or elements per shaft region. Default is 1.

tagstr

A tag for the rotor

Returns:
A rotor object
Raises:
ValueError

Error raised if lists size do not match.

AttributeError

Error raised if the shaft material is not defined.

gravitational_force(g=-9.8065, direction='y', M=None, num_dof=None)#

Compute the gravitational force vector for the system.

Parameters:
gfloat, optional

Acceleration due to gravity. Default is -9.8065 m/s².

direction{“x”, “y”, “z”}, optional

Direction in which gravity acts. Default is “y”.

Mndarray, optional

Mass matrix of the system. If None, the internal mass matrix is used.

num_dofint, optional

Number of degrees of freedom per node. If None, the internal value is used.

Returns:
forcendarray

Gravitational force (weight) vector of shape (ndof,).

Examples

>>> rotor = compressor_example()
>>> force = rotor.gravitational_force()
>>> force[:4]
array([ 0.        , -3.12941854,  0.        ,  0.01851573])
integrate_system(speed, F, t, **kwargs)#

Time integration for a rotor system.

This method returns the time response for a rotor given a force, time and speed based on time integration with the Newmark method.

Parameters:
speedfloat or array_like

Rotor speed.

Fndarray

Force array (needs to have the same length as time array).

tndarray

Time array.

**kwargsoptional

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See newmark for more details. Other optional arguments are listed below.

model_reductiondict, optional

When model_reduction is provided, the corresponding reduction method is initialized. Dict keys:

methodstr, optional

Reduction method to use, e.g., “guyan” or “pseudomodal”. Defaults to “guyan”.

num_modesint, optional

Number of modes to reduce the model to, if pseudo-modal method is considered.

include_nodeslist of int, optional

List of the nodes to be included, if Guyan reduction method is considered.

dof_mappinglist of str, optional

List of the local DOFs to be considered when using Guyan reduction method. Valid values are: ‘x’, ‘y’, ‘z’, ‘alpha’, ‘beta’, ‘theta’, corresponding to:

  • ‘x’ and ‘y’: lateral translations

  • ‘z’: axial translation

  • ‘alpha’: rotation about the x-axis

  • ‘beta’: rotation about the y-axis

  • ‘theta’: torsional rotation (about the z-axis)

Default is [‘x’, ‘y’].

include_dofs (list of int, optional):

Additional degrees of freedom (DOFs) to include in the reduction, such as DOFs with applied forces or probe locations when using Guyan reduction method.

add_to_RHScallable, optional

An optional function that computes and returns an additional array to be added to the right-hand side of the equation of motion. This function should take the time step number as argument, and can take optional arguments corresponding to the current state of the rotor system, including the displacements disp_resp, velocities velc_resp, and acceleration accl_resp. It should return an array of the same length as the degrees of freedom of the rotor system rotor.ndof. This function allows for the incorporation of supplementary terms or external effects in the rotor system dynamics beyond the specified force input during the time integration process.

Returns:
tndarray

Time values for the output.

youtndarray

System response.

xoutlist

Time evolution of the state vector and auxiliary data.

Examples

>>> import ross as rs
>>> rotor = rs.compressor_example()
>>> size = 10000
>>> node = 3
>>> speed = 500.0
>>> accel = 0.0
>>> t = np.linspace(0, 10, size)
>>> F = np.zeros((size, rotor.ndof))
>>> F[:, rotor.number_dof * node + 0] = 10 * np.cos(2 * t)
>>> F[:, rotor.number_dof * node + 1] = 10 * np.sin(2 * t)
>>> t, yout, xout = rotor.integrate_system(speed, F, t)
Running direct method...
>>> yout[:, rotor.number_dof * node + 1]
array([0.00000000e+00, 2.07136253e-10, 7.80557630e-10, ...,
       1.21845368e-07, 1.21954345e-07, 1.22062832e-07])
classmethod load(file)#

Load rotor from a .toml or .json file.

This method restores a rotor from a previously saved file. Element coefficients are loaded directly without recomputation, so the rotor is reconstructed much faster than building it from scratch. Because of this, manually editing values in the saved file will NOT trigger recalculation of dependent quantities. To modify the rotor, change parameters in Python and save again.

Parameters:
filestr or pathlib.Path

String or Path for a .toml or .json file.

Returns:
rotorross.rotor.Rotor
magnetic_bearing_controller(step, magnetic_bearings, time_step, disp_resp, **kwargs)#

Compute control forces for Active Magnetic Bearings (AMBs).

This method calculates the magnetic control forces generated by active magnetic bearings (AMBs) at each time step using a PID control law. The forces are based on the measured displacements and can optionally include external disturbances for sensitivity analysis.

If sensitivity analysis is enabled via keyword arguments, the method injects a known disturbance at a specific DoF and logs excitation, disturbed, and sensor signals for post-processing.

Parameters:
stepint

Current time step index in the simulation.

magnetic_bearingslist

List of MagneticBearingElement objects used for force computation.

time_stepfloat

Time increment used in the numerical integration scheme (in seconds).

disp_respndarray

Displacement response vector of the rotor at the current time step. The size must match the number of rotor DoFs.

Returns:
magnetic_forcendarray

Force vector containing control forces applied by each magnetic bearing in the rotor system. Has the same length as self.ndof.

Other Parameters:
sensitivity_compute_dofint, optional

Index of the DoF where a disturbance signal is applied (for sensitivity analysis).

sensitivity_disturbancendarray, optional

Disturbance signal array (e.g., chirp) to be injected at the specified DoF.

sensitivity_result_valuesdict, optional
Dictionary to store the time history of:
  • “excitation_signal”

  • “disturbed_signal”

  • “sensor_signal”

for post-processing in sensitivity computations.

Notes

  • The control forces are applied in both x and y directions at each AMB location.

  • The actual PID computation is delegated to the compute_amb_controller function.

  • If sensitivity_compute_dof is provided, the excitation is applied to that DoF only.

Examples

>>> import ross as rs
>>> import numpy as np
>>> rotor = rs.rotor_example_amb_general_controllers()
>>> dt, speed, step = 1e-4, 1000, 1
>>> t = np.arange(0, 5 * dt, dt)
>>> node = [27, 29]
>>> mass = [10, 10]
>>> F = np.zeros((len(t), rotor.ndof))
>>> for n, m in zip(node,mass):
...     F[:, 6 * n + 0] = m * np.cos((speed * t))
...     F[:, 6 * n + 1] = (m-5) * np.sin((speed * t))
>>> response = rotor.run_time_response(speed, F, t, method = "newmark")
Running direct method...
>>> magnetic_bearings = [brg for brg in rotor.bearing_elements if isinstance(brg, rs.bearing_seal_element.MagneticBearingElement)]
>>> amb_data = {key: np.zeros((len(t), len(magnetic_bearings) * 2)) for key in ["x_amb", "v_amb", "F_x", "F_v", "I"]}
>>> magnetic_force = rotor.magnetic_bearing_controller(step, magnetic_bearings, dt, response.yout[-1,:], amb_data=amb_data)
>>> np.nonzero(magnetic_force)[0]
array([ 72,  73, 258, 259])
>>> magnetic_force[np.nonzero(magnetic_force)[0]]
array([-1.77841057e-04,  5.15148204e-06, -2.96097989e-04,  3.35036499e-05])
plot_rotor(nodes=1, check_sld=False, length_units='m', bearing_style='pedestal', show_axes_indicator=False, **kwargs)#

Plot a rotor object.

This function will take a rotor object and plot its elements representation using Plotly.

The shaft is drawn as rendered metal above the center line, and three toggle buttons below the plot control the view: one switches the half below the center line between the same rendered look and a material cross section, where each material is hatched in its own color and the bore of hollow elements is left void; one switches the bearings between the solid pedestal and the classic spring/damper representation; and one displays the rotor frame of reference, with z along the shaft, y upwards, x into the page and the spin taking x toward y. Every shade in the plot is derived from a single color per element, so setting Material.color, DiskElement.color or BearingElement.color controls the whole appearance of that element. Below the rotor there is a scale with the node numbers; hovering a node drops a guide line across the rotor.

Parameters:
nodesint, optional

Increment that will be used to plot nodes label. Labels which would be printed over each other are dropped, but every node can still be hovered on the node scale.

check_sldbool

If True, checks the slenderness ratio for each element. The shaft elements which has a slenderness ratio < 1.6 will be displayed in yellow color.

length_unitsstr, optional

length units to length and diameter. Default is ‘m’.

bearing_stylestr, optional

Initial bearing representation, “pedestal” or “spring_damper”. The button below the plot switches between the two. Default is “pedestal”.

show_axes_indicatorbool, optional

If True, the coordinate axes indicator starts visible. The button below the plot switches it at any time. Default is False.

kwargsoptional

Additional key word arguments can be passed to change the plot layout only (e.g. width=1000, height=800, …). *See Plotly Python Figure Reference for more information.

Returns:
figplotly.graph_objects.Figure

The figure object with the rotor representation.

refine(subdivisions)#

Split the shaft intervals of the rotor in equal shaft elements.

An interval is the length between two consecutive shaft nodes. Every shaft element of an interval (more than one in layered shafts) is split in the same number of equal elements, and the diameters of tapered elements are interpolated along the length. Disks, bearings, seals and point masses keep their positions, and the nodes off the shaft (e.g. bearing housings) are renumbered after the new shaft nodes. Intervals holding a coupling element are not split.

Parameters:
subdivisionsint, array_like

Number of elements each interval is split into, either one value for every interval or a single value for all of them.

Returns:
rotorross.Rotor

A new rotor with the refined shaft. The original rotor is not modified.

Examples

>>> rotor = rotor_example()
>>> refined = rotor.refine(4)
>>> len(rotor.shaft_elements), len(refined.shaft_elements)
(6, 24)
>>> [disk.n for disk in refined.disk_elements]
[8, 16]
>>> bool(np.isclose(refined.m, rotor.m))
True
refine_mesh(max_ld=0.5, min_ld=0.1, parts=None)#

Subdivide the shaft elements by their length-to-diameter ratio.

Every shaft element whose length is more than max_ld times its outer diameter is cut into equal parts, as few as keep each part at or under that ratio. The nodes the rotor already has are all kept, so disks, bearings, seals and point masses stay where they are (they are renumbered as add_nodes() renumbers them), and the mass, the inertia and the geometry of the shaft line do not change.

The rule is the one of API RP 684 (Tutorial on the API Standard Paragraphs Covering Rotor Dynamics and Balancing, section 1.5.2.1): after dividing the rotor at every step of diameter, the length to diameter ratio of any section should not exceed 1.0 – 0.5 is preferred – nor be less than 0.1. A section shorter than min_ld diameters cannot be fixed by cutting; it is reported with a warning.

Elements sharing the same pair of nodes (a sleeve over a shaft) are cut together, by the largest outer diameter among them. A span that holds a coupling element is not cut.

Parameters:
max_ldfloat, optional

Largest length-to-diameter ratio left in the model. Default is 0.5.

min_ldfloat, optional

Smallest length-to-diameter ratio that is not warned about. Default is 0.1.

partsint, optional

When given, every shaft element is cut into this many equal parts instead, whatever its ratio (as nel_r does in from_section()), and max_ld is not used. Couplings are still not cut.

Returns:
A rotor object. The original rotor is not modified.

Notes

The diameter is the larger of odl and odr, so a tapered element is cut by its thicker end. As with add_nodes(), the tags of the shaft elements are not kept when any element is cut.

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()
>>> refined = rotor.refine_mesh(max_ld=0.5)
>>> len(rotor.shaft_elements), len(refined.shaft_elements)
(6, 60)
>>> ratios = [elm.L / max(elm.odl, elm.odr) for elm in refined.shaft_elements]
>>> round(max(ratios), 9)
0.5
>>> [disk.n for disk in rotor.disk_elements], [disk.n for disk in refined.disk_elements]
([2, 4], [20, 40])
>>> round(refined.m - rotor.m, 12)
0.0
>>> len(rotor.refine_mesh(parts=3).shaft_elements)
18
run_amb_non_collocation(magnetic_bearing, speed=0.0, modes=None, sensor_nodes=None, direction='x', residue_tolerance=0.05)#

Run a modal sensor-actuator non-collocation analysis.

Parameters:
magnetic_bearingMagneticBearingElement

Magnetic bearing whose actuator node is used as the reference.

speedfloat, optional

Rotor speed in rad/s. Currently, only zero speed is supported.

modesarray_like of int, optional

Zero-based modal indices requested for the analysis.

sensor_nodesarray_like of int, optional

Candidate sensor nodes. By default, all rotor nodes are used.

direction{“x”, “y”} or float, optional

Direction used to project the lateral mode shapes. Numeric values are interpreted as angles in radians.

residue_tolerancefloat, optional

Normalized residue tolerance used to identify regions near modal nodes.

Returns:
AmbNonCollocationResults

Modal non-collocation analysis results.

run_amb_sensitivity(speed, t_max, dt, disturbance_amplitude=1e-05, disturbance_min_frequency=0.001, disturbance_max_frequency=150, amb_tags=None, verbose=1)#

Run Active Magnetic Bearing (AMB) sensitivity analysis.

This method performs a frequency-domain sensitivity analysis of the rotor system equipped with active magnetic bearings (AMBs). The analysis uses a logarithmic chirp excitation applied as an external disturbance force to compute the system’s frequency response at the AMB-controlled degrees of freedom (DoFs). The results provide magnitude and phase sensitivity functions for each AMB in both x and y directions.

Parameters:
speedfloat

Rotational speed of the rotor in rad/s.

t_maxfloat

Total time duration of the simulation in seconds.

dtfloat

Time step for the simulation in seconds.

disturbance_amplitudefloat, optional

Amplitude of the excitation chirp signal applied as a disturbance. Default is 10e-6.

disturbance_min_frequencyfloat, optional

Minimum frequency (in Hz) of the logarithmic chirp signal used for excitation. The chirp sweeps from this frequency up to disturbance_max_frequency. Default is 1e-3 Hz.

disturbance_max_frequencyfloat, optional

Maximum frequency (in Hz) of the logarithmic chirp signal used for excitation. Default is 150 Hz.

amb_tagslist of str, optional

List of magnetic bearing tags to include in the sensitivity analysis. If None or empty, all MagneticBearingElement instances in the rotor are used. If provided, only the AMBs matching the specified tags will be analyzed. Raises a RuntimeError if no AMB with the given tag is found.

verboseint, optional

Controls the verbosity of the method. If 1 or greater, both the simulation time and the forces produced by the AMBs are presented. If 0, no output is shown. Default is 1.

Returns:
resultsSensitivityResults

Object containing sensitivity magnitude, phase, and frequency vectors for each magnetic bearing tag and direction (‘x’, ‘y’). Also includes the excitation, disturbed, and sensor signals used in the computation.

Notes

  • The excitation is a logarithmic chirp sweeping from disturbance_min_frequency to disturbance_max_frequency (Hz).

  • The excitation is applied individually to each DoF controlled by an AMB.

  • The method assumes that the rotor contains MagneticBearingElement instances.

  • A Newmark time integration scheme is used internally via run_time_response().

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example_amb_general_controllers()
>>> # Run sensitivity for all magnetic bearings in the rotor (default sweep)
>>> sensitivity_results = rotor.run_amb_sensitivity(speed=314.16, t_max=5e-4, dt=1e-4)
Running direct method...
>>> # Run sensitivity only for a specific AMB tag (e.g., "Magnetic Bearing 0")
>>> sensitivity_results = rotor.run_amb_sensitivity(
...     speed=314.16, t_max=5e-4, dt=1e-4, amb_tags=["Magnetic Bearing 0"]
... )
Running direct method...
>>> # Run sensitivity with a custom chirp band (0.1 Hz to 200 Hz)
>>> sensitivity_results = rotor.run_amb_sensitivity(
...     speed=314.16, t_max=5e-4, dt=1e-4,
...     disturbance_min_frequency=0.1, disturbance_max_frequency=200.0
... )
Running direct method...
>>> # Accessing maximum absolute sensitivities for "Magnetic Bearing 0"
>>> max_sens_bearing_0_x = sensitivity_results.max_abs_sensitivities["Magnetic Bearing 0"]["x"]
>>> max_sens_bearing_0_y = sensitivity_results.max_abs_sensitivities["Magnetic Bearing 0"]["y"]
>>> # Plotting the sensitivities for all AMBs and axes
>>> fig = sensitivity_results.plot(
...     frequency_units="Hz", phase_unit="degree",
...     magnitude_scale="decibel", xaxis_type="log"
... )
>>> # Plotting the time results used in sensitivity calculation
>>> fig = sensitivity_results.plot_time_results()
run_campbell(speed_range, frequencies=6, frequency_type='wd', torsional_analysis=False, matched_whirl=False, whirl_rtol=0.001, whirl_max_iter=15)#

Calculate the Campbell diagram.

This function will calculate the damped natural frequencies for a speed range.

Available plotting methods:

.plot()

Parameters:
speed_rangearray, pint.Quantity

Array with the speed range in rad/s.

frequenciesint, optional

Number of frequencies that will be calculated. Default is 6.

frequency_typestr, optional

Choose between displaying results related to the undamped natural frequencies (“wn”) or damped natural frequencies (“wd”). The default is “wd”.

torsional_analysisbool, optional

If True, performs a separate torsional analysis and returns the respective modes in the Campbell diagram. In this case, a system with only torsional degrees of freedom is considered, thus disregarding coupled modes (lateral + torsional). Default is False.

matched_whirlbool, optional

If True, the modal analysis at each speed evaluates the frequency-dependent bearing and seal coefficients at each mode’s own damped natural frequency (see run_modal()). Default is False (synchronous coefficients).

whirl_rtolfloat, optional

Relative tolerance of the matched_whirl iteration. Default is 1e-3.

whirl_max_iterint, optional

Maximum number of matched_whirl iterations per mode. Default is 15.

Returns:
resultsross.CampbellResults

For more information on attributes and methods available see: ross.CampbellResults

See also

ross.utils.speed_range_from_endpoints

Build speed_range from its end points, each one in any speed unit, with a number of points that grows with the range.

Examples

>>> import ross as rs
>>> rotor1 = rs.rotor_example()
>>> speed = np.linspace(0, 400, 11)

Diagram with undamped natural frequencies >>> camp = rotor1.run_campbell(speed, frequency_type=”wn”)

Diagram with damped natural frequencies >>> camp = rotor1.run_campbell(speed)

Plotting Campbell Diagram >>> fig = camp.plot()

run_clearance_analysis(speed_range, minimum_allowable_speed, maximum_continuous_speed, probes, mode=0, node=None, unbalance_magnitude=None, unbalance_phase=None, scale_factor_cap=None, num_modes=12)#

Close-clearance check of the unbalance response after API 617.

Implements API 617 (9th edition) 6.8.2.10 and 6.8.2.11:

  1. The unbalance response is computed over speed_range with the unbalance of api617_unbalance() for the selected mode (or with the unbalance given explicitly).

  2. The mechanical test vibration limit is \(A_{vl} = \min(25.4, 25.4 \sqrt{12000 / N_{mc}})\) µm peak to peak, with \(N_{mc}\) in rpm.

  3. \(A_{max}\) is the largest peak-to-peak amplitude measured by the probes between the minimum allowable speed and the maximum continuous speed.

  4. The scale factor \(S_{cc} = A_{vl} / A_{max}\) is applied to the major-axis peak-to-peak amplitude at every close-clearance location. API 617 limits \(S_{cc}\) to 6; the limit is applied only when scale_factor_cap is given.

  5. The scaled amplitudes are compared with 75 % of the minimum diametral running clearance at each location, at the worst speed of speed_range.

The close-clearance locations are the bearing and seal elements of the rotor that carry a radial_clearance (fluid-film bearings, labyrinth and hole-pattern seals, and any BearingElement or SealElement created with radial_clearance=). The diametral clearance is twice the smallest radial clearance of the element.

Parameters:
speed_rangearray, pint.Quantity

Rotor speeds of the unbalance response (rad/s). API 617 asks for the range from zero to the trip speed. The minimum allowable speed and the maximum continuous speed are added to the range if absent.

minimum_allowable_speedfloat, pint.Quantity

Minimum allowable speed \(N_{ma}\) (rad/s).

maximum_continuous_speedfloat, pint.Quantity

Maximum continuous speed \(N_{mc}\) (rad/s).

probeslist

List of ross.Probe objects at the location and orientation of the machine vibration probes. \(A_{max}\) is taken over these probes.

modeint, optional

Index of the forward mode used to place the unbalance (0 is the first forward mode). See api617_unbalance(). Ignored when node is given. Default is 0.

nodelist, int, optional

Node(s) where the unbalance is applied, overriding the placement derived from mode. Requires unbalance_magnitude and unbalance_phase. Default is None.

unbalance_magnitudelist, float, pint.Quantity, optional

Unbalance magnitude(s) in kg·m, used with node. Default is None.

unbalance_phaselist, float, pint.Quantity, optional

Unbalance phase(s) in rad, used with node. Default is None.

scale_factor_capfloat, optional

Upper limit for the scale factor \(S_{cc}\). API 617 6.8.2.11 uses 6. Default is None, which applies no limit.

num_modesint, optional

Number of modes computed to select the mode shape. Default is 12.

Returns:
resultsross.ClearanceResults

Results with the probe response, the vibration limit, the scale factor and the scaled response at each close-clearance location. Amplitudes are peak to peak and clearances diametral, in metres. Use results.data() for a summary table and results.plot(), results.plot_response() and results.plot_probe_response() for the plots.

Examples

>>> import ross as rs
>>> import numpy as np
>>> from ross.units import Q_
>>> rotor = rs.rotor_example()
>>> bearings = [
...     rs.BearingElement(n=0, kxx=1e6, cxx=1e3, radial_clearance=Q_(100, "um")),
...     rs.BearingElement(n=6, kxx=1e6, cxx=1e3, radial_clearance=Q_(100, "um")),
... ]
>>> rotor = rs.Rotor(rotor.shaft_elements, rotor.disk_elements, bearings)
>>> probes = [rs.Probe(0, Q_(45, "deg")), rs.Probe(6, Q_(45, "deg"))]
>>> results = rotor.run_clearance_analysis(
...     speed_range=Q_(np.linspace(0, 10000, 101), "RPM"),
...     minimum_allowable_speed=Q_(7000, "RPM"),
...     maximum_continuous_speed=Q_(9000, "RPM"),
...     probes=probes,
... )
>>> round(results.vibration_limit * 1e6, 1)
25.4
>>> list(results.clearance_nodes)
[0, 6]
run_crack(n, depth_ratio, node, unbalance_magnitude, unbalance_phase, speed, t, crack_model='Mayes', cross_divisions=None, **kwargs)#

Run analysis for the rotor system with crack given an unbalance force.

Crack object is instantiated and system’s time response is simulated.

Parameters:
nfloat

Element number where the crack is located.

depth_ratiofloat

Crack depth ratio related to the diameter of the crack container element. A depth value of 0.1 is equal to 10%, 0.2 equal to 20%, and so on.

nodelist, int

Node where the unbalance is applied.

unbalance_magnitudelist, float, pint.Quantity

Unbalance magnitude (kg.m).

unbalance_phaselist, float, pint.Quantity

Unbalance phase (rad).

speedfloat or array_like, pint.Quantity

Rotor speed.

Farray

Force array (needs to have the same number of rows as time array). Each column corresponds to a dof and each row to a time.

tarray

Time array.

crack_modelstring, optional

String containing type of crack model chosed. The available types are: “Mayes”, “Gasch”, “Flex Open” and “Flex Breathing”. Default is “Mayes”.

cross_divisions: float, optional

Number of square divisions into which the cross-section of the cracked element will be divided in the analysis conducted for the Flex Breathing model.

**kwargsoptional

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to be used in numerical integration (e.g. model_reduction). See Rotor.integrate_system for more details.

Returns:
resultsross.TimeResponseResults

For more information on attributes and methods available see: ross.TimeResponseResults

Examples

>>> import ross as rs
>>> from ross.probe import Probe
>>> from ross.units import Q_
>>> rotor = rs.rotor_example_with_damping()
>>> n1 = rotor.disk_elements[0].n
>>> n2 = rotor.disk_elements[1].n
>>> results = rotor.run_crack(
...    n=18,
...    depth_ratio=0.2,
...    node=[n1, n2],
...    unbalance_magnitude=[5e-4, 0],
...    unbalance_phase=[-np.pi / 2, 0],
...    crack_model="Mayes",
...    speed=Q_(1200, "RPM"),
...    t=np.arange(0, 0.5, 0.0001),
...    model_reduction={"num_modes": 12},  # Pseudo-modal method
... )
Running with model reduction: pseudomodal...
>>> probe1 = Probe(14, 0)
>>> probe2 = Probe(22, 0)
>>> fig1 = results.plot_1d([probe1, probe2])
>>> fig2 = results.plot_dfft(
...     [probe1, probe2],
...     frequency_range=Q_((0, 200), "Hz"),
...     yaxis_type="log",
... )
run_critical_speed(speed_range=None, num_modes=12, rtol=0.005)#

Calculate the critical speeds and damping ratios for the rotor model.

This function runs an iterative method over “run_modal()” to minimize (using scipy.optimize.newton) the error between the rotor speed and the rotor critical speeds (rotor speed - critical speed).

Differently from run_modal(), this function doesn’t take a speed input because it iterates over the natural frequencies calculated in the last iteration. The initial value is considered to be the undamped natural frequencies for speed = 0 (no gyroscopic effect).

Once the error is within an acceptable range defined by “rtol”, it returns the approximated critical speed.

With the critical speeds calculated, the function uses the results to calculate the log dec and damping ratios for each critical speed.

Parameters:
speed_rangetuple, optional, pint.Quantity

Tuple (start, end) with the desired range of frequencies (rad/s). The function returns all eigenvalues within this range.

num_modesint, optional

The number of eigenvalues and eigenvectors to be calculated using ARPACK. If sparse=True, it determines the number of eigenvalues and eigenvectors to be calculated. It must be smaller than Rotor.ndof - 1. It is not possible to compute all eigenvectors of a matrix with ARPACK. If speed_range is not None, num_modes is overrided. Default is 12.

rtolfloat, optional

Tolerance (relative) for termination. Applied to scipy.optimize.newton. Default is 0.005 (0.5%).

Returns:
resultsross.CriticalSpeedResults

For more information on attributes and methods available see: ross.CriticalSpeedResults

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()

Finding the first Nth critical speeds >>> results = rotor.run_critical_speed(num_modes=8) >>> np.round(results.wd()) array([ 92., 96., 271., 300.]) >>> np.round(results.wn()) array([ 92., 96., 271., 300.])

Finding the first critical speeds within a speed range >>> results = rotor.run_critical_speed(speed_range=(100, 1000)) >>> np.round(results.wd()) array([271., 300., 636., 774., 867.])

Changing output units >>> np.round(results.wd(“rpm”)) array([2590., 2868., 6074., 7394., 8278.])

Retrieving whirl directions >>> results.whirl_direction # doctest: +ELLIPSIS array([…

run_forced_response(force=None, speed_range=None, modes=None, unbalance=None, speed=None)#

Forced response for a mdof system.

This method returns the unbalanced response for a mdof system given magnitude and phase of the unbalance, the node where it’s applied and a frequency range.

Available plotting methods:

.plot() .plot_magnitude() .plot_phase() .plot_polar_bode() .plot_deflected_shape() .plot_bending_moment() .plot_deflected_shape_3d() .plot_deflected_shape_2d()

Parameters:
forcelist, array, pint.Quantity

Unbalance force in each degree of freedom for each value in omega

speed_rangelist, array, pint.Quantity

Array with the desired range of frequencies

modeslist, optional

Modes that will be used to calculate the frequency response (all modes will be used if a list is not given).

unbalancearray, optional

Array with the unbalance data (node, magnitude and phase) to be plotted with deflected shape. This argument is set only if running an unbalance response analysis. Default is None.

speedfloat, pint.Quantity, optional

Fixed rotor speed (rad/s). When given, speed_range is the excitation frequency sweep of the force while the rotor speed stays fixed (see run_freq_response()). Default is None (synchronous sweep).

Returns:
resultsross.ForcedResponseResults

For more information on attributes and methods available see: ross.ForcedResponseResults

Examples

>>> rotor = rotor_example()
>>> speed = np.linspace(0, 1000, 101)
>>> force = rotor._unbalance_force(3, 10.0, 0.0, speed)
>>> resp = rotor.run_forced_response(force=force, speed_range=speed)
>>> abs(resp.forced_resp)
array([[0.00000000e+00, 5.06073311e-04, 2.10044826e-03, ...
run_freq_response(speed_range=None, modes=None, free_free=False, speed=None)#

Frequency response for a mdof system.

This method returns the frequency response for a mdof system given a range of frequencies and the modes that will be used.

By default the sweep is synchronous: each value of speed_range is used both as the rotor speed (gyroscopic effect and speed-dependent coefficients) and as the excitation frequency. With speed the rotor speed is held fixed and speed_range becomes the excitation frequency sweep, which is the response to a non-synchronous excitation at a fixed operating point.

Available plotting methods:

.plot() .plot_magnitude() .plot_phase() .plot_polar_bode()

Parameters:
speed_rangearray, optional, pint.Quantity

Array with the desired range of frequencies. Default is 0 to 1.5 x highest damped natural frequency.

modeslist, optional

Modes that will be used to calculate the frequency response (all modes will be used if a list is not given).

free_freebool, optional

If True, the method will consider the rotor system as free-free. Default is False.

speedfloat, pint.Quantity, optional

Fixed rotor speed (rad/s). When given, speed_range is swept as the excitation frequency while the gyroscopic effect and the speed-dependent coefficients stay at this speed. Default is None (synchronous sweep).

Returns:
resultsross.FrequencyResponseResults

For more information on attributes and methods available see: ross.FrequencyResponseResults

See also

ross.utils.speed_range_from_endpoints

Build speed_range from its end points, each one in any speed unit, with a number of points that grows with the range.

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()
>>> speed =np.linspace(0, 1000, 101)
>>> response = rotor.run_freq_response(speed_range=speed)

Excitation sweep at a fixed rotor speed: >>> response_fixed = rotor.run_freq_response(speed_range=speed, speed=500.0)

Return the response amplitude >>> abs(response.freq_resp) # doctest: +ELLIPSIS array([[[0.00000000e+00, 1.00261725e-06, 1.01076952e-06, …

Return the response phase >>> np.angle(response.freq_resp) # doctest: +ELLIPSIS array([[[…

Selecting the desirable modes, if you want a reduced model: >>> response = rotor.run_freq_response(speed_range=speed, modes=[0, 1, 2, 3, 4]) >>> abs(response.freq_resp) # doctest: +ELLIPSIS array([[[0.00000000e+00, 1.00261725e-06, 1.01076952e-06, …

Plotting frequency response function: >>> fig = response.plot(inp=13, out=13)

To plot velocity and acceleration responses, you must change amplitude_units from “[length]/[force]” units to “[speed]/[force]” or “[acceleration]/[force]” respectively

Plotting velocity response >>> fig = response.plot(inp=13, out=13, amplitude_units=”m/s/N”)

Plotting acceleration response >>> fig = response.plot(inp=13, out=13, amplitude_units=”m/s**2/N”)

run_harmonic_balance_response(speed, t, harmonic_forces, gravity=False, n_harmonics=1)#

Compute the steady-state response of the rotor using the Harmonic Balance method.

Parameters:
speedfloat, pint.Quantity

Rotational speed of the rotor (rad/s).

tarray_like

Time vector (s).

harmonic_forceslist of dict

List of harmonic force definitions. Each dictionary should contain the following keys:

  • ‘node’: int

    Node index where the force is applied.

  • ‘magnitudes’: list, float

    List of excitation magnitudes. Interpretation depends on the type of excitation:

    • For direct harmonic forces: force amplitudes (N).

    • For unbalance-type excitations: m * e * speed**2 (N), where m is the unbalance mass (kg) and e is the eccentricity (m).

  • ‘phases’: list of float

    List of phase angles (rad).

  • ‘harmonics’: list of int

    List of harmonic orders (1 for fundamental, 2 for second, etc.).

gravitybool, optional

If True, include the effect of gravity in the response. Default is False.

n_harmonicsint, optional

Number of harmonics to consider in the Harmonic Balance solution. Default is 1 (only fundamental harmonic is considered).

Returns:
resultsross.results.HarmonicBalanceResponse

Object containing the steady-state response.

Examples

>>> import ross as rs
>>> from ross.probe import Probe
>>> rotor = rs.rotor_example()
>>> speed = 200.0
>>> unb_node = 3
>>> unb_mag = 0.05 * speed**2
>>> unb_phase = 0.0
>>> unb_harmonic = 1 # For unbalance, always 1x
>>> results = rotor.run_harmonic_balance_response(
...     speed=200.0,
...     t=np.linspace(0, 0.5, 1001),
...     harmonic_forces=[{
...         "node": unb_node,
...         "magnitudes": [unb_mag],
...         "phases": [unb_phase],
...         "harmonics": [unb_harmonic],
...     }],
...     gravity=False,
...     n_harmonics=1,
... )
>>> time_resp = results.get_time_response()
>>> probe1 = Probe(3, 0)
>>> # plot time response for a given probe:
>>> fig1 = time_resp.plot_1d(probe=[probe1])
>>> # plot dfft:
>>> fig2 = time_resp.plot_dfft(probe=[probe1])
run_level1(n=5, stiffness_range=None, num=5, **kwargs)#

Plot level 1 stability analysis.

This method will plot the stability 1 analysis for a given stiffness range.

Parameters:
nint

Number of steps in the range. Default is 5.

stiffness_rangetuple, optional

Tuple with (start, end) for stiffness range. This will be used to create an evenly numbers spaced evenly on a log scale to create a better visualization (see np.logspace).

kwargsoptional

Additional key word arguments can be passed to change the plot layout only (e.g. width=1000, height=800, …). See Plotly Python Figure Reference for more information.

Returns:
resultsross.Level1Results

For more information on attributes and methods available see: ross.Level1Results

run_mesh_convergence(rtol=0.001, frequencies=6, strategy='cheapest', speed=0, max_elements=1000)#

Find a shaft discretization with converged natural frequencies.

The shaft intervals of the rotor (the lengths between consecutive shaft nodes) are split into equal elements (see refine()) until the lowest natural frequencies are within rtol of a converged reference. The reference is found by halving the length of the elements until the frequencies change less than rtol / 10. The k-th lowest natural frequency of a discretization is compared with the k-th lowest frequency of the reference.

Two families of discretizations are searched:

  • uniform: every element is at most h long;

  • graded: every element is at most a fraction of the local bending wavelength at the highest reference frequency, so thin sections get shorter elements than thick ones.

The shaft elements of the rotor are the coarsest discretization considered: they are split, never merged. The rotor is not modified.

Parameters:
rtolfloat, optional

Maximum relative error of the natural frequencies against the reference. Default is 1e-3 (0.1%).

frequenciesint, optional

Number of natural frequencies (the lowest ones) that must converge. Default is 6.

strategystr, optional

“cheapest” returns the discretization with the fewest shaft elements found in both families, and “uniform” searches the uniform family only. Default is “cheapest”.

speedfloat, pint.Quantity, optional

Rotor speed of the modal analyses (rad/s). Default is 0.

max_elementsint, optional

Maximum number of shaft elements of the discretizations evaluated. A ValueError is raised when the reference needs more. Default is 1000.

Returns:
resultsross.MeshConvergenceResults

For more information on attributes and methods available see: ross.MeshConvergenceResults. The rotor with the chosen discretization is results.rotor.

Examples

>>> rotor = rotor_example()
>>> results = rotor.run_mesh_convergence(rtol=1e-4)
>>> len(rotor.shaft_elements), len(results.rotor.shaft_elements)
(6, 12)
>>> bool(results.error.max() <= 1e-4)
True
>>> fig = results.plot()
run_misalignment(node, unbalance_magnitude, unbalance_phase, speed, t, coupling='flex', **kwargs)#

Run analysis for the rotor system with misalignment given an unbalance force.

Misalignment object is instantiated and system’s time response is simulated. There are two types of coupling: flexible (flex) and rigid, each with distinct parameters. These parameters are passed to the respective method through **kwargs.

Parameters:
nodelist, int

Node where the unbalance is applied.

unbalance_magnitudelist, float, pint.Quantity

Unbalance magnitude (kg.m).

unbalance_phaselist, float, pint.Quantity

Unbalance phase (rad).

speedfloat or array_like, pint.Quantity

Rotor speed.

Farray

Force array (needs to have the same number of rows as time array). Each column corresponds to a dof and each row to a time.

tarray

Time array.

couplingstr

Coupling type. The available types are: “flex” and “rigid”. Default is “flex”.

**kwargsdictionary
If coupling = “flex”, **kwargs receives:
nfloat

Number of shaft element where the misalignment is ocurring.

mis_type: string

Name of the chosen misalignment type. The available types are: “parallel”, “angular” and “combined”.

mis_distance_xfloat, pint.Quantity

Parallel misalignment distance between driving rotor and driven rotor along X direction.

mis_distance_yfloat, pint.Quantity

Parallel misalignment distance between driving rotor and driven rotor along Y direction.

mis_anglefloat, pint.Quantity

Angular misalignment angle.

radial_stiffnessfloat, pint.Quantity

Radial stiffness of flexible coupling.

bending_stiffnessfloat, pint.Quantity

Bending stiffness of flexible coupling. Provide if mis_type is “angular” or “combined”.

input_torquefloat, pint.Quantity

Driving torque. Default is 0.

load_torquefloat, pint.Quantity

Driven torque. Default is 0.

If coupling = “rigid”, **kwargs receives:
nfloat

Number of shaft element where the misalignment is ocurring.

mis_distancefloat, pint.Quantity

Parallel misalignment distance between driving rotor and driven rotor.

input_torquefloat, pint.Quantity

Driving torque. Default is 0.

load_torquefloat, pint.Quantity

Driven torque. Default is 0.

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to be used in numerical integration (e.g. model_reduction). See Rotor.integrate_system for more details.

Returns:
resultsross.TimeResponseResults

For more information on attributes and methods available see: ross.TimeResponseResults

Examples

>>> import ross as rs
>>> from ross.probe import Probe
>>> from ross.units import Q_
>>> rotor = rotor_example_with_damping()
>>> n1 = rotor.disk_elements[0].n
>>> n2 = rotor.disk_elements[1].n
>>> results = rotor.run_misalignment(
...    node=[n1, n2],
...    unbalance_magnitude=[5e-4, 0],
...    unbalance_phase=[-np.pi / 2, 0],
...    speed=Q_(1200, "RPM"),
...    t=np.arange(0, 0.5, 0.0001),
...    coupling="rigid",
...    n=0,
...    mis_distance=2e-4,
...    input_torque=0,
...    load_torque=0,
...    model_reduction={"num_modes": 12},  # Pseudo-modal method
... )
Running with model reduction: pseudomodal...
>>> probe1 = Probe(14, 0)
>>> probe2 = Probe(22, 0)
>>> fig1 = results.plot_1d([probe1, probe2])
>>> fig2 = results.plot_dfft(
...     [probe1, probe2],
...     frequency_range=Q_((0, 200), "Hz"),
...     yaxis_type="log",
... )
run_rubbing(n, distance, contact_stiffness, contact_damping, friction_coeff, node, unbalance_magnitude, unbalance_phase, speed, t, torque=False, **kwargs)#

Run analysis for the rotor system with rubbing given an unbalance force.

Rubbing object is instantiated and system’s time response is simulated.

Parameters:
nint

Number of shaft element where rubbing is ocurring.

distancefloat, pint.Quantity

Distance between the housing and shaft surface.

contact_stiffnessfloat, pint.Quantity

Contact stiffness.

contact_dampingfloat, pint.Quantity

Contact damping.

friction_coefffloat

Friction coefficient.

nodelist, int

Node where the unbalance is applied.

unbalance_magnitudelist, float, pint.Quantity

Unbalance magnitude (kg.m).

unbalance_phaselist, float, pint.Quantity

Unbalance phase (rad).

speedfloat or array_like, pint.Quantity

Rotor speed.

Farray

Force array (needs to have the same number of rows as time array). Each column corresponds to a dof and each row to a time.

tarray

Time array.

torquebool, optional

If True a torque is considered by rubbing. Default is False.

**kwargsoptional

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to be used in numerical integration (e.g. model_reduction). See Rotor.integrate_system for more details.

Returns:
resultsross.TimeResponseResults

For more information on attributes and methods available see: ross.TimeResponseResults

Examples

>>> import ross as rs
>>> from ross.units import Q_
>>> from ross.probe import Probe
>>> rotor = rotor_example_with_damping()
>>> n1 = rotor.disk_elements[0].n
>>> n2 = rotor.disk_elements[1].n
>>> results = rotor.run_rubbing(
...    n=12,
...    distance=7.95e-5,
...    contact_stiffness=1.1e6,
...    contact_damping=40,
...    friction_coeff=0.3,
...    torque=False,
...    node=[n1, n2],
...    unbalance_magnitude=[5e-4, 0],
...    unbalance_phase=[-np.pi / 2, 0],
...    speed=Q_(1200, "RPM"),
...    t=np.arange(0, 0.5, 0.0001),
...    model_reduction={"num_modes": 12},  # Pseudo-modal method
... )
Running with model reduction: pseudomodal...
>>> probe1 = Probe(14, 0)
>>> probe2 = Probe(22, 0)
>>> fig1 = results.plot_1d([probe1, probe2])
>>> fig2 = results.plot_dfft(
...     [probe1, probe2],
...     frequency_range=Q_((0, 200), "Hz"),
...     yaxis_type="log",
... )
run_static()#

Run static analysis.

Static analysis calculates free-body diagram, deformed shaft, shearing force diagram and bending moment diagram.

Available plotting methods:

.plot_deformation() .plot_bending_moment() .plot_shearing_force() .plot_free_body_diagram()

Attributes:
shaft_weight: float

Shaft total weight

disk_forces_nodaldict

Relates the static force at each node due to the weight of disks

bearing_forces_nodaldict

Relates the static force at each node due to the bearing reaction forces.

bearing_forces_tagdict

Indicates the reaction force exerted by each bearing.

disk_forces_tagdict

Indicates the force exerted by each disk.

displacement_y: array

The shaft static displacement vector,

Vx: array

Shearing force vector

Bm: array

Bending moment vector

Returns:
resultsross.StaticResults

For more information on attributes and methods available see: ross.StaticResults

Raises:
ValueError

Error raised if the rotor has no bearing elements.

run_time_response(speed, F, t, method='default', **kwargs)#

Calculate the time response.

This function will take a rotor object and calculate its time response given a force and a time.

Available plotting methods:

.plot_1d() .plot_2d() .plot_3d()

Parameters:
speedfloat or array_like, pint.Quantity

Rotor speed. Automatically, the Newmark method is chosen if speed has an array_like type.

Farray

Force array (needs to have the same number of rows as time array). Each column corresponds to a dof and each row to a time.

tarray

Time array.

methodstr, optional

The Newmark method can be chosen by setting method=’newmark’.

**kwargsoptional

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to be used in numerical integration (e.g. model_reduction, add_to_RHS). See Rotor.integrate_system for more details.

Returns:
resultsross.TimeResponseResults

For more information on attributes and methods available see: ross.TimeResponseResults

Notes

The results store speed, so plot_1d, plot_2d and plot_3d can show one shaft revolution with one_revolution=True. Their t_initial and t_final arguments select any other time window. Neither reruns the simulation. A window must hold at least 10 samples, so for one_revolution=True the time step must be at most 1/9 of a revolution, 2π/(9 speed) seconds.

Examples

>>> from ross.probe import Probe
>>> rotor = rotor_example()
>>> speed = 500.0
>>> size = 1000
>>> node = 3
>>> probe1 = Probe(3, 0)
>>> # 0.25 s with a time step of 0.25 ms: about 50 steps per revolution
>>> t = np.linspace(0, 0.25, size)
>>> F = np.zeros((size, rotor.ndof))
>>> F[:, rotor.number_dof * node + 0] = 10 * np.cos(speed * t)
>>> F[:, rotor.number_dof * node + 1] = 10 * np.sin(speed * t)
>>> response = rotor.run_time_response(speed, F, t)
>>> response.yout[:, rotor.number_dof * node + 1]
array([ 0.00000000e+00,  4.19814382e-09,  2.42370942e-08, ...
>>> # plot time response for a given probe:
>>> fig1 = response.plot_1d(probe=[probe1])
>>> # plot orbit response - plotting 2D nodal orbit:
>>> fig2 = response.plot_2d(node=node)
>>> # plot orbit response - plotting 3D orbits - full rotor model:
>>> fig3 = response.plot_3d()
>>> # plot a regular time window:
>>> fig_window = response.plot_1d(
...     probe=[probe1], t_initial=0.1, t_final=0.2
... )
>>> # plot the last shaft revolution:
>>> fig_revolution = response.plot_2d(node=node, one_revolution=True)
>>> len(fig_revolution.data[0].x)
51
>>> # plot the shaft revolution that ends at a given time:
>>> fig_anchored = response.plot_3d(one_revolution=True, t_final=0.2)
run_ucs(stiffness_range=None, bearing_speed_range=None, num_modes=16, num=20, synchronous=False, **kwargs)#

Run Undamped Critical Speeds analyzes.

This method will run the undamped critical speed analyzes for a given range of stiffness values. If the range is not provided, the bearing stiffness at rated speed will be used to create a range.

Parameters:
stiffness_rangetuple, optional

Tuple with (start, end) for stiffness range in a log scale. In linear space, the sequence starts at base ** start (base to the power of start) and ends with base ** stop (see endpoint below). Here base is 10.0.

bearing_speed_rangetuple, optional

The bearing speed range used to calculate the intersection points. In some cases bearing coefficients will have to be extrapolated. The default is None. In this case the bearing speed axis is used.

num_modesint, optional

Number of modes to be calculated. This uses scipy.sparse.eigs method. Default is 16. In this case 4 modes are plotted, since for each pair of eigenvalues calculated we have one wn, and we show only the forward mode in the plots.

numint

Number of steps in the range. Default is 20.

synchronousbool, optional

If True a synchronous analysis is carried out according to [Rouch and Kao, 1980]. Default is False.

Returns:
resultsross.UCSResults

For more information on attributes and methods available see: ross.UCSResults

run_unbalance_response(node, unbalance_magnitude, unbalance_phase, speed_range=None, modes=None)#

Unbalanced response for a mdof system.

This method returns the unbalanced response for a mdof system given magnitide and phase of the unbalance, the node where it’s applied and a frequency range.

Available plotting methods:

.plot() .plot_magnitude() .plot_phase() .plot_polar_bode() .plot_deflected_shape() .plot_bending_moment() .plot_deflected_shape_3d() .plot_deflected_shape_2d()

Parameters:
nodelist, int

Node where the unbalance is applied.

unbalance_magnitudelist, float, pint.Quantity

Unbalance magnitude (kg.m).

unbalance_phaselist, float, pint.Quantity

Unbalance phase (rad).

speed_rangelist, pint.Quantity

List with the desired range of rotor speeds (rad/s). The unbalance excitation is synchronous, so each speed is also the excitation frequency. Default is 0 to 1.5 x highest damped natural frequency.

modeslist, optional

Modes that will be used to calculate the frequency response (all modes will be used if a list is not given).

Returns:
resultsross.ForcedResponseResults

For more information on attributes and methods available see: ross.ForcedResponseResults

See also

ross.utils.speed_range_from_endpoints

Build speed_range from its end points, each one in any speed unit, with a number of points that grows with the range.

Examples

>>> import ross as rs
>>> rotor = rs.rotor_example()
>>> speed = np.linspace(0, 1000, 101)
>>> response = rotor.run_unbalance_response(node=3,
...                                         unbalance_magnitude=10.0,
...                                         unbalance_phase=0.0,
...                                         speed_range=speed)

Return the response amplitude >>> abs(response.forced_resp) # doctest: +ELLIPSIS array([[0.00000000e+00, 5.06073311e-04, 2.10044826e-03, …

Return the response phase >>> np.angle(response.forced_resp) # doctest: +ELLIPSIS array([[ 0. , 0. , 0. , …

plot unbalance response: >>> probe_node = 3 >>> probe_angle = np.pi / 2 >>> probe_tag = “my_probe” # optional >>> fig = response.plot(probe=[rs.Probe(probe_node, probe_angle, tag=probe_tag)])

plot response for major or minor axis: >>> probe_node = 3 >>> probe_angle = “major” # for major axis >>> # probe_angle = “minor” # for minor axis >>> probe_tag = “my_probe” # optional >>> fig = response.plot(probe=[rs.Probe(probe_node, probe_angle, tag=probe_tag)])

To plot velocity and acceleration responses, you must change amplitude_units from “[length]” units to “[length]/[time]” or “[length]/[time] ** 2” respectively Plotting velocity response >>> fig = response.plot( … probe=[rs.Probe(probe_node, probe_angle)], … amplitude_units=”m/s” … )

Plotting acceleration response >>> fig = response.plot( … probe=[rs.Probe(probe_node, probe_angle)], … amplitude_units=”m/s**2” … )

Plotting deflected shape configuration Speed value must be in speed_range. >>> value = 600 >>> fig = response.plot_deflected_shape(speed=value)

run_with_motor(t, node, unbalance_magnitude, unbalance_phase, drive_mode, load_torque_entrance_time=None, load_torque_ratio=1.0, ac_source_harmonics=None, ac_source_unbalances=None, time_step=None, time_ramp=0.6667, frequency_ref=None, steady_state=True, F=None, verbose=False, **kwargs)#

Run time response with electric motor torque at the motor node.

The motor is simulated independently and its electromagnetic torque (electric torque minus load torque) is applied to the torsional DOF at the motor node. Shaft speed is taken from the motor simulation, so the unbalance force is time-varying. The motor does not contribute to the rotor global structural matrices.

Available plotting methods:

.plot_1d() .plot_2d() .plot_3d() .plot_dfft()

Parameters:
tarray

Time array.

nodelist, int

Nodes where the unbalance is applied.

unbalance_magnitudelist, float, pint.Quantity

Unbalance magnitude (kg.m) for each node.

unbalance_phaselist, float, pint.Quantity

Unbalance phase (rad) for each node.

drive_modestr

Run motor with:

  • 'DOL': direct-on-line start.

  • 'VFD_VF': variable frequency drive with open-loop V/f adjustment technique.

  • 'VFD_FOC': variable frequency drive with closed-loop field-oriented control.

load_torque_entrance_timefloat, pint.Quantity, optional

Time when load torque is applied to the motor shaft [s]. Default is half the simulation time.

load_torque_ratiofloat, optional

Load torque ratio applied at the entrance time. This is a multiplier for the rated load torque, e.g., a value of 1.0 applies 100% of the rated torque at entrance time. Default is 1.0.

ac_source_harmonicsdict, optional

Configuration for grid harmonic injection. Active only when drive_mode=’DOL’. Expected keys:

  • 'enable' (bool): enable harmonics.

  • 'orders' (list of int): harmonic orders (e.g., [5, 7, 11] for 5th, 7th, and 11th harmonics).

  • 'amplitudes' (list of float): harmonic amplitudes as percentage of rated voltage (e.g., [10, 5, 2] for 10%, 5%, and 2%).

ac_source_unbalancesdict, optional

Configuration for three-phase grid unbalance. Active only when drive_mode=’DOL’. Expected keys:

  • 'enable' (bool): enable unbalances.

  • 'voltage_percent' (list of float): voltage magnitude deviation per phase (A, B, C) relative to rated [%]. Must contain exactly 3 elements. Positive → higher voltage; Negative → lower voltage.

  • 'angle_deviation' (list of float, pint.Quantity): angle deviation per phase (A, B, C) [rad]. Must contain exactly 3 elements.

time_stepfloat, pint.Quantity, optional

Time step [s] for numerical integration of the motor model. Active only when drive_mode is 'VFD_VF' or 'VFD_FOC'. Default is None, which uses the inverter switching period / 200.

time_rampfloat, pint.Quantity, optional

Acceleration ramp time [s] for frequency ramping. Active only when drive_mode is 'VFD_VF' or 'VFD_FOC'. Default is 0.6667.

frequency_reffloat, pint.Quantity, optional

Electrical frequency reference [rad/s]. Used as the V/f reference when drive_mode=’VFD_VF’ and as the synchronous frequency reference when drive_mode=’VFD_FOC’. Active only when drive_mode is 'VFD_VF' or 'VFD_FOC'. Default is None, which uses half the motor rated frequency.

steady_statebool, optional

If True (default), only the last third of the interval after load_torque_entrance_time is integrated, skipping the motor start-up and the load transient. The rotor starts from rest at the start of that window, so the response begins with a new lateral transient; use False, or a longer t, when the response amplitudes matter. If False, the full time array is used.

Farray, optional

Force array (needs to have the same number of rows as time array). Each column corresponds to a dof and each row to a time.

verbosebool, optional

If True, print the main stages of the simulation. Default is False.

**kwargsoptional

Additional keyword arguments passed to the Newmark integrator (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to Rotor.integrate_system (e.g. model_reduction, add_to_RHS).

Returns:
resultsross.TimeResponseResults

Time response of the rotor. The motor simulation is stored in results.motor_results (ross.MotorResponseResults). For more information on attributes and methods available see: ross.TimeResponseResults

Notes

For 'VFD_VF' and 'VFD_FOC', the inverter switching frequency is fixed at 5 kHz.

Examples

>>> import ross as rs
>>> from ross.probe import Probe
>>> motor = rs.motor_example()
>>> rotor = rs.rotor_example().add_elements([motor])
>>> n1 = rotor.disk_elements[0].n
>>> n2 = rotor.disk_elements[1].n
>>> results = rotor.run_with_motor(
...     t=np.linspace(0, 1, 1000),
...     node=[n1, n2],
...     unbalance_magnitude=[5e-4, 0],
...     unbalance_phase=[-np.pi / 2, 0],
...     drive_mode="DOL",
...     load_torque_entrance_time=0.5,
... )
Running direct method...
>>> fig1 = results.plot_1d(probe=[Probe(n1, 0)])
>>> fig2 = results.motor_results.plot_speed()
save(file)#

Save the rotor to a .toml or .json file.

This method persists the rotor’s parameters and all element data (including pre-computed coefficients) to a file. When the rotor is loaded back, element coefficients are restored directly from the file without recomputation. This means that manually editing values in the saved file will NOT trigger recalculation of dependent quantities. To modify the rotor, change parameters in Python and save again.

Parameters:
filestr or pathlib.Path

The format is determined by the file extension (.toml or .json).

Examples

>>> from tempfile import tempdir
>>> from pathlib import Path
>>> # create path for temporary file
>>> file = Path(tempdir) / 'rotor.toml'
>>> rotor = rotor_example()
>>> rotor.save(file)
save_mat(file, speed, frequency=None)#

Save matrices and rotor model to a .mat file.

Parameters:
filestr, pathlib.Path
speed: float

Rotor speed.

frequency: float, optional

Excitation (whirl) frequency at which frequency-dependent coefficients are evaluated. Default is rotor speed (synchronous evaluation).

Examples

>>> from tempfile import tempdir
>>> from pathlib import Path
>>> # create path for temporary file
>>> file = Path(tempdir) / 'new_matrices'
>>> rotor = rotor_example()
>>> rotor.save_mat(file, speed=0)
set_tag(tag)#

Set the tag for the current rotor.

summary()#

Plot the rotor summary.

This functioncreates a summary of the main parameters and attributes of the rotor model. The data is presented in a table format.

Returns:
resultsross.SummaryResults class

An instance of SumarryResults class to build the summary table

Examples

>>> rotor = rotor_example()
>>> table = rotor.summary().plot()
>>> # to display the plot use the command:
>>> # show(table)
time_response(speed, F, t, ic=None, method='default', **kwargs)#

Time response for a rotor.

This method returns the time response for a rotor given a force, time and initial conditions.

Parameters:
speedfloat or array_like

Rotor speed. Automatically, the Newmark method is chosen if speed has an array_like type.

Farray

Force array (needs to have the same length as time array).

tarray

Time array. (must have the same length than lti.B matrix)

icarray, optional

The initial conditions on the state vector (zero by default).

methodstr, optional

The Newmark method can be chosen by setting method=’newmark’.

**kwargsoptional

Additional keyword arguments can be passed to define the parameters of the Newmark method if it is used (e.g. gamma, beta, tol, …). See ross.utils.newmark for more details. Other keyword arguments can also be passed to be used in numerical integration (e.g. model_reduction, add_to_RHS). See Rotor.integrate_system for more details.

Returns:
tarray

Time values for the output.

youtarray

System response.

xoutarray

Time evolution of the state vector.

Examples

>>> rotor = rotor_example()
>>> speed = 0
>>> size = 28
>>> t = np.linspace(0, 5, size)
>>> F = np.ones((size, rotor.ndof))
>>> rotor.time_response(speed, F, t)
(array([0.        , 0.18518519, 0.37037037, ...
classmethod to_ross_only(rotor)#

Convert a rotor object to a ross-only rotor object.

This method removes any non-ross elements from the rotor object and returns a new ross.Rotor instance.

Parameters:
rotorross.Rotor

The rotor object to be converted.

Returns:
ross.Rotor

A new ross.Rotor instance with only ross elements.

transfer_matrix(speed=None, frequency=None, modes=None)#

Calculate the transfer matrix for the frequency response function (FRF).

The dynamic stiffness is evaluated at the excitation frequency, with the gyroscopic matrix multiplied by speed. Speed-dependent bearing and seal coefficients are evaluated at speed and frequency-dependent ones at frequency.

Parameters:
speedfloat

Rotor speed.

frequencyfloat, optional

Excitation frequency. Default is rotor speed (synchronous excitation).

Returns:
Hmatrix

System transfer matrix

unbalance_force_over_time(node, magnitude, phase, omega, t, return_all=False)#

Calculate unbalance forces for each time step.

This auxiliary function calculates the unbalanced forces by taking into account the magnitude and phase of the force. It generates an array of force values at each degree of freedom for the specified nodes at each time step, while also considering a range of frequencies.

Parameters:
nodelist, int

Nodes where the unbalance is applied.

magnitudelist, float

Unbalance magnitude (kg.m) for each node.

phaselist, float

Unbalance phase (rad) for each node.

omegafloat, np.darray

Constant velocity or desired range of velocities (rad/s).

tnp.darray

Time array (s).

return_allbool, optional

If True, returns F0, theta, omega, and alpha. If False, returns only F0. Default is False.

Returns:
F0np.ndarray

Unbalance force at each degree of freedom for each time step.

thetanp.ndarray

Angular positions for each time step.

omeganp.ndarray

Angular velocities for each time step.

alphanp.ndarray

Angular accelerations for each time step.

Examples

>>> rotor = rotor_example()
>>> t = np.linspace(0, 10, 31)
>>> omega = np.linspace(0, 1000, 31)
>>> F = rotor.unbalance_force_over_time([3], [10.0], [0.0], omega, t)
>>> F[18, :3]
array([     0.        ,   7632.15353293, -43492.18127561])

Attributes