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!