0% found this document useful (0 votes)
16 views21 pages

Digital Assessment 1

Uploaded by

pmkavinkumar45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views21 pages

Digital Assessment 1

Uploaded by

pmkavinkumar45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

DIGITAL

ASSESSMENT-4

NAME: KAVIN.M
REG NO: 24BEE0063
STAFF NAME:BALA ANKI
REDDY
ASSESSMENT ON
MATLAB
Question 1.

Find the volume of the solid S that is bounded


by the Elliptic Paraboloid x^2+2y^2+z=16 the
planes x=2 and y=2 and the Three coordinate
planes. Plot the graph with necessary things.
CODE ON MATLAB:

Syms x y z
Xa = 2;
Xb = 4;
Ya = 2;
Yb = sqrt((16 – x^2) / 8);
Za = 0;
Zb = 16 – 2 * y^2 – x^2;
Volume = int(int(int(1 + 0*z, z, za, zb), y, ya, yb),
x, xa, xb);

Disp(vpa(volume));
[X, Y] = meshgrid(linspace(xa, xb, 100),
linspace(ya, ya, 100));
Z_lower = zeros(size(X));
Z_upper = 16 – 2 * Y.^2 – X.^2;
Figure;
Surf(X, Y, Z_lower, ‘FaceColor’, ‘b’, ‘FaceAlpha’,
0.5); hold on;
Surf(X, Y, Z_upper, ‘FaceColor’, ‘r’, ‘FaceAlpha’,
0.5);
Xlabel(‘X’);
Ylabel(‘Y’);
Zlabel(‘Z’);
Title(‘Volume Boundaries between Z_{lower}
and Z_{upper}’);
Grid on;

OUTPUT:

Volume:3.627148831466533498677799689211

GRAPH:
QUESTION-2:

Find the volume of the region bounded


between the planes x +y +2*z=2
and2*x+2*y+z=4. In the first octant.

CODE ON MATLAB:
Syms x y z
Xa = 0;
Xb = 2;
Ya = 0;
Yb = 2 – x;
Za = 4 – 2*x – 2*y;
Zb = (2 – x – y) / 2;
I = int(int(int(1 + 0*z, z, za, zb), y, ya, yb), x, xa, xb);
Disp(‘The result of the integral is:’);
Disp(vpa(I));
[X, Y] = meshgrid(linspace(xa, xb, 100), linspace(ya,
2, 100));
Z_lower = 4 – 2*X – 2*Y;
Z_upper = (2 – X – Y) / 2;
Figure;
Surf(X, Y, Z_lower, ‘FaceColor’, ‘b’, ‘FaceAlpha’,
0.5);
hold on;
Surf(X, Y, Z_upper, ‘FaceColor’, ‘r’, ‘FaceAlpha’,
0.5);
Grid on;
Hold off

OUTPUT:
The result of the integral is:2.0

GRAPH:
Question 3.

Code on Matlab:

syms x y
f=exp(x)*cos(1+y);
as=taylor(f,[x,y],[1,pi/4],'order',6)
subplot(1,2,1);
ezsurf(f);
subplot(1,2,2);
ezsurf(as)

OUTPUT:

as=
exp(1)cos(pi/4 + 1) + exp(1)*cos(pi/4 + 1)(x - 1) -
(exp(1)cos(pi/4 + 1)(y - pi/4)^2)/2 + (exp(1)cos(pi/4
+ 1)(y - pi/4)^4)/24 + (exp(1)sin(pi/4 + 1)(y -
pi/4)^3)/6 - (exp(1)sin(pi/4 + 1)(y - pi/4)^5)/120 +
(exp(1)cos(pi/4 + 1)(x - 1)^2)/2 + (exp(1)cos(pi/4 +
1)(x - 1)^3)/6 + (exp(1)cos(pi/4 + 1)(x - 1)^4)/24 +
(exp(1)cos(pi/4 + 1)(x - 1)^5)/120 - exp(1)sin(pi/4 +
1)(y - pi/4) - (exp(1)sin(pi/4 + 1)(y - pi/4)(x - 1)^2)/2 -
(exp(1)*sin(pi/4 + 1)(y - pi/4)(x - 1)^3)/6 +
(exp(1)*sin(pi/4 + 1)(y - pi/4)^3*(x - 1))/6 -
(exp(1)sin(pi/4 + 1)(y - pi/4)(x - 1)^4)/24 -
(exp(1)*cos(pi/4 + 1)(y - pi/4)^2*(x - 1)^2)/4 -
(exp(1)cos(pi/4 + 1)(y - pi/4)^2*(x - 1)^3)/12 +
(exp(1)sin(pi/4 + 1)(y - pi/4)^3*(x - 1)^2)/12 -
exp(1)sin(pi/4 + 1)(y - pi/4)(x - 1) - (exp(1)*cos(pi/4
+ 1)(y - pi/4)^2*(x - 1))/2 + (exp(1)cos(pi/4 + 1)(y -
pi/4)^4*(x - 1))/24

GRAPH:
Question 4:
Find tha maximum and minimum of
f(x,y)=x^3+3xy^y-15x^2-15y^2+72x

CODE ON MATLAB:

clc
clear all
syms x y
f = x^3-(3*x*y^2)-(15*x^2)-(15*y^2)+72*x
fx = diff(f,x);
fy = diff(f,y);
[xc,yc] = solve(fx,fy,x,y);
disp('Critical Points')
[xc,yc]
r = diff(fx,x); % r=fxx
s = diff(fx,y); % s=fxy
t = diff(fy,y); % t=fyy
D = r*t-s^2;
a=size(xc);
for i=1:1:a(1)
disp('critical point:')
[xc(i) yc(i)]
p=subs(D,{x,y},{xc(i),yc(i)});
q=subs(r,{x,y},{xc(i),yc(i)});
if p>0
if q>0
disp('minimum point')
disp('minimum value of f:')
subs(f,{x,y},{xc(i),yc(i)})
elseif q<0
disp('maximum point')
disp('maximum value of f:')
subs(f,{x,y},{xc(i),yc(i)})
else
disp('further investigation is required')
end
elseif p<0
disp('saddle point')
else
disp('further investigation is required')
end
end
ezsurf(f,[-1.5,1.5,-1.5,1.5]);
OUTPUT:

f =x^3 - 15*x^2 - 3*x*y^2 + 72*x - 15*y^2


Critical Points ans =[ 4, 0],[ 6, 0],[-5, -3*11^(1/2)],[-
5, 3*11^(1/2)]
critical point:ans =[4, 0]
maximum point
maximum value of f:ans =112
critical point:ans =[6, 0]
saddle point
critical point:ans =[-5, -3*11^(1/2)]
saddle point
critical point:ans =[-5, 3*11^(1/2)]
saddle point
GRAPH:
Question 4:

O Find the maxima and minimum of


sin(x)siny(y)sin(x+y)>sketch the graph of the
function f (x,y) with nessary formatting:
CODE ON MATHLAB:

clc
clear all
syms x y
f = sin(x)*sin(y)*sin(x+y)
fx = diff(f,x);
fy = diff(f,y);
[xc,yc] = solve(fx,fy,x,y);
disp('Critical Points')
[xc,yc]
r = diff(fx,x); % r=fxx
s = diff(fx,y); % s=fxy
t = diff(fy,y); % t=fyy
D = r*t-s^2;
a=size(xc);
for i=1:1:a(1)
disp('critical point:')
[xc(i) yc(i)]
p=subs(D,{x,y},{xc(i),yc(i)});
q=subs(r,{x,y},{xc(i),yc(i)});
if p>0
if q>0
disp('minimum point')
disp('minimum value of f:')
subs(f,{x,y},{xc(i),yc(i)})
elseif q<0
disp('maximum point')
disp('maximum value of f:')
subs(f,{x,y},{xc(i),yc(i)})
else
disp('further investigation is required')
end
elseif p<0
disp('saddle point')
else
disp('further investigation is required')
end
end
ezsurf(f,[-1.5,1.5,-1.5,1.5]);
OUTPUT:

F=sin(x + y)*sin(x)*sin(y)

Critical Points ans =[ 0, 0],[ pi, 0],[ 0,


pi] ,[ (2*pi)/3, -pi/3],[-(2*pi)/3, pi/3]
[ pi/3, -(2*pi)/3],[ -pi/3, (2*pi)/3]
critical point:ans =[0, 0]
further investigation is required
critical point:ans =[pi, 0]
further investigation is required
critical point:ans =[0, pi]
further investigation is required
critical point:ans =[(2*pi)/3, -pi/3]
minimum point
minimum value of f:
ans =-(3*3^(1/2))/8
critical point:ans =[-(2*pi)/3, pi/3]
maximum point
maximum value of f:ans = (3*3^(1/2))/8
critical point:ans =[pi/3, -(2*pi)/3]
maximum point
maximum value of f:ans =(3*3^(1/2))/8
critical point:ans =[-pi/3, (2*pi)/3]
minimum point
minimum value of f:ans =-(3*3^(1/2))/8
GRAPH:

You might also like