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
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
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)
viewSolid(z,za,zb,y,ya,yb,x,xa,xb)
axis equal
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
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)
viewSolid(z,za,zb,y,ya,yb,x,xa,xb)
axis equal
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
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)
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)
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 Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!