# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Numeric length # 2. Pin # 3. Roller # 4. Symbolic point load import matplotlib.pyplot as plt from symbeam import beam test_beam = beam(3, x0=0) test_beam.add_support(0.5, "pin") test_beam.add_support(2.5, "roller") test_beam.add_point_load(0, "-P") test_beam.add_point_load(3, "-P") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Numeric # 2. Pin # 3. Roller # 4. Numeric sinusoidal distributed force import matplotlib.pyplot as plt from symbeam import beam test_beam = beam(1, x0=0) test_beam.add_support(0, "pin") test_beam.add_support(1, "roller") test_beam.add_distributed_load(0, 1, "sin(20 * x)") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Symbolic length # 2. Fixed # 3. Hinge # 4. Symbolic distributed constant load # 5. Symbolic point load import matplotlib.pyplot as plt from symbeam import beam test_beam = beam("l", x0=0) test_beam.add_support(0, "fixed") test_beam.add_support("l/2", "hinge") test_beam.add_support("l", "roller") test_beam.add_distributed_load("l/2", "l", "-q") test_beam.add_point_load("l/4", "-q*l") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Numeric length # 2. Pin # 3. Two rollers # 4. Numeric distributed constant load # 5. Numeric distributed quadratic load import matplotlib.pyplot as plt from symbeam import beam test_beam = beam(6, x0=0) test_beam.add_support(0, "roller") test_beam.add_support(2, "roller") test_beam.add_support(6, "pin") test_beam.add_support(4, "hinge") test_beam.add_distributed_load(0, 4, -5) test_beam.add_distributed_load(4, 6, "-(-3*(x-5)**2 + 8)") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
import matplotlib.pyplot as plt from sympy.abc import E, I, L, M, P, q, x from symbeam import beam new_beam = beam(L) # new_beam.set_young(x_start, x_end, value) new_beam.set_young(0, L / 2, E) new_beam.set_young(L / 2, L, E / 10) # new_beam.set_inertia(x_start, x_end, value) new_beam.set_inertia(0, L / 2, I) new_beam.set_inertia(L / 2, L, I / 2) # new_beam.add_support(x_coord, type) new_beam.add_support(0, "fixed") new_beam.add_support(L, "roller") new_beam.add_support(3 * L / 4, "hinge") new_beam.add_point_load(3 * L / 4, -P) new_beam.add_point_moment(L, M) new_beam.add_distributed_load(0, L / 2, -q * x) new_beam.solve() new_beam.plot(subs={"P": 1000, "q": 5000, "L": 2, "M": 1000}) plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Numeric length # 2. Roller # 3. Pin # 4. Numeric distriuted linear load # 5. Numeric distriuted quadratic load # 6. Two numeric distributed linear loads import matplotlib.pyplot as plt from symbeam import beam test_beam = beam(4, x0=0) test_beam.add_support(2, "roller") test_beam.add_support(4, "pin") test_beam.add_distributed_load(0, 2, "-5*x") test_beam.add_distributed_load(2, 4, "-(4*x**2-24*x+42)") test_beam.set_inertia(0, 4, 2.051e-5) test_beam.set_young(0, 4, 210e9) test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # Features: 1. Symbolic length # 2. Fixed # 3. Symbolic point moment # 4. Classical clamped beam problem import matplotlib.pyplot as plt from symbeam import beam test_beam = beam("L", x0=0) test_beam.add_support(0, "fixed") test_beam.add_point_moment("L", "M") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")
# SymBeam examples suit # ========================================================================================== # António Carneiro <*****@*****.**> 2020 # # Credit to Bernardo Ferreira (2020) for detecting the bug where SymBeam would fail when # the length of the beam contains both numbers and symbols, like "3*l" # Features: 1. Symbolic length scaled by number # 2. Roller # 3. Hinge # 4. Fixed # 4. Symbolic distributed linear load # 4. Symbolic distributed quadratic load import matplotlib.pyplot as plt from symbeam import beam test_beam = beam("3*l", x0=0) test_beam.add_support("l", "roller") test_beam.add_support("2*l", "hinge") test_beam.add_support("3*l", "fixed") test_beam.add_distributed_load(0, "l", "- q / l * x") test_beam.add_distributed_load("2*l", "3*l", "q / l**2 * x**2 - 6*q*x/l + 9*q") test_beam.solve() fig, ax = test_beam.plot() plt.savefig(__file__.split(".py")[0] + ".svg")