Example 6

Example 6#

%pip install sympy==1.12.1
# This is a workaround for the fact that micropip does not support git URLs, to make it work in the online book.
import micropip
await micropip.install('../packages/sympy-1.12.1-py3-none-any.whl')
#takes a while
%matplotlib inline
import sympy as sm
from sympy.physics.continuum_mechanics.beam import Beam
import matplotlib.pyplot as plt
E = sm.Symbol('E')
I = sm.Symbol('I')
x = sm.Symbol('x')
b = Beam(10, E, I)
b.apply_support(0, type="fixed")
b.apply_support(10, type="pin")
R_0, M_0, R_10 = sm.symbols('R_0, M_0, R_10')
b.solve_for_ild_reactions(-1, R_0, M_0, R_10)
b.ild_reactions
{R_0: 3/2 - 3*x/20, M_0: x/2 - 5, R_10: 3*x/20 - 1/2}
b.plot_ild_reactions();
../../../_images/b7fe1c1e032f86b2201ea5e2d76375555d1509926432addf3df3616cc6122a72.png