How can i fix this errors while performing Optimization using fmincon.
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (5)
NIKET shah
il 19 Apr 2018
0 voti
NIKET shah
il 19 Apr 2018
0 voti
NIKET shah
il 20 Apr 2018
0 voti
1 Commento
Walter Roberson
il 20 Apr 2018
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
il 20 Apr 2018
0 voti
NIKET shah
il 20 Apr 2018
0 voti
3 Commenti
Walter Roberson
il 20 Apr 2018
https://www.mathworks.com/help/optim/ug/quadprog.html
NIKET shah
il 20 Apr 2018
Walter Roberson
il 20 Apr 2018
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.
Categorie
Scopri di più su Surrogate Optimization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!