Skip to content

Commit

Permalink
Bugfix in plot functions
Browse files Browse the repository at this point in the history
We were double counting for fowt position in the array (x_ref, y_ref). This was causing the platform and rotor visualization to be quite far from where they actually are for units not at (0,0)
  • Loading branch information
lucas-carmo committed Sep 19, 2024
1 parent 81697c7 commit 68a615a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions raft/raft_fowt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2100,14 +2100,14 @@ def plot(self, ax, color=None, nodes=0, plot_rotor=True, station_plot=[],
if plot_fowt:
if plot_rotor:
for rotor in self.rotorList:
rotor.plot(ax, r_ptfm=self.r6[:3]+np.array([self.x_ref, self.y_ref, 0]), color=color, airfoils=airfoils, zorder=zorder)
rotor.plot(ax, color=color, airfoils=airfoils, zorder=zorder)

# loop through each member and plot it
for mem in self.memberList:

mem.setPosition() # offsets/rotations could be done in this function rather than in mem.plot <<<

mem.plot(ax, r_ptfm=self.r6[:3]+np.array([self.x_ref, self.y_ref, 0]), R_ptfm=R, color=color,
mem.plot(ax, r_ptfm=self.r6[:3], R_ptfm=R, color=color,
nodes=nodes, station_plot=station_plot, zorder=zorder)

# in future should consider ability to animate mode shapes and also to animate response at each frequency
Expand Down
2 changes: 1 addition & 1 deletion raft/raft_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def calcAero(self, case, current=False, display=0):
return self.f0, self.f, self.a, self.b # B_aero, C_aero, F_aero0, F_aero


def plot(self, ax, r_ptfm=[0,0,0], azimuth=0, color='k',
def plot(self, ax, r_ptfm=np.array([0,0,0]), azimuth=0, color='k',
airfoils=False, draw_circle=False,
plot2d=False, Xuvec=[1,0,0], Yuvec=[0,0,1], zorder=2):
'''Draws the rotor on the passed axes, considering optional platform
Expand Down

0 comments on commit 68a615a

Please sign in to comment.