Escolar Documentos
Profissional Documentos
Cultura Documentos
MACHINE
ASSIGNMENT#1
NASEH JAMAL
DE-35-ME-B
UNDERTAKING
I Naseh Jamal hereby undertake that I made the algorithm of
the following code in a group discussion with Ali Asghar (of my
syndicate) and Mohammad Salman (of syndicate A). However I
wrote the code on my own with a little help from my friend in
the electrical department (M Husnain DE-35-EE) and any
coincidence with my assignment may be a copy of my work
without my consent.
SIGNATURE:
of safety. After that the code checks the material for the modified brittle
mohr theory. The failure envelope is plotted and several if/else statements
are used to find the correct factor of safety for the current situation. On
the basis of this factor of safety the code then displays if the material is
safe or not.
FLOW CHART
Input: Behavior,
ductile or brittle
Inputs: Sigma x,
sigma y, tau xy
Input:Ultimate/yield
strengths
Principal stresses.
Load line.
DUCTILE
EVEN
MAX SHEAR
STRESS
THEORY,
DISTORTION
ENERGY
THEORY
FAILURE
ENVELOPES
AND FACTORS
OF SAFETY.
BRITTLE
UNEVEN
DUCTILE
COULOMB
MOHR
THEORY,
FAILURE
ENVELOPE
AND
FACTOR OF
SAFETY
EVEN OR
UNEVEN
MAXIMUM
NORMAL
STRESS
THEORY,
FAILURE
ENVELOPE
AND FACTOR
OF SAFETY
MODIFIED
BRITTLE
MOHR
THEORY,
FAILURE
ENVELOPE
AND FACTOR
OF SAFETY
THEORIES USED:
FOR DUCTILE MATERIALS:
EVEN MATERIALS:
MAXIMUM SHEAR STRESS THEORY(MSS)
DISTORTION ENERGY THEORY(DE)
UNEVEN MATERIALS:
DUCTILE COULOMB MOHR THEORY
MATLAB CODE:
behaviour= input('please enter 1 for Ductile or 2 for Brittle behaviour:" ');
disp('Please specify the sate of planar stress (all values in Mega Pascals)')
sigmaX= input('Enter the value of sigma xx: ');
sigmaY= input('Enter the value of sigma yy: ');
tauXY= input('Enter the value of tauxy: ');
ultimateT= input('Enter the ULTIMATE/YIELD value of tensile stress: ');
ultimateC= input('Enter the ULTIMATE/YIELD value of compressive stress: ');
sigma1= ((sigmaX+sigmaY)/2) + sqrt((((sigmaX-sigmaY)/2)^2)+((tauXY)^2))
sigma3= ((sigmaX+sigmaY)/2) - sqrt((((sigmaX-sigmaY)/2)^2)+((tauXY)^2))
plot([0 sigma1],[0 sigma3])
axis([-1200 1200 -1200 1200])
hold on
if behaviour==1
if ultimateT==ultimateC
%the following are the theories for
even material
fprintf('Your material is EVEN')
disp('MAXIMUM SHEAR STRESS THEORY') %Maximum shear stress theory
starts
plot([ultimateT ultimateT 0 -ultimateC -ultimateC 0 ultimateT],[0
ultimateT ultimateT 0 -ultimateC -ultimateC 0])
if or((sigma3<sigma1)&&(sigma1<0), (sigma1>sigma3)&&(sigma3>0))
%sigma 1 and sigma 3 have same signs
fprintf('the factor of safety n according to the MSS theory
is :')
if abs(sigma1)>abs(sigma3)
fos=ultimateT/sigma1
%fos= factor of safety
else
fos=ultimateC/sigma3
end
elseif sigma1>0 && sigma3<0
%Opposite signs
fos=ultimateT/(sigma1-sigma3)
end
fprintf('Distortion Energy Theory') %START of distortion energy
theory
%start of the equations for ellipse
a=sqrt(2)*ultimateT;
b=sqrt(2/3)*ultimateT;
t = linspace(0,2*pi,1000);
theta=pi/4;
x=a*cos(t)*cos(theta)-b*sin(t)*sin(theta);
y=a*cos(t)*sin(theta)+b*sin(t)*cos(theta);
plot(x,y,'r')
effectivestress=sqrt(sigma1^2+sigma3^2-(sigma1*sigma3));
disp('Factor of safety according to the Distortion Energy Theory
is')
fos= ultimateT/effectivestress
% the cases for even material ends
if fos<=1
fprintf(2, 'WARNING: MATERIAL IS OUT OF THE SAFE REGION ')
else
fprintf('MATERIAL IS SAFE ')
end
else
% if the material is UNEVEN
disp('DUCTILE COULUMB-MOHR THEORY')
plot([ultimateT ultimateT 0 -ultimateC -ultimateC 0 ultimateT],[0
ultimateT ultimateT 0 -ultimateC -ultimateC 0], 'r')
disp('Factor of safety for DUCTILE COULUMB-MOHR THEORY:')
if sigma1>0 && sigma3>0
fos=ultimateT/sigma1
elseif sigma1<0 && sigma3<0
fos=-ultimateC/sigma3
elseif sigma1>0 && sigma3<0
fos=(ultimateT*ultimateC)/((sigma1*ultimateC)(sigma3*ultimateT))
end
if fos<=1
fprintf(2, 'WARNING: MATERIAL IS OUT OF THE SAFE REGION ')
else
disp('MATERIAL IS SAFE ')
end
end
elseif behaviour==2
disp('MAXIMUM NORMAL STRESS THEORY')
%MNS START
plot([ultimateT ultimateT 0 -ultimateC -ultimateC -ultimateC 0
ultimateT ultimateT],[0 ultimateT ultimateT ultimateT 0 -ultimateC -ultimateC
-ultimateC 0])
disp('Factor of safety for MNS:')
if abs(sigma1)>=abs(sigma3)
fos=ultimateT/sigma1
else abs(sigma3)>abs(sigma1)
fos=-ultimateC/sigma3
end
%MNS END
disp('MODIFIED BRITTLE MOHR THEORY')
%MBMT START
plot([ultimateT -ultimateT -ultimateC -ultimateC 0 ultimateT
ultimateT],[ultimateT ultimateT 0 -ultimateC -ultimateC -ultimateT
ultimateT],'--g')
disp('Factor of safety for MODIFIED BRITTLE MOHR THEORY')
if abs(sigma1)>= abs(sigma3)
%Zones I
and II
fos=ultimateT/sigma1
elseif abs(sigma3)>abs(sigma1) && sigma1>=0 && sigma3<=0 %zone III
k=(((ultimateC-ultimateT)*sigma1)/(ultimateC*ultimateT))(sigma3/ultimateC);
fos=1/k
elseif sigma1<=0 && sigma3<=0
%zone IV
fos=-ultimateC/sigma3
end
%MBMT END
if fos<=1
fprintf(2, 'WARNING: MATERIAL IS OUT OF THE SAFE REGION ')
else
disp('MATERIAL IS SAFE ')
end
end
hold off
OUTPUTS:
CASE A: DUCTILE UNEVEN MATERIAL
please enter 1 for Ductile or 2 for Brittle behaviour:" 1
Please specify the sate of planar stress (all values in Mega Pascals)
Enter the value of sigma xx: 250
Enter the value of sigma yy: 350
Enter the value of tauxy: 75
Enter the ULTIMATE/YIELD value of tensile stress: 400
Enter the ULTIMATE/YIELD value of compressive stress: 600
sigma1 =
390.1388
sigma3 =
209.8612
DUCTILE COULUMB-MOHR THEORY
Factor of safety for DUCTILE COULUMB-MOHR THEORY:
fos =
1.0253
MATERIAL IS SAFE
Legend:
Red curve=failure envelope for ductile coulomb mohr theory
blue line=Load line
On x axis: sigma 1
On y axis: sigma 3
CASE B: DUCTILE UNEVEN MATERIAL
please enter 1 for Ductile or 2 for Brittle behaviour:" 1
Please specify the sate of planar stress (all values in Mega Pascals)
Enter the value of sigma xx: 300
Enter the value of sigma yy: 420
Enter the value of tauxy: -125
Enter the ULTIMATE/YIELD value of tensile stress: 500
Enter the ULTIMATE/YIELD value of compressive stress: 500
sigma1 =
498.6542
sigma3 =
221.3458
Your material is EVEN
MAXIMUM SHEAR STRESS THEORY
the factor of safety n according to the MSS theory is :
fos =
1.0027
Distortion Energy Theory
Factor of safety according to the Distortion Energy Theory is
fos =
1.1554
MATERIAL IS SAFE
LEGEND:
Red curve= failure envelope for distortion energy theory
blue curve= failure envelope for MSS
blue line= load line
On x axis= sigma 1
On y axis= sigma 3
CASE C: BRITTLE EVEN MATERIAL
please enter 1 for Ductile or 2 for Brittle behaviour:" 2
Please specify the sate of planar stress (all values in Mega Pascals)
Enter the value of sigma xx: 250
Enter the value of sigma yy: 300
Enter the value of tauxy: 150
Enter the ULTIMATE/YIELD value of tensile stress: 400
Enter the ULTIMATE/YIELD value of compressive stress: 400
sigma1 =
427.0691
sigma3 =
122.9309
MAXIMUM NORMAL STRESS THEORY
Factor of safety for MNS:
fos =
0.9366
MODIFIED BRITTLE MOHR THEORY
Factor of safety for MODIFIED BRITTLE MOHR THEORY
fos =
0.9366
WARNING: MATERIAL IS OUT OF THE SAFE REGION
LEGEND:
Green curve= MNS failure envelope
Blue curve= MM failure envelope
blue line= load line
On x axis= sigma 1
On y axis= sigma 3
CASE D: BRITTLE UNEVEN MATERIAL
please enter 1 for Ductile or 2 for Brittle behaviour:" 2
Please specify the sate of planar stress (all values in Mega Pascals)
Enter the value of sigma xx: 350
Enter the value of sigma yy: 120
Enter the value of tauxy: 75
Enter the ULTIMATE/YIELD value of tensile stress: 400
Enter the ULTIMATE/YIELD value of compressive stress: 600
sigma1 =
372.2953
sigma3 =
97.7047
MAXIMUM NORMAL STRESS THEORY
Factor of safety for MNS:
fos =
1.0744
MODIFIED BRITTLE MOHR THEORY
Factor of safety for MODIFIED BRITTLE MOHR THEORY
fos =
1.0744
MATERIAL IS SAFE
LEGEND:
Green curve= MM failure envelope
Blue curve=MNS failure envelope
blue line=load line
on x axis= sigma 1
on y axis=sigma 3