Ejemplo n.º 1
0
def test_Beam3D():
    l, E, G, I, A = symbols("l, E, G, I, A")
    R1, R2, R3, R4 = symbols("R1, R2, R3, R4")

    b = Beam3D(l, E, G, I, A)
    m, q = symbols("m, q")
    b.apply_load(q, 0, 0, dir="y")
    b.apply_moment_load(m, 0, 0, dir="z")
    b.bc_slope = [(0, [0, 0, 0]), (l, [0, 0, 0])]
    b.bc_deflection = [(0, [0, 0, 0]), (l, [0, 0, 0])]
    b.solve_slope_deflection()

    assert b.polar_moment() == 2 * I
    assert b.shear_force() == [0, -q * x, 0]
    assert b.bending_moment() == [0, 0, -m * x + q * x**2 / 2]
    expected_deflection = (
        x *
        (A * G * q * x**3 / 4 + A * G * x**2 *
         (-l * (A * G * l * (l * q - 2 * m) + 12 * E * I * q) /
          (A * G * l**2 + 12 * E * I) / 2 - m) + 3 * E * I * l *
         (A * G * l *
          (l * q - 2 * m) + 12 * E * I * q) / (A * G * l**2 + 12 * E * I) + x *
         (-A * G * l**2 * q / 2 + 3 * A * G * l**2 *
          (A * G * l * (l * q - 2 * m) + 12 * E * I * q) /
          (A * G * l**2 + 12 * E * I) / 4 + A * G * l * m * Rational(3, 2) -
          3 * E * I * q)) / (6 * A * E * G * I))
    dx, dy, dz = b.deflection()
    assert dx == dz == 0
    assert simplify(dy - expected_deflection) == 0

    b2 = Beam3D(30, E, G, I, A, x)
    b2.apply_load(50, start=0, order=0, dir="y")
    b2.bc_deflection = [(0, [0, 0, 0]), (30, [0, 0, 0])]
    b2.apply_load(R1, start=0, order=-1, dir="y")
    b2.apply_load(R2, start=30, order=-1, dir="y")
    b2.solve_for_reaction_loads(R1, R2)
    assert b2.reaction_loads == {R1: -750, R2: -750}

    b2.solve_slope_deflection()
    assert b2.slope() == [
        0,
        0,
        x**2 * (50 * x - 2250) / (6 * E * I) + 3750 * x / (E * I),
    ]
    expected_deflection = (
        x *
        (25 * A * G * x**3 / 2 - 750 * A * G * x**2 + 4500 * E * I + 15 * x *
         (750 * A * G - 10 * E * I)) / (6 * A * E * G * I))
    dx, dy, dz = b2.deflection()
    assert dx == dz == 0
    assert dy == expected_deflection

    # Test for solve_for_reaction_loads
    b3 = Beam3D(30, E, G, I, A, x)
    b3.apply_load(8, start=0, order=0, dir="y")
    b3.apply_load(9 * x, start=0, order=0, dir="z")
    b3.apply_load(R1, start=0, order=-1, dir="y")
    b3.apply_load(R2, start=30, order=-1, dir="y")
    b3.apply_load(R3, start=0, order=-1, dir="z")
    b3.apply_load(R4, start=30, order=-1, dir="z")
    b3.solve_for_reaction_loads(R1, R2, R3, R4)
    assert b3.reaction_loads == {R1: -120, R2: -120, R3: -1350, R4: -2700}
Ejemplo n.º 2
0
from sympy.physics.continuum_mechanics.beam import Beam3D
from sympy import symbols
l, E, G, I, A, x = symbols('l, E, G, I, A, x')
b = Beam3D(20, E, G, I, A, x)
b.apply_load(15, start=0, order=0, dir="z")
b.apply_load(12*x, start=0, order=0, dir="y")
b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])]
R1, R2, R3, R4 = symbols('R1, R2, R3, R4')
b.apply_load(R1, start=0, order=-1, dir="z")
b.apply_load(R2, start=20, order=-1, dir="z")
b.apply_load(R3, start=0, order=-1, dir="y")
b.apply_load(R4, start=20, order=-1, dir="y")
b.solve_for_reaction_loads(R1, R2, R3, R4)
b.plot_shear_force()
# PlotGrid object containing:
# Plot[0]:Plot object containing:
# [0]: cartesian line: 0 for x over (0.0, 20.0)
# Plot[1]:Plot object containing:
# [0]: cartesian line: -6*x**2 for x over (0.0, 20.0)
# Plot[2]:Plot object containing:
# [0]: cartesian line: -15*x for x over (0.0, 20.0)
Ejemplo n.º 3
0
def test_polar_moment_Beam3D():
    l, E, G, A, I1, I2 = symbols('l, E, G, A, I1, I2')
    I = [I1, I2]

    b = Beam3D(l, E, G, I, A)
    assert b.polar_moment() == I1 + I2
Ejemplo n.º 4
0
from sympy.physics.continuum_mechanics.beam import Beam3D
from sympy import symbols
l, E, G, I, A, x = symbols('l, E, G, I, A, x')
b = Beam3D(20, 40, 21, 100, 25, x)
b.apply_load(15, start=0, order=0, dir="z")
b.apply_load(12*x, start=0, order=0, dir="y")
b.bc_deflection = [(0, [0, 0, 0]), (20, [0, 0, 0])]
R1, R2, R3, R4 = symbols('R1, R2, R3, R4')
b.apply_load(R1, start=0, order=-1, dir="z")
b.apply_load(R2, start=20, order=-1, dir="z")
b.apply_load(R3, start=0, order=-1, dir="y")
b.apply_load(R4, start=20, order=-1, dir="y")
b.solve_for_reaction_loads(R1, R2, R3, R4)
b.solve_slope_deflection()
b.plot_deflection()
# PlotGrid object containing:
# Plot[0]:Plot object containing:
# [0]: cartesian line: 0 for x over (0.0, 20.0)
# Plot[1]:Plot object containing:
# [0]: cartesian line: x**5/40000 - 4013*x**3/90300 + 26*x**2/43 + 1520*x/903 for x over (0.0, 20.0)
# Plot[2]:Plot object containing:
# [0]: cartesian line: x**4/6400 - x**3/160 + 27*x**2/560 + 2*x/7 for x over (0.0, 20.0)