Example 1

Example 1#

import sympy as sm
from sympy.physics.continuum_mechanics.beam import Beam
E = sm.Symbol('E')
I = sm.Symbol('I')
F = sm.Symbol('F')
x = sm.Symbol('x')
b = Beam(10, E, I)
r0, m0 = b.apply_support(0, type="fixed")
r10, m10 = b.apply_support(10, type="fixed")
b.apply_rotation_hinge(5)
b.apply_load(-F, 5, -1)
b.load
\[\displaystyle E I P_{5} {\left\langle x - 5 \right\rangle}^{-3} - F {\left\langle x - 5 \right\rangle}^{-1} + M_{0} {\left\langle x \right\rangle}^{-2} + M_{10} {\left\langle x - 10 \right\rangle}^{-2} + R_{0} {\left\langle x \right\rangle}^{-1} + R_{10} {\left\langle x - 10 \right\rangle}^{-1}\]
b.bending_moment()
\[\displaystyle - E I P_{5} {\left\langle x - 5 \right\rangle}^{-1} + F {\left\langle x - 5 \right\rangle}^{1} - M_{0} {\left\langle x \right\rangle}^{0} - M_{10} {\left\langle x - 10 \right\rangle}^{0} - R_{0} {\left\langle x \right\rangle}^{1} - R_{10} {\left\langle x - 10 \right\rangle}^{1}\]
b.bending_moment().subs(x, 5)
\[\displaystyle - \infty E I P_{5} - M_{0} - 5 R_{0}\]