-
Notifications
You must be signed in to change notification settings - Fork 0
/
steel.m
64 lines (64 loc) · 1.35 KB
/
steel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
A=importdata('steel.txt');
X=A.data(:,2);
Y=A.data(:,1);
x=X/50;
y=Y/18.625;
X1=A.data(1:10,2);
Y1=A.data(1:10,1);
x1=X1/50;
y1=Y1/18.625;
a=polyfit(x1,y1,1);
Youngs_Modulus=a(1);
display('Young_Modulus,UTS,Yield_Strength are in GPa')
display(Youngs_Modulus)
y2=a(1)*x-0.002*a(1);
i=1;
while(y(i)>y2(i))
i=i+1;
end;
x3=linspace(x(i),x(i-1),100000);
y3=a(1)*x3-0.002*a(1);
slope=(y(i)-y(i-1))/(x(i)-x(i-1));
y4=slope*x3-slope*x(i)+y(i);
j=1;
while(y4(j)<=y3(j))
j=j+1;
end;
Yield_Strength=y4(j);
display(Yield_Strength)
UTS=max(y);
display(UTS)
k=1;
while(y(k)<UTS)
k=k+1;
end;
m=1;
while(y4(j)>=y(m))
m=m+1;
end;
Pl=A.data(m-1:k,2);
St=A.data(m-1:k,1);
Plastic_strain=Pl/50;
Stress=St/18.625;
true_strain=log((Plastic_strain)+1);
true_stress=Stress.*(Plastic_strain+1);
q=log(true_strain);
p=log(true_stress);
t=polyfit(q,p,1);
K=exp(t(2));
strain_exponent=(t(1));
display(K)
display(strain_exponent)
hold on;
x4=0.002:0.0001:0.004;
y4=a(1)*x4-0.002*a(1);
plot(x,y,'r*');
plot(x4,y4,'b:');
plot(x1,y1,'g*');
plot(true_strain,true_stress,'y','LineWidth',3);
axis('square');
xlabel('Strain (\epsilon ) ','Fontsize',16);
ylabel('Stress (\sigma), MPa', 'Fontsize',16);
title('Engineering Stress Strain curve', 'Fontsize',14);
Ductility=x(length(x));
display(Ductility)