Skip to content

Commit

Permalink
Subsystem stiffness calc set to analytic
Browse files Browse the repository at this point in the history
- Subsystem.staticSolve mistakenly used the finite-difference
  coupled stiffness method. Now it uses analytic. Should be
  faster and more robust.
- In System.addBody, added DOFs parameter.
  • Loading branch information
mattEhall committed Jul 11, 2024
1 parent 344d229 commit bfc0b34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def staticSolve(self, reset=False, tol=0, profiles=0):
self.solveEquilibrium(tol=tol)

# get 2D stiffness matrices of end points
K = self.getCoupledStiffness()
K = self.getCoupledStiffnessA()

# transform coordinates and forces back into global frame
if LH > 0:
Expand Down
6 changes: 4 additions & 2 deletions moorpy/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __init__(self, file="", dirname="", rootname="", depth=0, rho=1025, g=9.81,
rod.loadData(dirname, rootname, sep='_')


def addBody(self, mytype, r6, m=0, v=0, rCG=np.zeros(3), AWP=0, rM=np.zeros(3), f6Ext=np.zeros(6)):
def addBody(self, mytype, r6, m=0, v=0, rCG=np.zeros(3), AWP=0,
rM=np.zeros(3), f6Ext=np.zeros(6), DOFs=[0,1,2,3,4,5]):
'''Convenience function to add a Body to a mooring system
Parameters
Expand Down Expand Up @@ -172,7 +173,8 @@ def addBody(self, mytype, r6, m=0, v=0, rCG=np.zeros(3), AWP=0, rM=np.zeros(3),
'''

self.bodyList.append( Body(self, len(self.bodyList)+1, mytype, r6, m=m, v=v, rCG=rCG, AWP=AWP, rM=rM, f6Ext=f6Ext) )
self.bodyList.append( Body(self, len(self.bodyList)+1, mytype, r6, m=m,
v=v, rCG=rCG, AWP=AWP, rM=rM, f6Ext=f6Ext, DOFs=DOFs) )

# handle display message if/when MoorPy is reorganized by classes

Expand Down

0 comments on commit bfc0b34

Please sign in to comment.