FMINCON showing x0 not between lb and ub, though my x0 is strictly between limits.
66 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Debapriya Sengupta
am 5 Jan. 2022
Kommentiert: Matt J
am 6 Jan. 2022
I am using FMINCON with Interior Point algorithm.
My initial guess x0=[-5.5, -0.5, -0.5].
Lower bound: lb=[-6, -1, -1]
Upper bound: ub=[-4, 1, 1]
While running the code, I am getting the message "Your initial point x0 is not between bounds lb and ub; FMINCON shifted x0 to strictly satisfy the bounds".
Can someone please explain why?
2 Kommentare
Mike Croucher
am 5 Jan. 2022
Could you post more of your code please? Enough for us to reproduce the error message.
Akzeptierte Antwort
Walter Roberson
am 5 Jan. 2022
It has something to do with the fact you are using GlobalSearch: some of the runs might be generating initial values out of bounds while others might generate in-bounds x0.
x0=[-5.5,-0.5,-0.5];
opt=optimoptions('fmincon','Display','iter');
gs=GlobalSearch;
problem=createOptimProblem('fmincon','x0',x0,'objective',@Reg_3D_OF_Func,'lb',[-6,-1,-1],'ub',[-4,1,1],'options',opt);
[x,fval,exitflag,output]=run(gs,problem)
function y = Reg_3D_OF_Func(x)
y = sum((x - [-4.7 .8 -.62]).^2);
end
5 Kommentare
Weitere Antworten (1)
Matt J
am 5 Jan. 2022
Bearbeitet: Matt J
am 5 Jan. 2022
That might happen if you have additional, tighter box bounds encoded into your linear inequality constraint matrices A,b..For example, if one of the rows of your A,b data were
A(i,:)=[0,0,-1]; b(i)=0; %equivalent to x(3)>=0
then fmincon preprocessing would delete this row and convert lb(3) to zero. Once the input data has been simplified in this way, x0(3) would then violate the bounds.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!