Skip to content

Commit

Permalink
Update Analysis.py
Browse files Browse the repository at this point in the history
Obscure bug fix. Reactions are corrected for support springs and rigid supports at the same node at different degrees of freedom.
  • Loading branch information
JWock82 authored Nov 7, 2023
1 parent a40e580 commit 8bcac9f
Showing 1 changed file with 37 additions and 39 deletions.
76 changes: 37 additions & 39 deletions PyNite/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,45 +828,43 @@ def _calc_reactions(model, log=False, combo_tags=None):
elif load[0] == 'MZ':
node.RxnMZ[combo.name] -= load[1]*factor

# Calculate reactions due to active spring supports at the node
else:

if node.spring_DX[0] != None and node.spring_DX[2] == True:
sign = node.spring_DX[1]
k = node.spring_DX[0]
if sign != None: k = float(sign + str(k))
DX = node.DX[combo.name]
node.RxnFX[combo.name] += k*DX
if node.spring_DY[0] != None and node.spring_DY[2] == True:
sign = node.spring_DY[1]
k = node.spring_DY[0]
if sign != None: k = float(sign + str(k))
DY = node.DY[combo.name]
node.RxnFY[combo.name] += k*DY
if node.spring_DZ[0] != None and node.spring_DZ[2] == True:
sign = node.spring_DZ[1]
k = node.spring_DZ[0]
if sign != None: k = float(sign + str(k))
DZ = node.DZ[combo.name]
node.RxnFZ[combo.name] += k*DZ
if node.spring_RX[0] != None and node.spring_RX[2] == True:
sign = node.spring_RX[1]
k = node.spring_RX[0]
if sign != None: k = float(sign + str(k))
RX = node.RX[combo.name]
node.RxnMX[combo.name] += k*RX
if node.spring_RY[0] != None and node.spring_RY[2] == True:
sign = node.spring_RY[1]
k = node.spring_RY[0]
if sign != None: k = float(sign + str(k))
RY = node.RY[combo.name]
node.RxnMY[combo.name] += k*RY
if node.spring_RZ[0] != None and node.spring_RZ[2] == True:
sign = node.spring_RZ[1]
k = node.spring_RZ[0]
if sign != None: k = float(sign + str(k))
RZ = node.RZ[combo.name]
node.RxnMZ[combo.name] += k*RZ
# Calculate any reactions due to active spring supports at the node
if node.spring_DX[0] != None and node.spring_DX[2] == True:
sign = node.spring_DX[1]
k = node.spring_DX[0]
if sign != None: k = float(sign + str(k))
DX = node.DX[combo.name]
node.RxnFX[combo.name] += k*DX
if node.spring_DY[0] != None and node.spring_DY[2] == True:
sign = node.spring_DY[1]
k = node.spring_DY[0]
if sign != None: k = float(sign + str(k))
DY = node.DY[combo.name]
node.RxnFY[combo.name] += k*DY
if node.spring_DZ[0] != None and node.spring_DZ[2] == True:
sign = node.spring_DZ[1]
k = node.spring_DZ[0]
if sign != None: k = float(sign + str(k))
DZ = node.DZ[combo.name]
node.RxnFZ[combo.name] += k*DZ
if node.spring_RX[0] != None and node.spring_RX[2] == True:
sign = node.spring_RX[1]
k = node.spring_RX[0]
if sign != None: k = float(sign + str(k))
RX = node.RX[combo.name]
node.RxnMX[combo.name] += k*RX
if node.spring_RY[0] != None and node.spring_RY[2] == True:
sign = node.spring_RY[1]
k = node.spring_RY[0]
if sign != None: k = float(sign + str(k))
RY = node.RY[combo.name]
node.RxnMY[combo.name] += k*RY
if node.spring_RZ[0] != None and node.spring_RZ[2] == True:
sign = node.spring_RZ[1]
k = node.spring_RZ[0]
if sign != None: k = float(sign + str(k))
RZ = node.RZ[combo.name]
node.RxnMZ[combo.name] += k*RZ

def _check_statics(model, combo_tags=None):
'''
Expand Down

0 comments on commit 8bcac9f

Please sign in to comment.