ross.Rotor
Contents
ross.Rotor#
- class ross.Rotor(shaft_elements, disk_elements=None, bearing_elements=None, point_mass_elements=None, min_w=None, max_w=None, rated_w=None, 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
- tagstr
A tag for the rotor
- 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...
- 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.
Methods
- A(speed=0, frequency=None, synchronous=False)#
State space matrix for an instance of a rotor.
- Parameters:
- speed: float, optional
Rotor speed. Default is 0.
- frequencyfloat, optional
Excitation frequency. Default is rotor speed.
- synchronousbool, optional
If True a synchronous analysis is carried out. 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, ignore=[])#
Damping matrix for an instance of a rotor.
- Parameters:
- frequencyfloat
Excitation frequency.
- ignorelist, optional
List of elements to leave out of the matrix.
- 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, ignore=[])#
Stiffness matrix for an instance of a rotor.
- Parameters:
- frequencyfloat, optional
Excitation frequency.
- ignorelist, optional
List of elements to leave out of the matrix.
- 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, synchronous=False)#
Mass matrix for an instance of a rotor.
- Parameters:
- synchronousbool, optional
If True a synchronous analysis is carried out. 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, min_w=None, max_w=None, rated_w=None, tag=None)#
- 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.
- Parameters:
- new_nodes_poslist
List with the position of the new nodes.
- 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
- convergence(n_eigval=0, err_max=0.01)#
Run convergence analysis.
Function to analyze the eigenvalues convergence through the number of shaft elements. Every new run doubles the number os shaft elements.
- Parameters:
- n_eigvalint
The nth eigenvalue which the convergence analysis will run. Default is 0 (the first eigenvalue).
- err_maxfloat
Maximum allowable convergence error. Default is 1e-02
- Returns:
- resultsAn instance of ConvergenceResults class, which is used to post-process
- results. Attributes stored:
- el_numarray
Array with number of elements in each iteraction
- eigv_arrarray
Array with the n’th natural frequency in each iteraction
- error_arrarray
Array with the relative error in each iteraction
- 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.
- 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.
- num_modesint, optional
If num_modes is passed as argument, the pseudo-modal method is applied reducing the model to the chosen number of modes.
- 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.
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 = rotor.integrate_system(speed, F, t) Running direct method >>> yout[:, rotor.number_dof * node + 1] array([0.00000000e+00, 2.07239823e-10, 7.80952429e-10, ..., 1.21848307e-07, 1.21957287e-07, 1.22065778e-07])
- classmethod load(file)#
Load rotor from toml file.
- Parameters:
- filestr or pathlib.Path
String or Path for a .toml file.
- Returns:
- rotorross.rotor.Rotor
- plot_rotor(nodes=1, check_sld=False, length_units='m', **kwargs)#
Plot a rotor object.
This function will take a rotor object and plot its elements representation using Plotly.
- Parameters:
- nodesint, optional
Increment that will be used to plot nodes label.
- 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’.
- 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.
- run_campbell(speed_range, frequencies=6, frequency_type='wd')#
Calculate the Campbell diagram.
This function will calculate the damped natural frequencies for a speed range.
- Available plotting methods:
.plot()
- Parameters:
- speed_rangearray
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”.
- Returns:
- resultsross.CampbellResults
For more information on attributes and methods available see:
ross.CampbellResults
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_crack(**kwargs)#
Run an analyzes with rubbing.
Execute the crack fault and generates the crack object on the back-end.
- Parameters:
- dtfloat
Time step
- tIfloat
Initial time
- tFfloat
Final time
- 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.
- n_crackfloat
Element where the crack is located
- speedfloat, pint.Quantity
Operational speed of the machine. Default unit is rad/s.
- unbalance_magnitudearray
Array with the unbalance magnitude. The unit is kg.m.
- unbalance_phasearray
Array with the unbalance phase. The unit is rad.
- crack_typestring
String containing type of crack model chosed. The avaible types are: Mayes and Gasch.
- print_progressbool
Set it True, to print the time iterations and the total time spent, by default False.
Examples
>>> from ross.probe import Probe >>> from ross.faults.crack import crack_example >>> probe1 = Probe(14, 0) >>> probe2 = Probe(22, 0) >>> response = crack_example() >>> results = response.run_time_response() >>> fig = response.plot_dfft(probe=[probe1, probe2], range_freq=[0, 100], yaxis_type="log") >>> # fig.show()
- 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 frequecies 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
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, cluster_points=False, num_modes=12, num_points=10, rtol=0.005, unbalance=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
Unbalance force in each degree of freedom for each value in omega
- speed_rangelist, array
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.
- cluster_pointsbool, optional
boolean to activate the automatic frequency spacing method. If True, the method uses _clustering_points() to create an speed_range. Default is False
- num_pointsint, optional
The number of points generated per critical speed. The method set the same number of points for slightly less and slightly higher than the natural circular frequency. It means there’ll be num_points greater and num_points smaller than a given critical speed. num_points may be between 2 and 12. Anything above this range defaults to 10 and anything below this range defaults to 4. The default is 10.
- num_modes
The number of eigenvalues and eigenvectors to be calculated using ARPACK. It also defines the range for the output array, since the method generates points only for the critical speed calculated by run_critical_speed(). Default is 12.
- rtolfloat, optional
Tolerance (relative) for termination. Applied to scipy.optimize.newton to calculate the approximated critical speeds. Default is 0.005 (0.5%).
- 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, ...
Using clustered points option. Set cluster_points=True and choose how many modes the method must search and how many points to add just before and after each critical speed.
>>> response = rotor.run_forced_response( ... force=force, cluster_points=True, num_modes=12, num_points=5 ... ) >>> response.speed_range.shape (61,)
- run_freq_response(speed_range=None, modes=None, cluster_points=False, num_modes=12, num_points=10, rtol=0.005)#
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.
- Available plotting methods:
.plot() .plot_magnitude() .plot_phase() .plot_polar_bode()
- Parameters:
- speed_rangearray, optional
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).
- cluster_pointsbool, optional
boolean to activate the automatic frequency spacing method. If True, the method uses _clustering_points() to create an speed_range. Default is False
- num_pointsint, optional
The number of points generated per critical speed. The method set the same number of points for slightly less and slightly higher than the natural circular frequency. It means there’ll be num_points greater and num_points smaller than a given critical speed. num_points may be between 2 and 12. Anything above this range defaults to 10 and anything below this range defaults to 4. The default is 10.
- num_modes
The number of eigenvalues and eigenvectors to be calculated using ARPACK. It also defines the range for the output array, since the method generates points only for the critical speed calculated by run_critical_speed(). Default is 12.
- rtolfloat, optional
Tolerance (relative) for termination. Applied to scipy.optimize.newton to calculate the approximated critical speeds. Default is 0.005 (0.5%).
- Returns:
- resultsross.FrequencyResponseResults
For more information on attributes and methods available see:
ross.FrequencyResponseResults
Examples
>>> import ross as rs >>> rotor = rs.rotor_example() >>> speed = np.linspace(0, 1000, 101) >>> response = rotor.run_freq_response(speed_range=speed)
Return the response amplitude >>> abs(response.freq_resp) # doctest: +ELLIPSIS array([[[1.00000000e-06, 1.00261725e-06, 1.01076952e-06, …
Return the response phase >>> np.angle(response.freq_resp) # doctest: +ELLIPSIS array([[[…
Using clustered points option. Set cluster_points=True and choose how many modes the method must search and how many points to add just before and after each critical speed.
>>> response = rotor.run_freq_response(cluster_points=True, num_points=5) >>> response.speed_range.shape (61,)
Selecting the disirable 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([[[2.00154633e-07, 2.02422522e-07, 2.09522044e-07, …
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_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_misalignment(coupling='flex', **kwargs)#
Run an analyzes with misalignment.
Execute the misalignment fault and generates the misalignment object on the back-end. There are two types of coupling, flexible (flex) and rigid, which have different entries. These entries are provided via **kwargs to the specific method.
- Parameters:
- couplingstr
Coupling type. The avaible types are: flex, by default; and rigid.
- **kwargs: dictionary
- In the case of coupling = “flex”, **kwargs receives:
- dtfloat
Time step.
- tIfloat
Initial time.
- tFfloat
Final time.
- kdfloat
Radial stiffness of flexible coupling.
- ksfloat
Bending stiffness of flexible coupling.
- eCOUPxfloat
Parallel misalignment offset between driving rotor and driven rotor along X direction.
- eCOUPyfloat
Parallel misalignment offset between driving rotor and driven rotor along Y direction.
- misalignment_anglefloat
Angular misalignment angle.
- TDfloat
Driving torque.
- TLfloat
Driven torque.
- n1float
Node where the misalignment is ocurring.
- speedfloat, pint.Quantity
Operational speed of the machine. Default unit is rad/s.
- unbalance_magnitudearray
Array with the unbalance magnitude. The unit is kg.m.
- unbalance_phasearray
Array with the unbalance phase. The unit is rad.
- mis_type: string
String containing the misalignment type choosed. The avaible types are: parallel, by default; angular; combined.
- print_progressbool
Set it True, to print the time iterations and the total time spent. False by default.
- In the case of coupling = “rigid”, **kwargs receives:
- dtfloat
Time step.
- tIfloat
Initial time.
- tFfloat
Final time.
- eCOUPfloat
Parallel misalignment offset between driving rotor and driven rotor along X direction.
- TDfloat
Driving torque.
- TLfloat
Driven torque.
- n1float
Node where the misalignment is ocurring.
- speedfloat, pint.Quantity
Operational speed of the machine. Default unit is rad/s.
- unbalance_magnitudearray
Array with the unbalance magnitude. The unit is kg.m.
- unbalance_phasearray
Array with the unbalance phase. The unit is rad.
- print_progressbool
Set it True, to print the time iterations and the total time spent. False by default.
Examples
>>> from ross.probe import Probe >>> from ross.faults.misalignment import misalignment_flex_parallel_example >>> probe1 = Probe(14, 0) >>> probe2 = Probe(22, 0) >>> response = misalignment_flex_parallel_example() >>> results = response.run_time_response() >>> fig = response.plot_dfft(probe=[probe1, probe2], range_freq=[0, 100], yaxis_type="log") >>> # fig.show()
- run_rubbing(**kwargs)#
Run an analyzes with rubbing.
Execute the rubbing fault and generates the rubbing object on the back-end.
- Parameters:
- **kwargs: dictionary
- **kwargs receives:
- dtfloat
Time step.
- tIfloat
Initial time.
- tFfloat
Final time.
- deltaRUBfloat
Distance between the housing and shaft surface.
- kRUBfloat
Contact stiffness.
- cRUBfloat
Contact damping.
- miRUBfloat
Friction coefficient.
- posRUBint
Node where the rubbing is ocurring.
- speedfloat, pint.Quantity
Operational speed of the machine. Default unit is rad/s.
- unbalance_magnitudearray
Array with the unbalance magnitude. The unit is kg.m.
- unbalance_phasearray
Array with the unbalance phase. The unit is rad.
- torquebool
Set it as True to consider the torque provided by the rubbing, by default False.
- print_progressbool
Set it True, to print the time iterations and the total time spent, by default False.
Examples
>>> from ross.probe import Probe >>> from ross.faults.rubbing import rubbing_example >>> probe1 = Probe(14, 0) >>> probe2 = Probe(22, 0) >>> response = rubbing_example() >>> results = response.run_time_response() >>> fig = response.plot_dfft(probe=[probe1, probe2], range_freq=[0, 100], yaxis_type="log") >>> # fig.show()
- 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()
- 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.
- 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
- 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
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. num_modes, add_to_RHS). See Rotor.integrate_system for more details.
- Returns:
- resultsross.TimeResponseResults
For more information on attributes and methods available see:
ross.TimeResponseResults
Examples
>>> from ross.probe import Probe >>> rotor = rotor_example() >>> speed = 500.0 >>> size = 1000 >>> node = 3 >>> probe1 = Probe(3, 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) >>> response = rotor.run_time_response(speed, F, t) >>> response.yout[:, rotor.number_dof * node + 1] array([ 0.00000000e+00, 1.86686693e-07, 8.39130663e-07, ... >>> # 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()
- run_ucs(stiffness_range=None, bearing_frequency_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 withbase ** stop
(see endpoint below). Here base is 10.0.- bearing_frequency_rangetuple, optional
The bearing frequency 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 frequency attribute 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 []. 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, frequency=None, modes=None, cluster_points=False, num_modes=12, num_points=10, rtol=0.005)#
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).
- frequencylist, pint.Quantity
List with the desired range of frequencies (rad/s).
- modeslist, optional
Modes that will be used to calculate the frequency response (all modes will be used if a list is not given).
- cluster_pointsbool, optional
boolean to activate the automatic frequency spacing method. If True, the method uses _clustering_points() to create an speed_range. Default is False
- num_pointsint, optional
The number of points generated per critical speed. The method set the same number of points for slightly less and slightly higher than the natural circular frequency. It means there’ll be num_points greater and num_points smaller than a given critical speed. num_points may be between 2 and 12. Anything above this range defaults to 10 and anything below this range defaults to 4. The default is 10.
- num_modes
The number of eigenvalues and eigenvectors to be calculated using ARPACK. It also defines the range for the output array, since the method generates points only for the critical speed calculated by run_critical_speed(). Default is 12.
- rtolfloat, optional
Tolerance (relative) for termination. Applied to scipy.optimize.newton to calculate the approximated critical speeds. Default is 0.005 (0.5%).
- Returns:
- resultsross.ForcedResponseResults
For more information on attributes and methods available see:
ross.ForcedResponseResults
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, ... frequency=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.00000000e+00, …
Using clustered points option. Set cluster_points=True and choose how many modes the method must search and how many points to add just before and after each critical speed.
>>> response2 = rotor.run_unbalance_response( ... node=3, unbalance_magnitude=0.01, unbalance_phase=0.0, cluster_points=True, num_points=5 ... ) >>> response2.speed_range.shape (61,)
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)
- save(file)#
Save the rotor to a .toml file.
- Parameters:
- filestr or pathlib.Path
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 frequency. Default is rotor speed.
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)
- 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. num_modes, 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 rotor with rsxl objects to ross only.
- transfer_matrix(speed=None, frequency=None, modes=None)#
Calculate the fer matrix for the frequency response function (FRF).
- Returns:
- Hmatrix
System transfer matrix
Attributes