How can i fix this errors while performing Optimization using fmincon.
古いコメントを表示
Warning: Length of lower bounds is < length(x); filling in missing lower bounds with -Inf. > In checkbounds (line 33) In fmincon (line 306) In companies1 (line 27) Warning: Length of upper bounds is < length(x); filling in missing upper bounds with +Inf. > In checkbounds (line 47) In fmincon (line 306) In companies1 (line 27) Attempt to execute SCRIPT companies1 as a function: C:\Users\shahn\Desktop\companies1.m
Error in optimfcnchk/checkfun (line 315)
f = userfcn(x,varargin{:});
Error in fmincon (line 534)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in companies1 (line 27) [x,fval,exitflag,output]=fmincon(@companies1,x0,A,B,Aeq,beq,lb,ub,[],options);
Caused by:
Failure in initial user-supplied objective function evaluation. FMINCON cannot continue.
採用された回答
その他の回答 (5 件)
NIKET shah
2018 年 4 月 20 日
0 投票
1 件のコメント
Walter Roberson
2018 年 4 月 20 日
Are you trying to constrain the first 3 out of 72 input variables? Or are you trying to work with what is really a 24 x 3 array and you want to constrain each of the rows of that to sum to 1?
NIKET shah
2018 年 4 月 20 日
0 投票
3 件のコメント
Walter Roberson
2018 年 4 月 20 日
https://www.mathworks.com/help/optim/ug/quadprog.html
NIKET shah
2018 年 4 月 20 日
Walter Roberson
2018 年 4 月 20 日
Your objective appears to me at the moment to fit within what can be done with quadprog. If I I am correct about that then you should switch to that instead, as the algorithms involved know how to divide everything up into subproblems that can each be solved exactly, and then the best is taken, leading to a global minimization.
If I have instead misread your objective (it is after 4am here), or if you choose to use fmincon even if quadprog would work, then the best you can get is a local minima.
カテゴリ
ヘルプ センター および File Exchange で Surrogate Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!