How can I sketch correctly?
2 views (last 30 days)
Show older comments
I got this question:
Evaluate the volume V of the solid Ω that lies under the paraboloid z = x^2+y^2 , and above the circular region in the xy−plane x^2 + y^2 = 2x. Sketch the given solid.
This is what I have done, I do not know how to erase the extra part so that I can get the solid satisfying the question. Can anyone help me solving this issue?
Thank you for reading.
%Calculation
syms r phi
func = r.^3;
rmax = 2.*cos(phi);
result = int(int(func, 0, rmax), 0, 2*pi);
disp('Result: '), disp(result);
%draw the paraboloid
phi = linspace (0, 2*pi, 30);
r = linspace(0, 2, 30);
[r, p] = meshgrid(r, phi);
x = r.*cos(p);
y = r.*sin(p);
z = x.^2 + y.^2;
surf(x, y, z, 'FaceColor', 'g', 'FaceAlpha', 0.3);
hold on
%draw the cylinder
x1 = linspace(0, 2, 500);
z1 = linspace(0, 4, 500);
[x1,z1] = meshgrid(x1,z1);
y1 = sqrt(-x1.^2 + 2.*x1);
y2 = -sqrt(-x1.^2 + 2.*x1);
surf(x1, real(y1), z1,'FaceColor','b','FaceAlpha',0.5,'EdgeColor','none'); %real for drawing complex number
hold on;
surf(x1, real(y2), z1,'FaceColor','b','FaceAlpha',0.5,'EdgeColor','none');
hold on;
xlabel('x');
ylabel('y');
zlabel('z');
rotate3d on

2 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
