Skip to content

Commit

Permalink
Fix summary plot
Browse files Browse the repository at this point in the history
  • Loading branch information
jguarato committed Apr 8, 2024
1 parent dacb9eb commit a3d88d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 3 additions & 6 deletions ross/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -4071,14 +4071,11 @@ class SummaryResults(Results):
The figure object with the tables plot.
"""

def __init__(
self, df_shaft, df_disks, df_bearings, nodes_pos, brg_forces, CG, Ip, tag
):
def __init__(self, df_shaft, df_disks, df_bearings, brg_forces, CG, Ip, tag):
self.df_shaft = df_shaft
self.df_disks = df_disks
self.df_bearings = df_bearings
self.brg_forces = brg_forces
self.nodes_pos = np.array(nodes_pos)
self.CG = CG
self.Ip = Ip
self.tag = tag
Expand Down Expand Up @@ -4127,7 +4124,7 @@ def plot(self):
"Tag": self.df_disks["tag"],
"Shaft number": self.df_disks["shaft_number"],
"Node": self.df_disks["n"],
"Nodal Position": self.nodes_pos[self.df_bearings["n"]],
"Nodal Position": self.df_disks["nodes_pos_l"],
"Mass": self.df_disks["m"].map("{:.3f}".format),
"Ip": self.df_disks["Ip"].map("{:.3e}".format),
}
Expand All @@ -4137,7 +4134,7 @@ def plot(self):
"Shaft number": self.df_bearings["shaft_number"],
"Node": self.df_bearings["n"],
"N_link": self.df_bearings["n_link"],
"Nodal Position": self.nodes_pos[self.df_bearings["n"]],
"Nodal Position": self.df_bearings["nodes_pos_l"],
"Bearing force": list(self.brg_forces.values()),
}

Expand Down
7 changes: 6 additions & 1 deletion ross/rotor_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -2957,13 +2957,18 @@ def summary(self):
>>> # to display the plot use the command:
>>> # show(table)
"""
self.df_disks = pd.merge(
self.df_disks, self.df[["tag", "nodes_pos_l"]], on="tag", how="left"
)
self.df_bearings = pd.merge(
self.df_bearings, self.df[["tag", "nodes_pos_l"]], on="tag", how="left"
)
self.run_static()
forces = self.bearing_forces_tag
results = SummaryResults(
self.df_shaft,
self.df_disks,
self.df_bearings,
self.nodes_pos,
forces,
self.CG,
self.Ip,
Expand Down

0 comments on commit a3d88d5

Please sign in to comment.