Euler Bernoulli Equation in Sagemath

The Euler-Bernoulli equation describes the relationship between the beam’s deflection and the applied load. The equation is:

The curve w(x)  describes the deflection of the beam in the z direction at some position x.

q is a distributed load, in other words a force per unit length (analogous to pressure being a force per area); it may be a function of x, w, or other variables.

Note that E is the elastic modulus and that I is the second moment of area.

Often, EI is a constant.

Successive derivatives of w have important meanings where w is the deflection in the z direction:

  • \textstyle{w}\, is the deflection.
  •  {dw \over dx}  is the slope of the beam.
  •  : M = \ -EI {d^2w \over dx^2}  is the bending moment in the beam.
  • -\frac{d} {d x}\left(EI\frac{d^2 w}{d x^2}\right) = Q\, is the shear force in the beam.

Boundary Conditions:

w|_{x = 0} = 0 \quad ; \quad \frac{\partial w}{\partial x}\bigg|_{x = 0} = 0 \qquad \mbox{(fixed end)}\,
\frac{\partial^2 w}{\partial x^2}\bigg|_{x = L} = 0 \quad ; \quad \frac{\partial^3 w}{\partial x^3}\bigg|_{x = L} = 0 \qquad \mbox{(free end)}\,

To solve this equation , here is sage code:

var('w,x,E,L,k1,k2')
y = function('y', x) 
w= function('w' , x)
q = function('q', x)
assume(L>0)
assume(E>0)
q=x
de=E*L*diff(y,x,2)==q #### Making assumption that w=((d/dx)^2)*y#####
y_res=desolve(de,y,ivar=x,ics=[L,0,0])
### Subtituting back w in equation, we get another 2nd order ODE###
des=diff(w,x,x)-y_res==0 
dess=desolve(des,w,ivar=x,ics=[0,0,0])
print "Solution of bernoulli's equation:",dess    
#####Remeber plot can't be formed without giving values of constant####### 
E=6 
L=10
p=plot( 1/120*(20*L^3*x^2 - 10*L^2*x^3 + x^5)/(E*L),(x,0,1),thickness=3)
p.show()

Output is:

Solution of bernoulli’s equation: 1/120*(20*L^3*x^2 – 10*L^2*x^3 + x^5)/(E*L)

The curve w(x)  describes the deflection of the beam in the z direction at some position x.

Examples of Shear force and Bending Moment Diagrams:

There are three types of beam:

1. Cantilever beam

2. Simply Supported Beam

3. Overflow Beam

And similary there are three types of load:

1. Point Load

2. Uniformly Distributed Load (UDL)

3. Uniformly Varing Load (UVL)

Cantilever Beam With Point Load:

Here is Cantilever Beam with point load i.e  A beam with one end fixed and another end freeand having point load.

To plot deflection (w), Bending Moment (M) and Shear Force Diagram (Q), the equations are as follow:

Bending Moment Diagram:

var('L,P')
 L=10
 P=5
 f2 = lambda x: P*(x-L)
 r=plot(f2,(x,0,L),color='red')
 r.show()

Shear Force Diagram :

var('L,P')
L=10
P=5
f1 = lambda x: P
r=plot(f1,(x,0,L))
r.show()

Deflection Diagram:

var('L,P')
E=2
L=10
P=5
f2 = lambda x: (P*x^2*(3*L-x))/6*E*L
r=plot(f2,(x,0,L/4),thickness=3)
r.show()

Advertisements

About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s