Hello,
I am using fmincon to solve an optimization problem where I have my initial guess equal to the lower bound (i.e. x0 = lb). When I do this, I get the error:
Your initial point x0 is not between bounds lb and ub; FMINCON shifted x0 to strictly satisfy the bounds.
I am setting the following options:
optimset('Display',NLP_display,... 'TolFun',1e-4,... 'MaxIter',200,... 'MaxFunEvals',1e4*(nState+nControl))
I looked through the code, and found the following starting at line 497:
elseif strcmpi(OUTPUT.algorithm,interiorPoint) % Variables: fixed, finite lower bounds, finite upper bounds
xIndices = classifyBoundsOnVars(l,u,sizes.nVar,true); % If honor bounds mode, then check that initial point strictly satisfies the
% simple inequality bounds on the variables and exactly satisfies fixed variable
% bounds.
if strcmpi(AlwaysHonorConstraints,'bounds') || strcmpi(AlwaysHonorConstraints,'bounds-ineqs') violatedFixedBnds_idx = XOUT(xIndices.fixed) ~= l(xIndices.fixed); violatedLowerBnds_idx = XOUT(xIndices.finiteLb) <= l(xIndices.finiteLb); violatedUpperBnds_idx = XOUT(xIndices.finiteUb) >= u(xIndices.finiteUb); if any(violatedLowerBnds_idx) || any(violatedUpperBnds_idx) || any(violatedFixedBnds_idx) XOUT = shiftInitPtToInterior(sizes.nVar,XOUT,l,u,Inf); X(:) = XOUT; shiftedX0 = true; end end end
Because lb ≤ x ≤ ub, shouldn't lines 506 and 507 be strict inequalities (because we are looking to see if the bounds are violated and not satisfied)? If more detail is needed please let me know!
Thanks, Eddie
Best Answer