I am trying to write a code for a triple integral with function of r (radius) t (theta) z
xy/2 <= z <= (x^2+2y^2) 1/2
x = rcos theta
y = r sin theta
r^2sin(theta)*cos(theta) <= z <= r^2 cos^2 theta + 2*r^2 sin^2 theta
0<= r <= 1
0 <= theta <= pi/2
I tried this to get my answer
%%% computing the integral to find the actual volume of the region
% we know our theta (t) is bounded by 0 and pi/2
% we know the radius is bounded by 0 and 1
syms r t z
theta = t;
x = @(r,t) r*cos(t);
y = @(r,t) r*sin(t);
zmin = @(x,y) x*y/2;
zmax = @(x,y) sqrt (x.^2+2*y.^2);
rmin = 0;
rmax = x.^2 + y.^2 ==1;
% rmax is 1
% since we are finding the volume with triple integral the function would
% be 1
fun = @(z,r,t) r
volumee = integral3(fun,zmin,zmax,0,1,0,pi/2)
I am trying to get this

 Réponse acceptée

Torsten
Torsten le 6 Nov 2022
Modifié(e) : Torsten le 6 Nov 2022
lower_z = @(r,theta) 0.5*r.^2.*sin(theta).*cos(theta);
upper_z = @(r,theta) r.*sqrt(cos(theta).^2+2*sin(theta).^2);
fun = @(r,theta,z) r;
value = integral3(fun,0,1,0,pi/2,lower_z,upper_z)
value = 0.5742

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by