Quadratic programming: 'The problem is infeasible' error due to negative boundary limits
23 views (last 30 days)
Show older comments
Hi all,
I am working on an optimisation problem with both equality and inequality contstraints applied to a quadratic cost function. The cost function is essentially to minimise the power requirements from multiple power sources onboard an an electric vehicle. I am using the Optimization toolbox in Matlab 2018b version.
The issue arises when I am attempting to set a negative cycle (-ve power values) to one of the constraints which is lower than the maximum negative power value. Once I set this constraint value to something equal or greater than the maximum negative power value the issue disappears. However, this is undesirable in my optimisation problem. The same issue with is resolved using fmicon algorithm but the computation time is enormous. Also, I have tried using all the applicable solvers for Quadprog but to no avail.
I have attached part of my code relevant to the question without variable definitions. The issue in the code I suspect is to do with the 'Pbmin' variable which is used in constraint #4.
Thanks
2 Comments
Matt J
on 30 Sep 2020
I have attached part of my code relevant to the question without variable definitions.
Without variable defintiions, we can't run it...
Accepted Answer
Matt J
on 4 Oct 2020
Edited: Matt J
on 4 Oct 2020
I think your constraints are genuinely infeasible when Pbmin=4207. You claim that fmincon sees the problem as feasible, but that is not what I find, according to the following test.
X0 = zeros(2*N,1); %Initial guess
LB = [zeros(N,1);ones(N,1)*-Pbmin]; % P_fc > 0
UB = [4000*ones(N,1); Pbmax*ones(N,1)];
A= [zeros(N,N) (Ts/Q_bat)*tril(ones(N,N))];
b= ones(N,1)*(SoC_0 - SoC_min);
Aeq = [eye(N,N) eye(N,N)];
beq = Pv;
opts = optimoptions('fmincon','SpecifyObjectiveGradient',true,'Algorithm','sqp');
tic
[PS, fval1] = fmincon(@objfunc,X0,A,b,Aeq,beq,LB,UB,[],opts);
toc
function [fval,grad]=objfunc(x) %Objective is uniformly = 0. Doesn't matter for feasibility search
fval=0;
if nargout>1, grad=zeros( size(x) ); end
end
The result that I get from the above is
Converged to an infeasible point.
fmincon stopped because the size of the current step is less than
the value of the step size tolerance but constraints are not
satisfied to within the value of the constraint tolerance.
<stopping criteria details>
Elapsed time is 7.033446 seconds.
2 Comments
Matt J
on 8 Oct 2020
Edited: Matt J
on 8 Oct 2020
The likely cause is an error in the constraint data that you have given to the solver. Matlab can't help you troubleshoot bad input data, unfortunately, because it has no way to know what data you really intended to provide it. There's nothing wrong with a second opinion if you want to try a third party optimizer, but if you get the same result, I hope you will come back here and Accept-click my answer.
More Answers (0)
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!