Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Am I wrong? need help with a question

1 回表示 (過去 30 日間)
slowlearner
slowlearner 2020 年 8 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I've starring my self blind at this one the question is as follows:
Write a program which calculates the volume of the body that acumulates by the curve when y =x^2, 1<x<2, rotates around the x-axis. that is to say write a program which calculates the volume according to the integral below
hint: the command integral can be used to calculate the integral
Now my first thoughts was to do some napkin maths becouse the x^4 didn't seem like the correct integration of the y equation. I couldn't see how the result would be x^4 with pi included either and you can't calculate the volume of a rotating body without pi, i mean you could but its not cool. I dicided to write what i was thinking would be a correct calculation of the equation in the following way:
%% c i'm confused f(x)=x^2 ~F(x)=x^4 sens F'(x)=4x^3
%and isn't volume missing pi becouse of the rotation?
clear x x1 x2 y f G X Y;
% figure(3);
deex = 0.001; %the increment of which you move along the x axis which is 1/10th times smaller than normal linspace
x = 1:deex:2; %length of the "sample"
radius = x.^2; %radius of the "disc" at each x
area = pi*radius.^2; %area of each disk
volumeis = cumtrapz(area*deex); %comulative trapezoidal rule applied here showing a comulative volume for each calculated area at x
now i know that cumtrapz might not be nessecary here but i've never used it and i thought it would be cool. however supposedly it's wrong and i fail to see where any feedback would be nice.

回答 (1 件)

Antonio Ciociola
Antonio Ciociola 2020 年 8 月 17 日
Your question might contain some error, I believe..
The correct formula should be:
And the Volume can be calculated in this way:
volumeis = cumsum(area*deex);
What do you think?
  2 件のコメント
Antonio Ciociola
Antonio Ciociola 2020 年 8 月 17 日
Of course you can use also "cumtrapz".
You can use both "cumsum" and "cumtrapz" but keep in mind that these functions are different approximation of the integral that you're trying to evaluate.
slowlearner
slowlearner 2020 年 8 月 18 日
Ok well apparently we are both wrong then.

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by