Finding volume using triple integration

21 次查看(过去 30 天)
The question is Find the volume of the region cut from the solid elliptical cylinder x2+4y2≤4 by the xy plane and the plane z=x+2
My code is
Can anyone tell where i went wrong and also please tell whether my limits are correct

回答(3 个)

Yash Shingavi
Yash Shingavi 2021-1-12
编辑:DGM 2024-1-24
This shall work :
clear
clc
syms x y z real
xa=-2;
xb=2;
ya=0+0*x;
yb=sqrt(4-x^2);
za=0+0*x;
zb=x+2;
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)
  1 个评论
DGM
DGM 2024-1-24
编辑:DGM 2024-1-24
This gives the correct answer, but for the wrong reason. The ellipse area is doubled, but only half of it is being considered.
syms x y z real
xa=-2;
xb=2;
ya=0+0*x;
yb=sqrt(4-x^2);
za=0+0*x;
zb=x+2;
I=int(int(int(1+0*z,z,za,zb),y,ya,yb),x,xa,xb)
I = 
viewSolid(z,za,zb,y,ya,yb,x,xa,xb)
axis equal

请先登录,再进行评论。


SHAIK IMRAN
SHAIK IMRAN 2021-1-29
syms x y z
xa=-2;
xb=2;
ya=0+0*x;
yb=sqrt(4-x^2)/2;
za=0+0*x;
zb=x+2;
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)
  1 个评论
DGM
DGM 2024-1-24
In this case, the ellipse geometry is correct, but since only half of it is being considered as before, this gives half of the correct answer.
syms x y z
xa=-2;
xb=2;
ya=0+0*x;
yb=sqrt(4-x^2)/2;
za=0+0*x;
zb=x+2;
I=int(int(int(1+0*z,z,za,zb),y,ya,yb),x,xa,xb)
I = 
viewSolid(z,za,zb,y,ya,yb,x,xa,xb)
axis equal

请先登录,再进行评论。


Nithish
Nithish 2023-1-16
clear
clc
syms x y z
int(int(x+2,y,0+0*x,sqrt(4-x^2)),x,-2,2)
viewSolid(z,0+0*x+0*y,x+2,y,-sqrt(4-x^2),sqrt(4-x^2),x,-2,2
  1 个评论
DGM
DGM 2024-1-24
编辑:DGM 2024-1-24
Again, this gives the correct answer, but for the wrong reason. The ellipse geometry is wrong, though both halves are being considered.
syms x y z
int(int(x+2,y,0+0*x,sqrt(4-x^2)),x,-2,2)
ans = 
viewSolid(z,0+0*x+0*y,x+2,y,-sqrt(4-x^2),sqrt(4-x^2),x,-2,2)
axis equal
The only reason that two of these answers are coincidentally right is that the major radius of the ellipse is 2, its aspect ratio is also 2, and the volume has symmetry. If all of these things weren't conveniently interchangeable (i.e. if the ellipse geometry were different), the answers would cease to be accidentally right. The half-curve is y = sqrt(4-x^2)/2, so consider twice its integral to account for symmetry.
syms x y z
int(int(x+2,y,0+0*x,sqrt(4-x^2)/2)*2,x,-2,2)
ans = 
viewSolid(z,0+0*x+0*y,x+2,y,-sqrt(4-x^2)/2,sqrt(4-x^2)/2,x,-2,2)
axis equal
.. though there are other things that would need to be considered for a more generalized calculation.
Considering the form of this answer compared to the others, it should also be fairly clear that inlining everything makes the code hard to read.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by