Skip to content

Commit

Permalink
Merge pull request #1047 from jguarato/fix-summary-plot
Browse files Browse the repository at this point in the history
Fix summary plot
  • Loading branch information
raphaeltimbo authored Apr 11, 2024
2 parents 0129230 + 5f2b930 commit 0db1f49
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 @@ -4103,14 +4103,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 @@ -4159,7 +4156,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 @@ -4169,7 +4166,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 @@ -3008,13 +3008,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 0db1f49

Please sign in to comment.