Quadratic programming: 'The problem is infeasible' error due to negative boundary limits

23 views (last 30 days)
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
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...
Naser Khan
Naser Khan on 30 Sep 2020
Hi Matt,
Please see the attached .m and .mat file to run the code.
The 'Pbmin' value is currently set to 6000 - higher than desired. However, when I lower this value to below 4207 (value from another required parameter) the solver gives me an error and does not provide any optimised values.
Could you advise what the issue is?
Many thanks,

Sign in to comment.

Accepted Answer

Matt J
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
Naser Khan
Naser Khan on 8 Oct 2020
Hi there,
Thanks for your effort. With Pbmin = -6000 I see optimised results with Matlab providing me the message below;
Minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the optimality tolerance,
and constraints are satisfied to within the default value of the constraint tolerance.
However, this does not fulfil an essential objective of mine i.e. to limit the Pbmin value to below 2000. I am unsure why this is the case, Matlab is failing to provide me with an accurate troubleshooting method. Could it be that the solver is not capable enough? I am now considering to use a third party optimizer.
Thanks
Matt J
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!