Skip to content

Commit 0c58402

Browse files
JWock82JWock82
authored andcommitted
Corrected reaction calculations for nodal springs
1 parent b7593f7 commit 0c58402

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

Pynite/Analysis.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -899,42 +899,30 @@ def _calc_reactions(model: FEModel3D, log: bool = False, combo_tags: List[str] |
899899
node.RxnMZ[combo.name] -= load[1]*factor
900900

901901
# Calculate any reactions due to active spring supports at the node
902-
if node.spring_DX[0] != None and node.spring_DX[2] is True:
903-
sign = node.spring_DX[1]
902+
if node.spring_DX[0] is not None and node.spring_DX[2] is True:
904903
k = node.spring_DX[0]
905-
if sign != None: k = float(sign + str(k))
906904
DX = node.DX[combo.name]
907-
node.RxnFX[combo.name] += k*DX
908-
if node.spring_DY[0] != None and node.spring_DY[2] is True:
909-
sign = node.spring_DY[1]
905+
node.RxnFX[combo.name] -= k*DX
906+
if node.spring_DY[0] is not None and node.spring_DY[2] is True:
910907
k = node.spring_DY[0]
911-
if sign != None: k = float(sign + str(k))
912908
DY = node.DY[combo.name]
913-
node.RxnFY[combo.name] += k*DY
914-
if node.spring_DZ[0] != None and node.spring_DZ[2] is True:
915-
sign = node.spring_DZ[1]
909+
node.RxnFY[combo.name] -= k*DY
910+
if node.spring_DZ[0] is not None and node.spring_DZ[2] is True:
916911
k = node.spring_DZ[0]
917-
if sign != None: k = float(sign + str(k))
918912
DZ = node.DZ[combo.name]
919-
node.RxnFZ[combo.name] += k*DZ
920-
if node.spring_RX[0] != None and node.spring_RX[2] is True:
921-
sign = node.spring_RX[1]
913+
node.RxnFZ[combo.name] -= k*DZ
914+
if node.spring_RX[0] is not None and node.spring_RX[2] is True:
922915
k = node.spring_RX[0]
923-
if sign != None: k = float(sign + str(k))
924916
RX = node.RX[combo.name]
925-
node.RxnMX[combo.name] += k*RX
926-
if node.spring_RY[0] != None and node.spring_RY[2] is True:
927-
sign = node.spring_RY[1]
917+
node.RxnMX[combo.name] -= k*RX
918+
if node.spring_RY[0] is not None and node.spring_RY[2] is True:
928919
k = node.spring_RY[0]
929-
if sign != None: k = float(sign + str(k))
930920
RY = node.RY[combo.name]
931-
node.RxnMY[combo.name] += k*RY
932-
if node.spring_RZ[0] != None and node.spring_RZ[2] is True:
933-
sign = node.spring_RZ[1]
921+
node.RxnMY[combo.name] -= k*RY
922+
if node.spring_RZ[0] is not None and node.spring_RZ[2] is True:
934923
k = node.spring_RZ[0]
935-
if sign != None: k = float(sign + str(k))
936924
RZ = node.RZ[combo.name]
937-
node.RxnMZ[combo.name] += k*RZ
925+
node.RxnMZ[combo.name] -= k*RZ
938926

939927

940928
def _check_statics(model: FEModel3D, combo_tags: List[str] | None = None) -> None:

0 commit comments

Comments
 (0)