You are on page 1of 2

ASSIGNMENT 2

ADVANCED SOIL MECHANICS

CEC51104

MATLAB CODE TO SHOW THE VARIATION OF U with (z/H) and Tv


By
RAHUL SINHA
(18 MT 0347)

SNAPSHOT IN MATLAB:
CODE:
clc
clear
close all
for j=0.1:0.1:0.9
Tv=j;
for i=0:0.01:2
zh=i;
s=0;
for m=0:1:10000
M=(2*m+1)*pi/2;
ds=(2/M)*sin(M*zh)*exp(-M^2*Tv);
s=s+ds;
end
U=1-s;
plot(U,zh)
title('Graph showing variation of U with Z/H and Tv')
xlabel('Value of U');
ylabel('value of z/H');
hold on
end
hold on
end
RESULT