forked from amcc1996/symbeam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_17.py
27 lines (23 loc) · 1014 Bytes
/
example_17.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# SymBeam examples suit
# ==========================================================================================
# António Carneiro <[email protected]> 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")