You are on page 1of 2

% simply supported beam with single point load

% * Support reaction
% * Maximum Bending Moment
% * Shear force diagram
% * Bending Moment daigram
clc; clear; close all
disp('%%% Simply Supported Beam SFD BMD %%%');
% Input section
disp(' ');L = input('Length of beam in millimeter = ');
disp(' '); W = input('Load applied in N = ');
disp(' '); a = input('Location of Load from left end of the beam in millimeter =
');
c = L-a;
R1 = W*(L-a)/L; % Left Support Reaction.
R2 = W*a/L; % Right Support Reaction.
% dividing of x axis.
n = 1000; % Number of division of x axis.
delta_x = L/n; % Increment for division of x axis.
x = (0:delta_x:L)'; % Generate column array for x-axis.
SF = zeros(size(x, 1), 1); % Shear force function of x.
BM = zeros(size(x, 1), 1); % Bending moment function of x.
% for condition for main calculation
for xx = 1:n+1
% First portion of the beam, 0 < x < a
SF(xx) = R1;
BM(xx) = R1*x(xx);
% Second portion of the beam, a < x < L
if x(xx) >= a
SF(xx) = R1-W;
BM(xx) = R1*x(xx)-W*(x(xx)-a);
end
end
Mmax = W*a*(L-a)/L;
disp(' ');disp (['Left support Reaction' ' = ' num2str(R1) ' ' 'N'])
disp(' ');disp (['Right support Reaction' ' = ' num2str(R2) ' ' 'N'])
disp(' ');disp (['Maximum bending moment' ' = ' num2str(Mmax) ' ' 'Nmm'])
figure(1)
area(x,SF);
grid on
colormap cool
set(gca,'Layer','top')
xlabel('L,millimeters');
ylabel('w,kgs');
title('Shear force diagram')
axis tight
figure(2)
area(x,BM);
grid on
colormap summer
set(gca,'Layer','top')
xlabel('L,millimeters');
ylabel('m,kgs-mm');
title('Bending Moment diagram')

axis tight
%------------------------------------------------------------------------%------------------------------------------------------------------------%* sigma valve for the given beam from Mmax b &Ixx
disp(' ');disp('%%% sigma calculation %%%');
disp(' '); b = input('depth of beam in millimeter = ');
y = b/2;
Ixx=input('moment of inertia of beam along xx axis in millimeter^4 = ');
sigma = (Mmax*y)/Ixx;
disp(' ');disp (['sigma max ' ' = ' num2str(sigma) ' ' 'N/mm^2'])
sigmaallowable = 250; %mild steel sigma allowable valve is 250 MPa
factorofsafety =(sigmaallowable/sigma);
disp(' ');disp (['factor of safety ' ' = ' num2str(factorofsafety) ' ' ])
%------------------------------------------------------------------------%------------------------------------------------------------------------%* deflection plot and maximum value of deflection Ymax
disp(' ');disp('%%% deflection calculation %%%');
disp(' ');e=input('youngs modulus of material used (mild steel) in newton/millim
eter^2 = ');
y1 = zeros(size(x, 1), 1);
for xx1 = 1:n+1
% First portion of the beam, 0 < x < a
y1(xx1) =(1/(e*Ixx)).*((W.*(x(xx1).^3)/12)-((W.*(L.^2).*x(xx1))/16));
% Second portion of the beam, a < x < L
if x(xx1) >= a
y1(xx1) = (1/(e*Ixx)).*((W.*(x(xx1).^3)/12)-((W.*(x(xx1)-L/2).^3)/6)-((W.*(L
.^2).*x(xx1))/16)) ;
end
end
ymax=-(W*(L^3)/(48*e*Ixx));
disp(' ');disp (['Ymax maximum deflection value ' ' = ' num2str(ymax) 'mm ' ])
disp(' ');disp('at x=L/2 distance from the left end of the beam ');
figure(3)
plot(x,y1,'r','LineWidth',2.5)
line(x,0)
legend({'deflection curve' 'when no deflection'})
xlabel('L,millimeters');
ylabel('y,millimeters');
title('deflection')
%------------------------------------------------------------------------%------------------------------------------------------------------------%* buckling of the column calculation
disp(' ');disp('%%% buckling of column %%%');
disp(' ');lcolumn = input('legnth of the column in millimeter = ');
pactual=W/4;
pcrippling=((pi^2)*e*Ixx)/(lcolumn^2) ;
blf=(pcrippling/pactual);
disp(' ');disp (['crippling load Pcrippling ' ' = ' num2str(pcrippling) ' N ' ])
disp(' ');disp (['Buckling Load Factor BLF ' ' = ' num2str(blf) ' ' ])
if pactual > pcrippling
disp(' ');disp('buckling happens');
else
disp(' ');disp('buckling not happens');
end

You might also like