def test_supported_moment_both(): """Ends supported beam with moment load at both ends.""" M = 500 * 1000 / 2 results = bm.solve( L, (0, L), [bm.MomentLoad(M, 0), bm.MomentLoad(-M, L)], np.ones(L + 1) * E * Ix, np.ones(L + 1) * G * A, np.ones(L + 1) * H / 2, -np.ones(L + 1) * H / 2, False) deflection_bm = results.y[int(L / 2)] deflection_formula = 6 * M * L**2 / (48 * E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005
def test_supported_moment_both(): """Ends supported beam with moment load at both ends.""" M = 500 * 1000 / 2 problem = { 'length': L, 'EI': np.ones(L + 1) * E * Ix, 'GA': np.ones(L + 1) * G * A, 'top': np.ones(L + 1) * H / 2, 'bot': -np.ones(L + 1) * H / 2, 'supports': (0, L), 'shear': False, 'loads': [bm.MomentLoad(M, 0), bm.MomentLoad(-M, L)] } bm.solve(problem) deflection_bm = problem['y'][int(L / 2)] deflection_formula = 6 * M * L**2 / (48 * E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005
def test_clamped_moment_end(): """Begin clamped, moment load at end.""" M = 500 * 1000 results = bm.solve(L, None, bm.MomentLoad(M, pos=L), np.ones(L + 1) * E * Ix, np.ones(L + 1) * G * A, np.ones(L + 1) * H / 2, -np.ones(L + 1) * H / 2, False) deflection_bm = results.y[L] deflection_formula = M * L**2 / (2 * E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005
def test_supported_moment_begin(): """Ends supported beam with moment load at begin.""" M = 500 * 1000 x = 422 results = bm.solve(L, (0, L), bm.MomentLoad(M, 0), np.ones(L + 1) * E * Ix, np.ones(L + 1) * G * A, np.ones(L + 1) * H / 2, -np.ones(L + 1) * H / 2, False) deflection_bm = results.y[x] deflection_formula = 0.0642 * M * L**2 / (E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005
def test_clamped_moment_end(): """Begin clamped, moment load at end.""" M = 500 * 1000 problem = { 'length': L, 'EI': np.ones(L + 1) * E * Ix, 'GA': np.ones(L + 1) * G * A, 'top': np.ones(L + 1) * H / 2, 'bot': -np.ones(L + 1) * H / 2, 'shear': False, 'supports': None, 'loads': bm.MomentLoad(M, pos=L) } bm.solve(problem) deflection_bm = problem['y'][L] deflection_formula = M * L**2 / (2 * E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005
def test_supported_moment_begin(): """Ends supported beam with moment load at begin.""" M = 500 * 1000 x = 422 problem = { 'length': L, 'EI': np.ones(L + 1) * E * Ix, 'GA': np.ones(L + 1) * G * A, 'top': np.ones(L + 1) * H / 2, 'bot': -np.ones(L + 1) * H / 2, 'supports': (0, L), 'shear': False, 'loads': bm.MomentLoad(M, 0) } bm.solve(problem) deflection_bm = problem['y'][x] deflection_formula = 0.0642 * M * L**2 / (E * Ix) reldiff = abs((deflection_bm - deflection_formula) / deflection_formula) assert reldiff < 0.005