Example incremental method lecture 3 plasticity#

The following structure is investigated

structure

#import packages
import sympy as sym
import matplotlib.pyplot as plt
sym.init_printing()
#Defines symbols and functions
EI, q_L, x, L, M_p = sym.symbols('EI, q_L, x, L, M_p')
w = sym.Function('w')
# Define the ODE for the bending of the beam
ODE_bending = sym.Eq(w(x).diff(x, 4) *EI, q_L/L*x)
display(ODE_bending)
../_images/a21b4ae17aeb253a9812205e18b5aef31491a235ca30c1c1ef896ca62c29be78.png
# Solve the ODE
w = sym.dsolve(ODE_bending, w(x)).rhs
display(w)
../_images/bc91cf19278e0b1f52d80d81963a7cb975b787312537b2cbbe9f774901bba8d8.png
# Define the continuum fields of phi, kappa, M, and V
phi = -w.diff(x)
kappa = phi.diff(x)
M = EI * kappa
V = M.diff(x)

Linear behaviour: fixed beam at both ends#

q0<qL<q1

# Define the boundary conditions
eq1 = sym.Eq(w.subs(x,0),0)
eq2 = sym.Eq(w.subs(x,L),0)
eq3 = sym.Eq(phi.subs(x,0),0)
eq4 = sym.Eq(phi.subs(x,L),0)
# Solve the integration constants
sol1 = sym.solve([eq1, eq2, eq3, eq4 ], sym.symbols('C1, C2, C3, C4'))
display(sol1)
../_images/c450819450b84441dd828dddc39650393b26847e06b4665a19cfa1ed992883f8.png
# Define some dummy values to plot the results
plotvalues = {EI:1, q_L:1, L:1, M_p:0.01}
# Plot the moment line to identify the maximum moment
sym.plot(-M.subs(sol1).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Moment line');
../_images/6392917a6cc49f293fa97262867c399768d7a6e22cfe5c3366ac253dc801c64c.png
# Obtain the maximum moment at x = L
display(M.subs(sol1).subs(x,L))
../_images/531eae32e1dfac25859195d2ed960f9cc7065ebd4ca809fee8cb72ebe768a313.png
# Obtain the load corresponding to the first yield moment
q1 = sym.solve(sym.Eq(-M.subs(sol1).subs(x,L),M_p), q_L)[0]
display(q1)
../_images/af0b5a7f3ad46394bf69c979ac11c4a59f5f5e50676915d8d2315b766e18dbcf.png
# Plot the displacement line
sym.plot(-w.subs(sol1).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Displacement line');
../_images/c1054c7f84cf7314ba2300678e9c00fa86d4d1c59e23c0c25d6198fe639ed492.png
# Obtain the displacement at x = L/2
w1 = w.subs(sol1).subs(q_L, q1).subs(x,L/2)
display(w1)
../_images/520fb8f33ad9c4f7f0b6352899dc5c8a15e2d306911b37d10c9cb0ae26423a9d.png

Plastic behaviour: Beam simply supported on right with \(M_p\) working at it#

q1<qL<q2

# Define the boundary conditions
eq1 = sym.Eq(w.subs(x,0),0)
eq2 = sym.Eq(w.subs(x,L),0)
eq3 = sym.Eq(phi.subs(x,0),0)
eq4 = sym.Eq(M.subs(x,L),-M_p)
# Solve the integration constants
sol2 = sym.solve([eq1, eq2, eq3, eq4 ], sym.symbols('C1, C2, C3, C4'))
display(sol2)
../_images/cf935d00e6319ae98288708e9bc0d70ba1d9737e4fbee71f23ec14f917bb47ca.png
# Plot the moment line to identify the maximum moment
sym.plot(-M.subs(sol2).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Moment line');
../_images/012b2c06cd9deca22f963827e5a5c0fdcc5e16e84842eebc667770b5f4e1a095.png
# Obtain the maximum moment at x = 0
display(M.subs(sol2).subs(x,0))
../_images/188388e98f1d7fef14d1d5bab31210337fc7f2da15d437b5f23d19aaabd6ca9c.png
# Obtain the load corresponding to the second yield moment
q2 = sym.solve(sym.Eq(-M.subs(sol2).subs(x,0),M_p), q_L)[0]
display(q2)
../_images/3e7fd76f3b4e7f0dbcf229ab8a128d0d41921ba2c02d1be10785707976ceaf9a.png
# Plot the displacement line
sym.plot(-w.subs(sol2).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Displacement line');
../_images/035b58d36edf3200d1124896536b4b8cea34d037360366c1a065b016cbcb901c.png
# Obtain the displacement at x = L/2
w2 = w.subs(sol2).subs(q_L, q2).subs(x,L/2)
display(w2)
../_images/e69669686132344dda47b74d211e59e09e795b884adc1b3caf716b40efa5f3e2.png

Plastic behaviour: Beam simply supported on both ends with \(M_p\) working at it#

q2<qL<q3

# Define the boundary conditions
eq1 = sym.Eq(w.subs(x,0),0)
eq2 = sym.Eq(w.subs(x,L),0)
eq3 = sym.Eq(M.subs(x,0),-M_p)
eq4 = sym.Eq(M.subs(x,L),-M_p)
# Solve the integration constants
sol3 = sym.solve([eq1, eq2, eq3, eq4 ], sym.symbols('C1, C2, C3, C4'))
display(sol3)
../_images/0ff1c2fa06f093f2702614e56e80f20f161cfed121d1f68ca276f6297eda2092.png
# Plot the moment line to identify the maximum moment
sym.plot(-M.subs(sol3).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Moment line');
../_images/a01b266e9a15eb722852cd3fadef9fe207bdf7dd9fc03531c8ea6b82c155b06e.png
# Find the location of the maximum moment
x_M_max = sym.solve(sym.Eq(V.subs(sol3),0),x)[1]
display(x_M_max)
../_images/bacd75d08179ce6dfa299608f815e9a667fcd0b016b216f9e48dfde37536c723.png
# Obtain the maximum moment at x = x_M_max
display(M.subs(sol3).subs(x,x_M_max))
../_images/e51bfba708683511f588b02250394996335dd9d9a350fcc9c787fb9c8dedafaf.png
# Obtain the load corresponding to the third yield moment
q3 = sym.solve(sym.Eq(M.subs(sol3).subs(x,x_M_max).subs(x,0),M_p), q_L)[0]
display(q3)
../_images/ef97e5202603295516d1664196ec6d052c1356887771231263b206d8d9417845.png
# Plot the displacement line
sym.plot(-w.subs(sol3).subs(plotvalues),(x,0,1),ylabel='M(x)',title='Displacement line');
../_images/bc4c11587d60d7323a09b498137c9a6d099de80cca144e74835c3f56e4acac94.png
# Obtain the displacement at x = L/2
w3 = w.subs(sol3).subs(q_L, q3).subs(x,L/2).simplify()
display(sym.simplify(w3))
../_images/9a90432314f67e179ecdfa38f1fbbeafb3646e536baeaeac509fc4a17e5dd462.png

Mechanism: Beam simply supported on both ends with \(M_p\) working at it and a plastic hinge at \(\frac{\sqrt{3}L}{3}\)#

q3<qL

\(q_L-w_C\) diagram#

# Obtain the displacements and q values as coefficients of a constant term.
w_list = [0,w1.coeff(L**2*M_p/EI),w2.coeff(L**2*M_p/EI),w3.coeff(L**2*M_p/EI),w3.coeff(L**2*M_p/EI)*2]
q_list = [0,q1.coeff(M_p/L**2),q2.coeff(M_p/L**2),q3.coeff(M_p/L**2),q3.coeff(M_p/L**2)]
# Plot the q_L-w diagram
plt.plot(w_list,q_list)
plt.xlabel('$w_C / (L^2 M_p / EI))$')
plt.ylabel('$q_L / (M_p / L^2)$')
plt.title('$q_L-w_C$ diagram')
plt.gca().spines['right'].set_color('none')
plt.gca().spines['top'].set_color('none')
plt.gca().spines['bottom'].set_position('zero')
plt.gca().spines['left'].set_position('zero')
../_images/1e074b7b1b58f7c203dccdf332a4d5a10a2076d3103d84271fdac773b230bcd5.png