ross.StaticResults#

class ross.StaticResults(deformation, Vx, Bm, w_shaft, disk_forces, bearing_forces, nodes, nodes_pos, Vx_axis)#

Class used to store results and provide plots for Static Analysis.

This class plots free-body diagram, deformed shaft, shearing force diagram and bending moment diagram.

Parameters:
deformationarray

shaft displacement in y direction.

Vxarray

shearing force array.

Bmarray

bending moment array.

w_shaftdataframe

shaft dataframe

disk_forcesdict

Indicates the force exerted by each disk.

bearing_forcesdict

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

nodeslist

list of nodes numbers.

nodes_poslist

list of nodes positions.

Vx_axisarray

X axis for displaying shearing force and bending moment.

Returns:
figPlotly graph_objects.Figure()

Plotly figure with Static Analysis plots depending on which method is called.

Methods

__init__(deformation, Vx, Bm, w_shaft, disk_forces, bearing_forces, nodes, nodes_pos, Vx_axis)#
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_bending_moment(moment_units='N*m', rotor_length_units='m', fig=None, **kwargs)#

Plot the rotor bending moment diagram.

This method plots:

bending moment diagram.

Parameters:
moment_unitsstr, optional

Moment units. Default is ‘N*m’.

rotor_length_unitsstr

Rotor Length units. Default is ‘m’.

figPlotly graph_objects.Figure()

Plotly figure with the bending moment diagram plot

Returns:
figPlotly graph_objects.Figure()

Plotly figure with the bending moment diagram plot

plot_deformation(deformation_units='m', rotor_length_units='m', fig=None, **kwargs)#

Plot the shaft static deformation.

This method plots:

deformed shaft

Parameters:
deformation_unitsstr

Deformation units. Default is ‘m’.

rotor_length_unitsstr

Rotor Length units. Default is ‘m’.

figPlotly graph_objects.Figure()

The figure object with the plot.

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_free_body_diagram(force_units='N', rotor_length_units='m', fig=None, **kwargs)#

Plot the rotor free-body diagram.

Parameters:
force_unitsstr

Force units. Default is ‘N’.

rotor_length_unitsstr

Rotor Length units. Default is ‘m’.

subplotsPlotly graph_objects.make_subplots()

The figure object with the plot.

kwargsoptional

Additional key word arguments can be passed to change the plot layout only (e.g. plot_bgcolor=”white”, …). *See Plotly Python make_subplot Reference for more information.

Returns:
subplotsPlotly graph_objects.make_subplots()

The figure object with the plot.

plot_shearing_force(force_units='N', rotor_length_units='m', fig=None, **kwargs)#

Plot the rotor shearing force diagram.

This method plots:

shearing force diagram.

Parameters:
force_unitsstr

Force units. Default is ‘N’.

rotor_length_unitsstr

Rotor Length units. Default is ‘m’.

figPlotly graph_objects.Figure()

The figure object with the plot.

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)