ross.SummaryResults
Contents
ross.SummaryResults#
- class ross.SummaryResults(df_shaft, df_disks, df_bearings, brg_forces, CG, Ip, tag)#
Class used to store results and provide plots rotor summary.
This class aims to present a summary of the main parameters and attributes from a rotor model. The data is presented in a table format.
- Parameters:
- df_shaft: dataframe
shaft dataframe
- df_disks: dataframe
disks dataframe
- df_bearings: dataframe
bearings dataframe
- brg_forces: list
list of reaction forces on bearings
- nodes_pos: list
list of nodes axial position
- CG: float
rotor center of gravity
- Ip: float
rotor total moment of inertia around the center line
- tag: str
rotor’s tag
- Returns:
- figPlotly graph_objects.make_subplots()
The figure object with the tables plot.
Methods
- __init__(df_shaft, df_disks, df_bearings, brg_forces, CG, Ip, tag)#
- 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()#
Plot the summary table.
- This method plots:
Table with summary of rotor parameters and attributes
- Returns:
- figPlotly graph_objects.make_subplots()
The figure object with the tables 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)