Find the volume of the region bounded between the planes x + y + 2z = 2 and 2x + 2y + z = 4 in the first octant.

I uploaded viewSolid and viewSolidone before running the program. I do not understand why an error is showing, the program works for other equations but not for this one.

 Accepted Answer

clear
clc
syms x y z
xa=0;
xb=2;
ya=0+0*x;
yb=2-x;
za=(2-x-y)/2;
zb=4-(2*x)-(2*y);
I=int(int(int(1+0*z,z,za,zb),y,ya,yb),x,xa,xb)
viewSolidone(z,za,zb,y,ya,yb,x,xa,xb)
%Try this code, it will work.

4 Comments

can anyone explain me how to get the values of xa,xb ya,yb
actually xa values is lower limit of x and xb is highr limit for x similar case for z and y , to find these u gotta put z=0 and get y limits and then put x as 0 to get x limits

Sign in to comment.

More Answers (1)

Using this FEX download,
[A,b]=addBounds([1,1,2;2,2,1] , [2;4],[],[],[0;0;0]);
[~, volume]=convhulln(lcon2vert(A,b))
volume =
0.6667

Products

Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!