import matplotlib
if not hasattr(matplotlib.RcParams, "_get"):
matplotlib.RcParams._get = dict.get
Lesson Monday September 8th#
During todayβs lesson itβs demonstrated how you to use differential equations to solve structural problems.
Demonstration#
Given a structure as shown below:
We can calculate the force distribution and displacements of this structure using differential equations. For this structure only consisting of bending elements, \( EI \cfrac{{d}^4w}{{d}x^4} = q_z\) is enough to solve it.
First, letβs define the segments with continuous loads. This requires splitting the element AB into two because the distributed load causes a discontinuity.
Now, each segment can be drawn separately, indicating the loads, coordinate systems, dimensions and section forces at the edges of each segment.
For AC this leads to:
Fig. 1 Free body diagram element AC#
For BC this leads to:
Fig. 2 Free body diagram element BC#
Element AC#
As this element is unloaded, the load equation for this element gives:
leading to the equations:
Because of the support at A a boundary condition can be formulated as:
Because A is also the end of the beam, another boundary condition can be formulated as:
Element BC#
As this element is loaded, the load equation for this element gives:
leading to the equations:
Because of the support at B, two boundary conditions can be formulated directly:
Interface conditions#
At C a boundary condition can be identified from the consistency of displacements: both the downwards and rotational displacement of must be the same as the downwards and rotational displacement of the left of element BE:
Finally, there should be consistency with the section forces too, as shown in the free body diagram:
Fig. 3 Free body diagram node C#
Vertical equilibrium gives:
Moment equilibrium gives:
Solve system of equations#
8 boundary conditions have been formulated with 8 integration constants. These can now be solved. Youβre advised to use your calculator or a symbolic programming tool to solve this.
Filling in the boundary conditions gives:
Solving this gives:
Now, the full force distribution and displacements of the structure has been solved. For example the moment distribution in BC which can be plotted as:
Solve using digital tools#
To solve the system of equations using numerical tools, you can write down the equations as a matrix formulation \(Ax=b\) which can easily be solved by ie. your graphical calculator or python.
import numpy as np
A = np.array([
[0, 0, 0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, -4/1875, -1/625, -4, 1],
[0, 0, 0, 0, 1/625, 1/1250, 1, 0],
[-4/1875, -1/625, -4, 1, 0, 0, 0, -1],
[1/625, 1/1250, 1, 0, 0, 0, -1, 0],
[4, 1, 0, 0, 0, -1, 0, 0],
[1, 0, 0, 0, -1, 0, 0, 0]
])
b = np.array([
0,
0,
-8/375,
8/375,
0,
0,
0,
0
])
np.linalg.solve(A,b)
array([[ 4.37500000e+00],
[ 0.00000000e+00],
[-6.66666667e-03],
[ 0.00000000e+00],
[ 4.37500000e+00],
[ 1.75000000e+01],
[ 3.33333333e-04],
[ 1.73333333e-02]])
Alternatively, a symbolic programming language can be used to solve the equations exactly. As an example the sympy package in Python is used:
import sympy as sym
sym.init_printing()
x = sym.symbols('x')
q = 10
EI = 5000
EA = 20000
F = 150
q_AC = 0
q_BC = q
C_1, C_2, C_3, C_4 = sym.symbols('C_1 C_2 C_3 C_4')
C_5, C_6, C_7, C_8 = sym.symbols('C_5 C_6 C_7 C_8')
V_AC = -sym.integrate(q_AC, x) + C_1
M_AC = sym.integrate(V_AC, x) + C_2
kappa_AC = M_AC/EI
phi_AC = sym.integrate(kappa_AC, x) + C_3
w_AC = -sym.integrate(phi_AC, x) + C_4
V_BC = -sym.integrate(q_BC, x) + C_5
M_BC = sym.integrate(V_BC, x) + C_6
kappa_BC = M_BC/EI
phi_BC = sym.integrate(kappa_BC, x) + C_7
w_BC = -sym.integrate(phi_BC, x) + C_8
eq1 = sym.Eq(w_AC.subs(x,0),0)
eq2 = sym.Eq(M_AC.subs(x,0),0)
eq3 = sym.Eq(w_BC.subs(x,4),0)
eq4 = sym.Eq(phi_BC.subs(x,4),0)
eq5 = sym.Eq(w_AC.subs(x,4)-w_BC.subs(x,0),0)
eq6 = sym.Eq(phi_AC.subs(x,4)-phi_BC.subs(x,0),0)
eq7 = sym.Eq(M_AC.subs(x,4) - M_BC.subs(x,0),0)
eq8 = sym.Eq(V_AC.subs(x,4) - V_BC.subs(x,0),0)
sol = sym.solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8],(C_1,C_2,C_3,C_4,C_5,C_6,C_7,C_8))
for k, v in sol.items():
print(f"{k} = {v} β {v.evalf()}")
C_1 = 35/8 β 4.37500000000000
C_2 = 0 β 0
C_3 = -1/150 β -0.00666666666666667
C_4 = 0 β 0
C_5 = 35/8 β 4.37500000000000
C_6 = 35/2 β 17.5000000000000
C_7 = 1/3000 β 0.000333333333333333
C_8 = 13/750 β 0.0173333333333333