Finding volume using triple integration
21 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
Risposte (3)
Yash Shingavi
il 12 Gen 2021
Modificato: DGM
il 24 Gen 2024
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 Commento
DGM
il 24 Gen 2024
Modificato: DGM
il 24 Gen 2024
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
il 29 Gen 2021
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 Commento
DGM
il 24 Gen 2024
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
il 16 Gen 2023
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 Commento
DGM
il 24 Gen 2024
Modificato: DGM
il 24 Gen 2024
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.
Vedere anche
Categorie
Scopri di più su Assumptions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!