Did I do it right?Or I'm miss-interpreting the question?I'm so confused!!
Show older comments
Hi all, I'm trying to Write a program to calculate the volume under x^2 +1 curve when the curve is rotated around the x axis. The Integration of x from 0 to 3 with an increment of 0.1 using the disk method.Then Add to the above program, saving each value of the integral as well as the x coordinates in arrays, and plotting them to show the change in volume (of the revolution) as x goes from 0 to 3.0.We didn't have integration on MATlab class yet so I used the method:
l = 0.1;
for index = 1:30;
x(index) = (index-1)*0.1;
y1(index) = pi*((x(index).^2 +1)^2)*l;
y2(index) = (-pi*((x(index).^2 +1)^2)*l);
end
%PLOT x VERSUS y
plot(x,y1,'m*-',x,y2,'b^--');
However,I'm not confident with my approach.If I just do y1,erasing y2,I get a graph of a simple curve,which doesn't represent any 'change of volume' asked by original question.That's why I used y2 as a function of y1,but the negative one,which goes on the -y coordinate,just to make it analogous with the disk method of integration rotating around x axis.I'm very confused!I'm not sure if that's what 'the change of volume' asks.Or should I think about graphing in three dimension?If so then how do I do that?
Accepted Answer
More Answers (0)
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!