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!