ross.UCSResults
Contents
ross.UCSResults#
- class ross.UCSResults(stiffness_range, stiffness_log, bearing_frequency_range, wn, bearing, intersection_points, critical_points_modal)#
Class used to store results and provide plots for UCS Analysis.
- Parameters:
- stiffness_rangetuple, optional
Tuple with (start, end) for stiffness range.
- stiffness_logtuple, optional
Evenly numbers spaced evenly on a log scale to create a better visualization (see np.logspace).
- 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.
- wnarray
Undamped natural frequencies array.
- bearingross.BearingElement
Bearing used in the calculation.
- intersection_pointsarray
Points where there is a intersection between undamped natural frequency and the bearing stiffness.
- critical_points_modallist
List with modal results for each critical (intersection) point.
Methods
- __init__(stiffness_range, stiffness_log, bearing_frequency_range, wn, bearing, intersection_points, critical_points_modal)#
- classmethod load(file)#
Load results from a .toml file.
This function will load the simulation results from a .toml file. The file must have all the argument’s names and values that are needed to reinstantiate the class.
- Parameters:
- filestr, pathlib.Path
The name of the file the results will be loaded from.
Examples
>>> # Example running a stochastic unbalance response >>> from tempfile import tempdir >>> from pathlib import Path >>> import ross as rs >>> # Running an example >>> rotor = rs.rotor_example() >>> freq_range = np.linspace(0, 500, 31) >>> n = 3 >>> m = 0.01 >>> p = 0.0 >>> results = rotor.run_unbalance_response(n, m, p, freq_range) >>> # create path for a temporary file >>> file = Path(tempdir) / 'unb_resp.toml' >>> results.save(file) >>> # Loading file >>> results2 = rs.ForcedResponseResults.load(file) >>> abs(results2.forced_resp).all() == abs(results.forced_resp).all() True
- plot(fig=None, stiffness_units='N/m', frequency_units='rad/s', **kwargs)#
Plot undamped critical speed map.
This method will plot the undamped critical speed map 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:
- figPlotly graph_objects.Figure()
The figure object with the plot.
- stiffness_unitsstr, optional
Units for the x axis. Default is N/m.
- frequency_unitsstr, optional
Units for th y axis. Default is rad/s
- 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 plot.
- plot_mode_2d(critical_mode, fig=None, frequency_type='wd', title=None, length_units='m', frequency_units='rad/s', **kwargs)#
Plot (2D view) the mode shape.
- Parameters:
- critical_modeint
The n’th critical mode.
- figPlotly graph_objects.Figure()
The figure object with the plot.
- frequency_typestr, optional
“wd” calculates de map for the damped natural frequencies. “wn” calculates de map for the undamped natural frequencies. Defaults is “wd”.
- titlestr, optional
A brief title to the mode shape plot, it will be displayed above other relevant data in the plot area. It does not modify the figure layout from Plotly.
- length_unitsstr, optional
length units. Default is ‘m’.
- frequency_unitsstr, optional
Frequency units that will be used in the plot title. Default is rad/s.
- 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 plot.
- plot_mode_3d(critical_mode, fig=None, frequency_type='wd', title=None, length_units='m', frequency_units='rad/s', **kwargs)#
Plot (3D view) the mode shapes.
- Parameters:
- critical_modeint
The n’th critical mode. Default is None
- figPlotly graph_objects.Figure()
The figure object with the plot.
- frequency_typestr, optional
“wd” calculates de map for the damped natural frequencies. “wn” calculates de map for the undamped natural frequencies. Defaults is “wd”.
- titlestr, optional
A brief title to the mode shape plot, it will be displayed above other relevant data in the plot area. It does not modify the figure layout from Plotly.
- length_unitsstr, optional
length units. Default is ‘m’.
- frequency_unitsstr, optional
Frequency units that will be used in the plot title. Default is rad/s.
- 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 plot.
- classmethod read_toml_data(data)#
Read and parse data stored in a .toml file.
The data passed to this method needs to be according to the format saved in the .toml file by the .save() method.
- Parameters:
- datadict
Dictionary obtained from toml.load().
- Returns:
- The result object.
- save(file)#
Save results in a .toml file.
This function will save the simulation results to a .toml file. The file will have all the argument’s names and values that are needed to reinstantiate the class.
- Parameters:
- filestr, pathlib.Path
The name of the file the results will be saved in.
Examples
>>> # Example running a unbalance response >>> from tempfile import tempdir >>> from pathlib import Path >>> import ross as rs
>>> # Running an example >>> rotor = rs.rotor_example() >>> speed = np.linspace(0, 1000, 101) >>> response = rotor.run_unbalance_response(node=3, ... unbalance_magnitude=0.001, ... unbalance_phase=0.0, ... frequency=speed)
>>> # create path for a temporary file >>> file = Path(tempdir) / 'unb_resp.toml' >>> response.save(file)