Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I am failing to get the optimized values of the decision variables. Please help

조회 수: 1 (최근 30일)
Pankaj Dey
Pankaj Dey 2015년 3월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
My code is as follows:
f = @(x)(((0.0002*((x(1)^2)*x(2)/9.81)^2)-(0.876*(x(1)^2)*x(2)/9.81)/(5.2868+(3310/((x(1)^2)*x(2)/9.81))))/(240.59*(x(1)^3)*(x(2)^2)));
[x,fval] = fminsearch(f,[1480, 0.14]);
Matlab command window's response:
Exiting: Maximum number of function evaluations has been exceeded - increase MaxFunEvals option. Current function value: -1551659114344406700000000000000000000000.000000

답변 (1개)

John D'Errico
John D'Errico 2015년 3월 26일
So, you don't think this function might be unbounded? -1.5517e+39 is a really big negative number.
Increasing the iteration limit will not help, just get you closer to -inf.. But again, -1.5517e+39 is reasonably close to -inf. How much more negative do you want it to be?
I think fminsearch is working quite well here. You just don't like the answer it gives you, but that means that you have a poor choice of objective function.
Try plotting the surface. For example, try this:
f = @(x1,x2)(((0.0002*((x1.^2).*x2/9.81).^2)-(0.876*(x1.^2).*x2/9.81)./(5.2868+(3310./((x1.^2).*x2/9.81))))./(240.59*(x1.^3).*(x2.^2)));
ezsurf(f)
Do you honestly think this function is a good choice to optimize?

Community Treasure Hunt

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

Start Hunting!

Translated by