File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
@author: D. Craig Brinck, SE
6
6
"""
7
- from numpy import full
7
+ from numpy import full , array
8
8
9
9
# %%
10
10
# A mathematically continuous beam segment
@@ -138,10 +138,12 @@ def Torsion(self, x = 0):
138
138
# The torsional moment is constant across the segment
139
139
# This can be updated in the future for distributed torsional forces
140
140
141
- if isinstance ( x , ( int , float )):
142
- return self . T1
143
- else :
141
+ #As the return value is not calculated as a function of x (for now), we need to check
142
+ #whether x is an array, and if so, return a results array of the same length
143
+ if isinstance ( x , array ) :
144
144
return full (len (x ), self .T1 )
145
+ else :
146
+ return self .T1
145
147
146
148
def slope (self , x , P_delta = False ):
147
149
"""Returns the slope of the elastic curve at any point `x` along the segment.
You can’t perform that action at this time.
0 commit comments