Page 1
ENGR 112
Assignment 8
1.
x = 0:0.1:2*pi;
y = 0:0.1:2*pi;
t = 0:1.0:1200;
[X,Y] = meshgrid(x,y);
z = 3*exp(-5*10^(-4)*t);
Z = cos(x)+sin(y)+2;
surf(X,Y,Z)
xlabel(
'x'
);
ylabel(
'y'
);
zlabel(
'z'
);
shading(
'gray'
);
view(-157.5,34)
t = 0:0.1:2*pi;
find
(t)
plot(x,y,z)
xlabel(
'x'
);
ylabel(
'y'
);
zlabel(
'z'
);
2.
X = -3:0.01:3;
Y = -3:0.01:3;
Z = -2.6:0.4:2.6;
[X,Y] = meshgrid(x,y);
Z = y-y/(x.^2+y.^2);


Page 2
Meshc(X,Y,Z)
Xlabel(‘x’)
Ylabel(‘y’)
Zlabel(‘z’)
Title(‘The stream function for the streamlines of an inviscid flow over a
cylinder’)
X = -3:0.01:3;
Y = -3:0.01:3;
Z = SolveLin(x,y);
function
[x y] =
if
x.^2+y.^2<=1
X = SloveLin(x,y)
end
end
plot(x,y)
xlabel(‘x’)
ylabel(‘y’)