@@ -245,6 +245,96 @@ def test_spfr_weaver_gere_1(self):
245245 # # ax.set_title('Shear forces')
246246 # plots.show(m)
247247
248+ def test_weaver_1 (self ):
249+ """
250+ Created on 01/20/2025
251+
252+ Weaver Jr., W., Computer Programs for Structural Analysis, page 146,
253+ problem 8. From: STAAD.Pro 2023.00.03
254+ """
255+
256+ from numpy .linalg import norm
257+ from pystran import model
258+ from pystran import section
259+ from pystran import plots
260+
261+ # US customary units, inches, pounds, seconds
262+ L = 120.0
263+ E = 30000
264+ G = E / (2 * (1 + 0.3 ))
265+ A = 11
266+ Iz = 56
267+ Iy = 56
268+ Ix = 83
269+ J = Ix # Torsional constant
270+ F = 2
271+ P = 1
272+ M = 120
273+
274+ m = model .create (3 )
275+
276+ model .add_joint (m , 3 , [0.0 , 0.0 , 0.0 ])
277+ model .add_joint (m , 1 , [0.0 , L , 0.0 ])
278+ model .add_joint (m , 2 , [2 * L , L , 0.0 ])
279+ model .add_joint (m , 4 , [3 * L , 0.0 , L ])
280+
281+ model .add_support (m ["joints" ][3 ], model .CLAMPED )
282+ model .add_support (m ["joints" ][4 ], model .CLAMPED )
283+
284+ xz_vector = [1 , 0 , 0 ]
285+ sect_1 = section .beam_3d_section (
286+ "sect_1" , E = E , G = G , A = A , Ix = Ix , Iy = Iy , Iz = Iz , J = J , xz_vector = xz_vector
287+ )
288+ model .add_beam_member (m , 1 , [3 , 1 ], sect_1 )
289+ xz_vector = [0 , 1 , 0 ]
290+ sect_2 = section .beam_3d_section (
291+ "sect_2" , E = E , G = G , A = A , Ix = Ix , Iy = Iy , Iz = Iz , J = J , xz_vector = xz_vector
292+ )
293+ model .add_beam_member (m , 2 , [1 , 2 ], sect_2 )
294+ model .add_beam_member (m , 3 , [2 , 4 ], sect_2 )
295+
296+ model .add_load (m ["joints" ][1 ], model .U1 , F )
297+ model .add_load (m ["joints" ][2 ], model .U2 , - P )
298+ model .add_load (m ["joints" ][2 ], model .UR3 , - M )
299+
300+ model .number_dofs (m )
301+
302+ # print("Number of free degrees of freedom = ", m["nfreedof"])
303+ # print("Number of all degrees of freedom = ", m["ntotaldof"])
304+
305+ # print([j['dof'] for j in m['joints'].values()])
306+
307+ model .solve (m )
308+
309+ for jid in [1 , 2 ]:
310+ j = m ["joints" ][jid ]
311+ print (jid , j ["displacements" ])
312+
313+ # print(m['K'][0:m['nfreedof'], 0:m['nfreedof']])
314+
315+ # print(m['U'][0:m['nfreedof']])
316+
317+ # 0.22267 0.00016 -0.17182 -0.00255 0.00217 -0.00213
318+ # 0.22202 -0.48119 -0.70161 -0.00802 0.00101 -0.00435
319+ ref1 = [0.22267 , 0.00016 , - 0.17182 , - 0.00255 , 0.00217 , - 0.00213 ]
320+ if norm (m ["joints" ][1 ]["displacements" ] - ref1 ) > 1.0e-1 * norm (ref1 ):
321+ raise ValueError ("Displacement calculation error" )
322+ else :
323+ print ("Displacement calculation OK" )
324+ ref2 = [0.22202 , - 0.48119 , - 0.70161 , - 0.00802 , 0.00101 , - 0.00435 ]
325+ if norm (m ["joints" ][2 ]["displacements" ] - ref2 ) > 1.0e-1 * norm (ref2 ):
326+ raise ValueError ("Displacement calculation error" )
327+ else :
328+ print ("Displacement calculation OK" )
329+
330+ # plots.plot_setup(m)
331+ # plots.plot_members(m)
332+ # # plots.plot_member_numbers(m)
333+ # plots.plot_deformations(m, 30.0)
334+ # # ax = plots.plot_shear_forces(m, scale=0.50e-3)
335+ # # ax.set_title('Shear forces')
336+ # plots.show(m)
337+
248338
249339def main ():
250340 unittest .main ()
0 commit comments