Integrate Products of Bending Moment Diagrams

Figure

This snippet integrates the product of two moment diagrams, as might be used to integrate the product of virtual and real moments when finding deflections in beam and frame structures using the method of virtual work.

It simply uses the solution for the most general case of a linear virtual moment diagram and a real moment diagram resulting from a UDL of magnitude $w$ and constant $EI$.

Note: signs for moments and loads are positive in the directions shown in the figure.

def intmM(L,m0,m1,M0,M1,w=0,EI=1.):
    return (L/24.)*(m0*(w*L*L + 8.*M0 + 4.*M1) + m1*(w*L*L + 4.*M0 + 8.*M1))/EI

Example Usage

Consider the example of Figure 5.24 from Erochko, repeated here with some minor changes:

Figure

First, integrate the four separate parts:

part1 = intmM(L=3,m0=0,m1=1.5,M0=0,M1=105,EI=3)
part1

52.5
part2 = intmM(L=1,m0=1.5,m1=2.0,M0=105,M1=140,EI=1)
part2

215.83333333333331
part3 = intmM(L=2,m0=2,m1=1,M0=140,M1=210,EI=1)
part3

513.3333333333333
part4 = intmM(L=2,m0=1,m1=0,M0=210,M1=0,EI=1)
part4

140.0
T = part1 + part2 + part3 + part4
T

921.6666666666665

Then form the total internal virtual work, $U_i$:

The units of the above are $\text{kN}\text{m}^3$ (remember, the virtual unit load has no units). If $E$ and $I$ have units of N and mm then we can convert the above to the same units by multiplying ${}\times 10^3 \times 10^3 \times 10^3 \times 10^3$.

Our virtual work equation is:

\[U_i = \frac{T}{EI}\] \[1 \times \Delta = U_i\]

solving for $\Delta$ gives:

E = 200000.
I = 300E6
delta = T * 1E3 * 1e3**3 / (E*I)
delta

15.361111111111109

And this is in mm.