Professional Documents
Culture Documents
function[a]=fit(x,y,d,r)
n=length(x);
switch(r)
case 1
c=x-d
v=c+y
l=0.5*(v+c)
h=0.5*(v-c)
t=linspace(0,pi);
z=h(4)*cos(t)+l(4);
k=h(4)*sin(t);
z1=h(3)*cos(t)+l(3);
k1=h(3)*sin(t);
o=(v(4)-v(3))/(c(4)-c(3));
cohesion=(v(4)-c(4)*o)/(2*sqrt(o));
p=2*((atan(sqrt(o))*(180/pi))-45);
i=0:1000;
n=tand(p)*i+cohesion;
plot(z,k)
hold on
plot(z1,k1),grid,title('mohr circle vs failure envelope'),xlabel('normal
stress')
hold on
plot(i,n),grid
case 2
c=x
v=c+y-d
l=0.5*(v+c);
h=0.5*(v-c);
t=linspace(0,pi);
z=h(4)*cos(t)+l(4);
k=h(4)*sin(t);
z1=h(3)*cos(t)+l(3);
k1=h(3)*sin(t);
o=(v(4)-v(3))/(c(4)-c(3));
cohesion=(v(4)-c(4)*o)/(2*sqrt(o));
p=2*((atan(sqrt(o))*(180/pi))-45);
i=0:1000;
n=tand(p)*i+cohesion;
plot(z,k),grid
hold on
plot(z1,k1),grid
hold on
plot(i,n),grid,title('mohr circle vs failure envelope'),xlabel('normal
stress')
end
end
Consolidated undrained Test
x=[50 100 150 200]
x =
y =
d=[5 10 12 18]
d =
5 10 12 18
fit(x,y,d,2)
c =
v =
cohesion =
93.9801
p =
25.1689
Unconsolidated drained test
fit(x,y,d,1)
c =
45 90 138 182
v =
l =
h =
cohesion =
83.1249
p =
28.4369