Skip to content

Commit

Permalink
Subsystem symmetrical case edits
Browse files Browse the repository at this point in the history
-edits to subsystem static solve and setOffset for symmetrical cases (where only half of the cable is modeled)
  • Loading branch information
erickaloz committed Aug 21, 2024
1 parent b5b9305 commit a45e960
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,13 @@ def staticSolve(self, reset=False, tol=0, profiles=0):
dr = self.rB - self.rA
LH = np.hypot(dr[0], dr[1]) # horizontal spacing of line ends
LV = dr[2] # vertical rise from end A to B
self.pointList[ 0].setPosition([ -self.span , 0, self.rA[2]])
self.pointList[-1].setPosition([ -self.span+LH, 0, self.rB[2]])

if self.shared:
self.pointList[ 0].setPosition([ -self.span/2 , 0, self.rA[2]])
self.pointList[-1].setPosition([ -self.span/2+LH, 0, self.rB[2]])
else:
self.pointList[ 0].setPosition([ -self.span , 0, self.rA[2]])
self.pointList[-1].setPosition([ -self.span+LH, 0, self.rB[2]])

# get equilibrium
self.solveEquilibrium(tol=tol)

Expand Down Expand Up @@ -466,9 +470,14 @@ def setOffset(self, offset, z=0):
self.revertToStaticStiffness()

# Ensure end A position and set end B position to offset values
self.rA = np.array([-self.span-self.rad_fair, 0, self.rA[2]])
self.rB = np.array([-self.rad_fair + offset, 0, self.z_fair+z])

if self.shared:
self.rA = np.array([-self.span/2-self.rad_fair, 0, self.rA[2]])
self.rB = np.array([-self.rad_fair + offset/2, 0, self.z_fair+z])

else:
self.rA = np.array([-self.span-self.rad_fair, 0, self.rA[2]])
self.rB = np.array([-self.rad_fair + offset, 0, self.z_fair+z])

self.staticSolve(tol=self.eqtol) # solve the subsystem

# Store some values at this offset position that may be used later
Expand Down

0 comments on commit a45e960

Please sign in to comment.