forked from amcc1996/symbeam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_8.py
32 lines (26 loc) · 1.03 KB
/
example_8.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
28
29
30
31
32
# SymBeam examples suit
# ==========================================================================================
# António Carneiro <[email protected]> 2020
# Features: 1. Numeric length
# 2. Pin
# 3. Rollers
# 4. Symbolic point load
# 5. Discontinuous distribution of Young modulus
# 6. Discontinuous distribution of second moment of area
# 7. `E` and `I` imported directly from SymPy library
# 8. User-speficied substitution
import matplotlib.pyplot as plt
from sympy.abc import E, I
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.set_young(0, 1.5, E / 1000)
test_beam.set_young(1.5, 3, E)
test_beam.set_inertia(0, 1, I)
test_beam.set_inertia(1, 3, 100 * I)
test_beam.solve()
fig, ax = test_beam.plot(subs={"P": 1000})
plt.savefig(__file__.split(".py")[0] + ".svg")