help with numerical analysis

조회 수: 2 (최근 30일)
francis
francis 2013년 7월 24일
if true
fplot('pi*x*sqrt((x)^2+((750/pi)^2)/(x)^4)',[0,10]);
[R fmin]=fminbnd('pi*x*sqrt((x)^2+((750/pi)^2)/(x)^4)',0,8);
h=170/(pi*R^2);
grid on
fprintf('The Value of R is %5.4f cm and the Height is %5.4f cm\n',R,h)
end
a paper cup shaped as a cone is designed to have a volume of 250cm^3. Determine the radius R and height h such that the least amount of paper will be used for making cup my answers came up as
Value of R is 5.5267 cm and the Height is 1.7716 cm but the book says is Value of R is 6.9632cm and the height is 4.9237 any advice or any mistakes that you can point out, thanks

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 7월 24일
편집: Andrei Bobrov 2013년 7월 24일
syms R H V real
H = 3*V/(pi*R^2);
S = subs(pi*R*sqrt( R^2/4+H^2 ),V,250);
Rout = double(solve(diff(S,R),R));
Rout = Rout(Rout>0&imag(Rout)==0)
Hout = double(subs(H,{V,R},{250,Rout}))
OR
[R fmin]=fminbnd(@(x)pi*x.*sqrt(x.^2/4+(750/pi)^2./x.^4),0,8)
  댓글 수: 1
francis
francis 2013년 7월 24일
thanks for your help , I try to type your first part and it gives me this error code, how can I solve that? thanks again ??? Error using ==> sym.subs at 214 Elements of the substitution cell array must be of the same size.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Raghavendra
Raghavendra 2013년 7월 24일
Basically the equation for cone says Volume(V)= (Pi*r*r*h)/3; You have two unknown variable, Lets assume the radius = 2, then you can use this formula to find out the Height.

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by