Você está na página 1de 12

DESIGN OF

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:

DATED: MARCH 8,2016

WHAT THE CODE DOES?


The following is a matlab code for checking whether a material in a given
state of stress is violating the theories of failure or not(that is; its
safe). The code proceeds in a stepwise manner, the detailed description of
which is given below;
First of all the code prompts the user to enter the behavior of the material
that is under a state of stress. It may be ductile or brittle.
After that the three stresses (two normal and one shear stress) that are
necessary to describe the 2D state of stress are taken as inputs from the
user.
The third step asks the user to enter the ultimate/yield values (both
compressive and tensile) of the material.
In the next step the two principal stresses are calculated for the planar
problem.
The program then plots the two values obtained in the previous step on a
curve of sigma one vs sigma 3 and draws a load line.
The next step uses an if/else statement to check if the material that the
user wants to test for is brittle or ductile.
If the material happens to be ductile, then another if else statement starts
whereby a check is made for the evenness of the material. If the material is
even the code applies the Max shear stress theory on the values given as
input by the user, plots the failure envelope and finds the factor of safety.
For the last part another if/else is used to check if the two principal
stresses have the same or the opposite signs. This check is done so as to
find the factor of safety in the correct manner because depending upon the
signs, the quadrants may be different and the fos has different formulae for
different quadrants. Once the appropriate if statement becomes true, the
fos is calculated by that if statement and then this theory ends.
After that comes the distortion energy theory. Just like the previous case
first of all the failure envelope is plotted using the data fed into the code
by the user. Then the factor of safety is calculated and that is used in an
if/else statement to check if the material is safe or not.
As mentioned earlier, initially a check was made for the evenness of the
material. If the material was even then all that is written above will be
executed. However if the material is uneven (ductile) then the ductile
coulomb mohr theory is used.
First of all the failure envelope for the DCM is plotted by using the
appropriate equations.
Then the code starts an if/else statement for the calculation of the factor
of safety. More than one if/else statements are actually used to cover all
the cases for the calculation of the fos. Once the fos is calculated another
if/else statement confirms if the material is safe. The criterion for safety
is simple; fos<1 means unsafe and fos>1 means safe.
If in the first if/else statement of the code, the material was found as
brittle then the above steps are all skipped and the code comes straight to
the following where the theories for the brittle material are applied to the
given stresses.
First of all the maximum normal stress theory is applied. The failure
envelope is plotted and then if/else statements are used to find the factor

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

FOR BRITTLE MATERIALS:


MAXIMUM NORMAL STRESS THEORY
MODIFIED 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

Você também pode gostar