To find Volume under Surface
16 views (last 30 days)
Show older comments
Using MATLAB,calculate the volume of the solid bounded by the surface x=0; y=0; x+y+z=1 and z=0 and visualize the solid.
0 Comments
Accepted Answer
DGM
on 23 Dec 2021
Rearrange the implicit equation and observe symmetry and intersections to simplify the task.
syms x y
z0 = 0;
z1 = x+y-1;
vol = int(int(abs(z1)/2,x,0,1),y,0,1)
hold on; grid on
h1 = fsurf(z0,[0 1 0 1]);
h2 = fsurf(z1,[0 1 0 1]);
set(h1,'facealpha',0.5);
set(h2,'facealpha',1);
view(-26,16)
I'm not going to bother pruning the surfaces or plotting the vertical faces. This should suffice to make the volume understandable. There are also plenty of other examples of plotting piecewise surfaces using standard tools like surf().
0 Comments
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!