From 69b8695ce86dcfa3b6df037f4411a24be0a054e0 Mon Sep 17 00:00:00 2001 From: Lucas-Carmo Date: Mon, 30 Dec 2024 12:57:06 -0700 Subject: [PATCH] Fixed bug in model.analyzeUnloaded() introduced by previous commit Cannot call fowt.calcTurbineConstants() if not analyzing a `case`, which happens when we call model.analyzeUnloaded() --- raft/raft_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raft/raft_model.py b/raft/raft_model.py index 0146e88..09a4fab 100644 --- a/raft/raft_model.py +++ b/raft/raft_model.py @@ -525,7 +525,8 @@ def solveStatics(self, case, display=0): X_initial[6*i:6*i+6] = np.array([fowt.x_ref, fowt.y_ref,0,0,0,0]) fowt.setPosition(X_initial[6*i:6*i+6]) # zero platform offsets - fowt.calcTurbineConstants(case, ptfm_pitch=0) # for turbine forces >>> still need to update to use current fowt pose <<< + if case: + fowt.calcTurbineConstants(case, ptfm_pitch=0) # for turbine forces >>> still need to update to use current fowt pose <<< fowt.calcStatics() # Recompute statics because turbine heading may have changed due to yaw control if statics_mod == 0: