Solving beam deflection problems using the moment-deflection approach and using the Euler-Bernoulli approach

by Nasser M. Abbasi 
November 2009

Links

PDF  file 
Mathematica notebook

Introduction

These are problems in beam deflection showing how to use Mathematica to solve them.

Problem 1

This is problem 9-3, page 551, from bok Problem Solvers, strength of materials and mechanics of materials by REA. I show here how to solve this problem using Mathematica.

Start by setting up the moment deflection equation for the Euler beam E I  y''[x]=M(x) , this equation is found for both halves of the beam resulting in 2 solutions, (Subscript[y, 1])(x) and (Subscript[y, 2])(x).

On the right side, boundary condition is that (Subscript[y, 2])(L)=0 and on the left side (Subscript[y, 1])(0)=0, then we need an additional 2 boundary conditions, for this, use the  continuity  conditions at L/2 where we set (Subscript[y, 1])(L/2)=(Subscript[y, 2])(L/2) and (Subscript[(y'), 1])(L/2)=(Subscript[(y'), 2])(L/2) and now we have the complete solutions.

For the left half of beam, it is easily found that M(x)=((w L)/8)x and for the right half M(x)=((w l x)/8) -(w/2) (((x-(l/2)))^2)

Find (Subscript[y, 1])(x)

Clear[Ε ,Ι,w, L,eq1,eq2,y1,y2,M1,M2]

M1=((w L)/8)x;
eq1= Ε Ι y''[x]==M1;
sol1=First@DSolve[eq1,y[x],x];
y1=y[x]/.sol1;
y1=y1/.{C[1]->c1,C[2]->c2}

Use first boundary condition (Subscript[y, 1])(0)=0

First@Solve[(y1/.x->0)==0,{c1,c2}];
y1=y1/.%

Find (Subscript[y, 2])(x)

M2=((w L)/8) x -(w/2)(((x-(L/2)))^2);
eq2=  Ε Ι y''[x] ==M2;
sol2=First@DSolve[eq2,y[x],x];
y2=y[x]/.sol2;
y2=y2/.{C[1]->c3,C[2]->c4}

Use boundary condition (Subscript[y, 2])(L)=0

First@Solve[(y2/.x->L)==0,{c3,c4}];
y2=y2/.%;
y2=Collect[y2,c4]

We see from the above, that we have 2 additional constants of integrations to solve for. c2 and c4. To solve for these, we use the continuity conditions at L/2

sol=First@Solve[{(y2==y1/.x->(L/2)),(D[y2,x]==D[y1,x])/.x->(L/2)},{c2,c4}]

All the integration of constants now found, we can now plot moment diagrams, shear diagram, and deflection diagrams

y1=y1/.sol

y2=y2/.sol

Assign some values for E, I, L and w and do the plots. PLot the deflection

L=10;
values={Ε ->2*(10^6),Ι->2,w->10000};
Plot[{y1 HeavisideTheta[L/2-x]/.values,y2 HeavisideTheta[x-L/2]/.values},{x,0,10},Frame->True,FrameLabel->{{"y(x)",None},{"x","beam deflection"}}]

Plot the bending moment

Plot[{M1 HeavisideTheta[L/2-x]/.values,M2 HeavisideTheta[x-L/2]/.values},{x,0,10},Frame->True,FrameLabel->{{"M(x)",None},{"x","Bending moment"}}]

Plot the shear diagram

Plot[Evaluate[{D[M1,x] HeavisideTheta[L/2-x],D[M2,x] HeavisideTheta[x-L/2] }/.values],{x,0,10},Frame->True,FrameLabel->{{"V(x)",None},{"x","shear diagram"}}]

Solving the same problem directly from the Euler-Bernoulli (4^th) order ODE

The above approach (using the Moment-deflection ODE) is a standard approach to solve deflection beam problems. However, we can also use the 4th order Euler beam equation direclty as follows. One needs to make sure that the load on the RHS of this ODE is the load per unit length only, i.e. w in this problem. Notice the use of the unit step function since w only acts on half the beam.

Clear[Ε ,Ι,w, L,eq,y]
eq=Ε  Ι y''''[x]==-w HeavisideTheta[x-  (L/2)];
sol=First@DSolve[{eq,y[0]==0,y[ L]==0,y''[0]==0,y''[L]==0},y[x],x];
y=y[x]/.sol

Assign some values for E, I, L and w and do the plots. PLot the deflection

L=10;
values={Ε ->2*(10^6),Ι->2,w->10000};
Plot[y /.values,{x,0,10},Frame->True,FrameLabel->{{"y(x)",None},{"x","beam deflection"}}]

We see that we obtain the same result as earlier.

Plot the bending moment

Plot[Evaluate[Ε  Ι D[D[y,x],x]/.values],{x,0,10},Frame->True,FrameLabel->{{"M(x)",None},{"x","bending moment"}}]

Plot the shear diagram

Plot[Evaluate[Ε  Ι D[D[D[y,x],x],x]/.values],{x,0,10},Frame->True,FrameLabel->{{"V(x)",None},{"x","shear diagram"}}]

Problem 2

In this problem. I set up a cantilever beam and first solved it using the Java beam applet that can be accessed  here 
and then I solved this problem using Mathematica below, showing that I get the same answer as shown

Clear[Ε ,Ι,w, L,eq,y, sol]
eq=Ε  Ι y''''[x]==-w HeavisideTheta[(L/2)-x];

The boundary conditions to use are: y[L] == 0, y''[0] == 0, y'''[0] == 0, y'[L] == 0

sol=Simplify@First@DSolve[{eq,y[L]==0,y''[0]==0,y'''[0]==0,y'[L]==0},y[x],x];
y=y[x]/.sol

Assign same values as shown above for E, I, L and w and do the plots.

L=10;
values={Ε ->28*(10^6),Ι->2,w->1};
Plot[y /.values,{x,0,10},Frame->True,FrameLabel->{{"y(x)",None},{"x","beam deflection"}}]
Print["Max deflection is ",(y/.values)/.x->0//N, " inches"]

Plot the bending moment

Plot[Evaluate[Ε  Ι D[D[y,x],x]/.values],{x,0,10},Frame->True,FrameLabel->{{"M(x)",None},{"x","bending moment"}}]
Print["Max moment is ",(Ε  Ι D[D[y,x],x]/.values)/.x->10//N]

Plot the shear diagram

Plot[Evaluate[Ε  Ι D[D[D[y,x],x],x]/.values],{x,0,10},Frame->True,FrameLabel->{{"V(x)",None},{"x","shear diagram"}}]