Analysis of deflection in simply supported beam with udl by weighted residual method, point collacation method and strength of materials method using Matlab
Analysis of deflection in simply supported beam with udl by weighted residual method, point collacation method and strength of materials method using Matlab
This program created on matlab is to analysis the deflection and maxium deflection values of simply supported beam with udl load acting the entire length obtained by point collacation method and Galerkin method of finite element analysis and to compare these values with the values obtained based on strength of material formula.
Refer report section for breif explanation
Code:
% Program to solve simply supported beam with udl
clear all
close all
clc
% Inputs
EI = 2*10^8; %youngs modulus*Inertia
q = 2*10^11; % Udl load acting
constants = q/(EI); % combination of above variables
L = 1; % total length of the beam
l_mid = 0.5; % mid point of the beam where high deflection occur
l = linspace(0,1,20); % any point inbetween the total length
l_three =[0, 1/2, 1];
% Calculation based on the som
fprintf('\n Maximum deflection value based on strength of materials forumla')
maxdef = (5*q.*1^4)/(384*EI) %q,E,I are constants ( Refer theoritical explanation for exact equation)
def = (q.*l.*(L.^3 - 2.*L.*l.^2 + l.^3))./(24*EI);%q,L,E,I are constants ( Refer theoritical explanation for exact equation)
figure(1)
hold on
% Plotting the deflection of the beam and max deflection based on som
plot(l,def,'linewidth',2)
plot(l_mid,maxdef,'*')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Calculation based on Weigth residue technique
fprintf('\n Calculations based on weight residue technique')
%%%%%%%%%%%%%%%% Finding residue %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms x
% trail solution ( Refer theoritical explanation for exact equation)
fprintf('\n Let us the consider the trail solution be ')
a(x) = (sin((pi.*x)./L))%( Refer theoritical explanation for exact equation)
% Perform the fourth order differentation
b(x) = diff(a,4);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Applying Boundary conditions
boundary(x) = diff(a,2);
r = a(0);
s = a(L);
t = boundary(0);
v = boundary(L);
% Checking the boundary conditions
fprintf('Checking wheather the trail solution satisfies the boundary condtions...........')
% Condition 1
if r == 0
fprintf('\n a(0) = 0')
fprintf('\n Trail solution satisfies the above boundary condition')
else
fprintf('\n Trail solution does not satisfies the above boundary condition')
end
% Condition 2
if s == 0
fprintf('\n a(L) = 0')
fprintf('\n Trail solution satisfies the above boundary condition')
else
fprintf('\n Trail solution does not satisfies the above boundary condition')
end
% Condition 3
if t == 0
fprintf('\n d^2a/dx^2(0) = 0')
fprintf('\n Trail solution satisfies the above boundary condition')
else
fprintf('\n Trail solution does not satisfies the above boundary condition')
end
% Condition 4
if v == 0
fprintf('\n d^2a/dx^2(L) = 0')
fprintf('\n Trail solution satisfies the above boundary condition')
else
fprintf('\n Trail solution does not satisfies the above boundary condition \n')
end
if [v,t,s,r]==0
fprintf('\n Trail solution satisfies all the boundary conditions')
else
fprintf('\n Trail solution fails and Terminate the calculations at this step')
end
%%%%%%%%%%%%%%%%%%%%%% Point collacation method %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% By point collacation method lets subs a value between 0 to 1
fprintf('\n Calculations based on point collaction method')
xd = L/4; % assumption
xe = L/3;
xf = L/2;
d=b(xd);
e=b(xe);
f=b(xf);
a1 = (1/d)*constants;% Final trial solution value
a2 = (1/e)*constants;
a3 = (1/f)*constants;
% values inbetween the total length of beam
% Max. Deflection for simply supported beam with udl at any point in between its total length
fprintf('\n Max. deflection based on point collaction method when x = L/4')
ymax_1 = a1*sin((pi*l_mid)/L) %( Refer theoritical explanation for exact equation)
fprintf('\n Max. deflection based on point collaction method when x = L/3')
ymax_2 = a2*sin((pi*l_mid)/L)
fprintf('\n Max. deflection based on point collaction method when x = L/2')
ymax_3 = a3*sin((pi*l_mid)/L)
% plotting max. deflection
plot(l_mid, ymax_1,'o')
plot(l_mid, ymax_2,'o')
plot(l_mid, ymax_3,'o')
% Deflection for simply supported beam with udl at any point in between its length
y1 = a1*sin((pi*l)/L); %( Refer theoritical explanation for exact equation)
y2 = a2*sin((pi*l)/L);
y3 = a3*sin((pi*l)/L);
% Plotting the deflection values by weight residue technique
plot(l,y1,'color','g')
plot(l,y2,'color','r')
plot(l,y3,'color','y')
title('Simply supported beam with udl deflection based on point collacation method')
xlabel('Normalised axial location on the beam')
ylabel('Transverse deflection')
legend('som deflection','som max. deflection','max @ residue L/4','max @ residue L/3','max @ residue L/2','deflection @ 1/4','deflection @ 1/3','deflection @ 1/2')
hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% Galerkin method %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fprintf('\n Calculations based on galerkin method')
y_gal = a*b(x);
numerator = a*q;
num = int(numerator,x,[0 L]);
denomerator = EI*y_gal;
dem = int(denomerator,x,[0 L]);
c1 = num/dem;
gal_def = c1*(sin(pi*l)/L);
fprintf('\n Maximum Deflection value based on galerkin method')
gal_def_max = c1*(sin(pi*l_mid)/L)
figure(2)
hold on
plot(l,gal_def,'linewidth',3,'color','g')% deflection curve
plot(l_mid,gal_def_max,'O') % max deflection
% Plotting the deflection of the beam and max deflection based on som
plot(l,def,'linewidth',2,'color','r')
plot(l_mid,maxdef,'*')
title('Simply supported beam with udl deflection based on galerkin method')
xlabel('Normalised axial location on the beam')
ylabel('Transverse deflection')
legend('galerkin method','galerkin max. deflection','som','som max. deflection')
Output:
plot 1: Transverse deflection vs normalised axail location on the beam
These curves represents the deflection and the maximum deflection occuring in the simply supported beam due to the uniformly acting load on the entire length of the beam calculated based on the strength of materials derived formulas and the equation obtained through the point collacation technique.
- x axis values from 0 to 1 which represents the length of the beam.
- y axis indicates the deflection occurs in the simply supported beam due to udl.
- Thus by above plot the blue line represents the deflection curve drawn based on the values obtained by the strength of material formula. '*' indicates the maximum deflection occurs in the beam based on the strength of material formula.
- On a certain step we assumed a values for x which is L/4, L/3, L/2 which creates deviation in the final deflection and maximum deflcetion values.Green, red and yellow curves represents the deflection based on those assumed values and 'o' indicates the maxium deflection for that particular curve respectively.
Interference from the plot 1 :
- The curve drawn based on the som formula (blue graph) and its maximum deflection values are found to be perfect.
- All the curves obtained by values of point collation method are found to be different and none of the curve matches the curve of som deflection. This clearly defines that the point collacation technique is not efficient to produce the exact solution.
plot 2: Transverse deflection vs normalised axail location on the beam
These curves represents the deflection and the maximum deflection occuring in the simply supported beam due to the uniformly acting load on the entire length of the beam calculated based on the strength of materials derived formulas and the equation obtained through the galerkin method.
- x axis values from 0 to 1 which represents the length of the beam.
- y axis indicates the deflection occurs in the simply supported beam due to udl.
- The red curve indicates the deflection curve obtained by the values calculated by som formula.
- '*' indicates the maxium deflection derived by som forumla.
- The green indicates the deflection curve obtained by the values calculated by galerkin method.
- 'o' indicates the maximum deflection obtained by the galerkin method.
Interference from plot 2:
- It is clear from the plot that both the som curve and the galerkin curve of deflection merges each other throughout the entire length of the beam.
- Both the maximum deflection values are seems to be perfectly same.
- Thus the values obtained by galerkin method is effecient and found to give the exact values as the som.
A report on Analysis of deflection in simply supported beam with udl by weighted residual method, point collacation method and strength of materials method using Matlab
1.AIM:
To write a program in matlab which analysis the delection occuring in the simply supported beam subjected to the uniformly distributed load by weighted residual method, point collaction method and to compare those values with the values obtained by the strength of material equation obtained for the same beam.
2.Objectives of the program:
The main objective of this program is to analyse effeciency of deflection and maximum deflection values obtained in both the point collaction and galerkin method.The deflection and maximum deflection occuring in the simply supported beam of length L subjected to the uniformly distributed load of q is calculated by point collaction method and galerkin method of finite element analysis weighted residue technique and comparing these deflection values with the standard formula proposed in strength of materials. The plots obtained as result in this program is strong enough to clearly explains the effeciency of weighted residue method for calculating the deflection occuring in the beam.
3.Introduction:
Simply supported beam:
A simply supported beam is one that rest on support on its both ends. Practical application for simply supported beam are bridges, beds on machines, beams in buildings,etc., The length of the beam is consider as 'L' and the udl acting is consider a 'q'. A beam is said to be in equilibrium when there is no tendency for it to move. There are two conditions for equilibrium, namely, the sum of the forces acting vertically downward must be equal to the sum of the forces acting vertically upward and the total moment of the forces acting on a beam must be zero. If the force acting on any of its direction exceeds the other deflection in the beam occurs.
Uniformly distributed load:
A load which acts equally to the particular length of the beam. At any point inbetween the range of udl the load is seems to be same. In case of simply supported beam with udl acting throught its length the maximum deflection tends to occur at the midpoint of the beam i.e., L/2.
4. Problem definition:
Let us consider the simply supported beam of length L = 1m is subjected to a uniformly distributed load of q having the youngs moduls E and moment of inertia I. where (q/EI) = 1000.
The governing differential equation is given by `E*I(d^4a)/dx^4 - q=0` .
The boundary counditions are defined by,
a(0) = 0; `(d^2a)/(dx^2)(0) =0`;
a(L) = 0; `(d^2a)/(dx^2)(L) =0`;
5.Approach by strength of materials formula:
According to the derived forumulas avaliable in the strength of materials for the simply supported beam subjected to udl,
Maximum deflection = `(5qL^4)/(384EI)`
Deflection occuring at any point x = `(qx)/(24EI)(L^3-2Lx^2+x^3)`
where L is the length of the beam = 1m
q is the udl load acting (N/m)
E is the youngs modulus (N/m^2)
I is the moment of inertia (m^4)
x represents any point in the beam.
6.Approach by finite element analysis point collacation method & weighted residual method(galerkin):
Here we consider only the point collacation and galerkin method to calculate the deflection and the maximum deflection occur in the beam.
We need to find the residual equation,
As given the governing differential equation is `E*I(d^4a)/dx^4 - q=0` . .............................. 1
The boundary counditions are defined by,
a(0) = 0; `(d^2a)/(dx^2)(0) =0`;
a(L) = 0; `(d^2a)/(dx^2)(L) =0`;
Let us assume the trail solution be,
`a = a1 (sin(pix)/L)` ............................................... 2
Let us need to check the trail solution satisifes all of our boundary conditions. If it satisfies the boundary we can use the assumed trail function to go furtherr if the assumed trail solution failed the boundary condtions then the trail must need to change in order that it satisfies all the boundary conditions.
Make the fourth order differentiation of the trail solution. Thus we obtained the following equation,
`(d^4a)/(dx^4) = a1 sin((pix)/L)(pi/L)^4` .............................. 3
substutuing the equation 3 in equation 1 we get,
`Rd =a1 (pi/L)^4 (EI) sin(pix)/L-q` ............................................. 4
Solution by point collacation technique:
We observe in the above equation that the domain residual is now varying from point to point within the domain (0<x<L). Since we have only one coefficient to be determined i.e a1 .Let us make Rd = 0 at x = L/4, L/3, L/2.
Determination of x values may significantly affects the deflection values. Hence to check its effeciency we choose three random points between 0 to L and analyse the values of all the three x points.
when Rd = 0, at x = 1/4
`Rd =a1 (pi/L)^4 (EI) sin(pi)/4-q =0`
then, c1 = `a1=root(_)2/pi^4 (qL^4)/(EI)`
Resulting trail solution will be a =`root(_)2/pi^4 (qL^4)/(EI) sin((pix)/L)`
to find max deflection subs x = 0.5
Thus the above equation is termed as deflection equation for simply supported beam with udl. If we substutie all the known values in it the value of x will remains unknown. As already stated x is nothing but any point in the length of the beam. If we substutuie the values for x the deflection for that particular point will be obtained. On plotting the lenth of the beam along the x axis and deflection along the y axis we obtain the graph, which also contains the curve for different x Values. three curve represents the soution of point collaction method is compared with the another drawn drawn based on values obtained by som equation.
Solution by weighted residual method (Galerkin method):
Galerkin methods is given by`c1=int_0^L Wi (x) Rd(x) dx =0`
where `wi(x) = sin((pix)/L)`
Rd represents the residue equation 4
substuting the values, `int_0^L(sin(pix)/L)[c1(pi/l)^4 EI(sin(pix)/L)-q].dx =0` ..................... `
The major difference between the weighted residual method and point collacation method is at point collacation we need to assume a value for x these creates the equation to deviate from the exact solution. Here that x is integrated so that the galerkin method provides the exact solution.
we have chosen only one weightning function because there is only one constant c1 to be determined. Thus we have,
`(pi/L)^4EIc1 int_0^Lsin^2((pix)/L).dx = int_0^Lqsin((pix)/L)`
yeilding the value of c1 = `(0.013071qL^4)/(EI)`
Thus the deflection `y = c1 sin((pix)/L)`=`0.013071(qL^4)/(EI)*sin((pix)/L)`
Obtain the values for different values of x along L
Thus by plotting the x axis along the length of the beam and y axis along the deflection of values obtained by above equation and the another of values obtained by som. Both the curves are found to be merges each other and their deflection values also perfectly fit each other.
7.Analysing the results obtained:
plot 1: Transverse deflection vs normalised axail location on the beam drawn based on point collaction method
Interference from the plot 1 :
- The curve drawn based on the som formula (blue graph) and its maximum deflection values are found to be perfect.
- All the curves obtained by values of point collation method are found to be different and none of the curve matches the curve of som deflection. This clearly defines that the point collacation technique is not efficient to produce the exact solution.
plot 2: Transverse deflection vs normalised axail location on the beam by weighted residual method
Interference from plot 2:
- It is clear from the plot that both the som curve and the galerkin curve of deflection merges each other throughout the entire length of the beam.
- Both the maximum deflection values are seems to be perfectly same.
- Thus the values obtained by galerkin method is effecient and found to give the exact values as the som.
Conclusion:
Thus it is clear from the obtained plots weighted residual methods are most effieciently tracing the deflection curves. The deflection and maximum deflection values yeilded by weighted residual technique is seems to be excat as of strength of materials.Hence to solve the Governing differntial equations using galerkin method will yield the proper exact solution. The plotted graphs using the Matlab is strong enough to explains the effeciency of the solution obtained.