Finding volume using triple integration

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

Antworten (3)

Yash Shingavi
Yash Shingavi am 12 Jan. 2021
Bearbeitet: DGM am 24 Jan. 2024

1 Stimme

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 Kommentar

DGM
DGM am 24 Jan. 2024
Bearbeitet: DGM am 24 Jan. 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)
I = 
viewSolid(z,za,zb,y,ya,yb,x,xa,xb)
axis equal

Melden Sie sich an, um zu kommentieren.

SHAIK IMRAN
SHAIK IMRAN am 29 Jan. 2021

0 Stimmen

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 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Nithish
Nithish am 16 Jan. 2023

0 Stimmen

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 Kommentar

DGM
DGM am 24 Jan. 2024
Bearbeitet: DGM am 24 Jan. 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)
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.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 7 Jan. 2021

Bearbeitet:

DGM
am 24 Jan. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by