coneprog: Infeasibilities are satisfied in last step from iterative display but exitflag is still -2 (NoFeasiblePointFound)
Show older comments
I am trying to solve a trajectory optimization problem with coneprog under the problem-based approach and am having convergence issues. The last iteration of the iterative display appears to show that the problem is feasibly solved:
Iter Fval Primal Infeas Dual Infeas Duality Gap Time
1 0.000000e+00 2.989297e-01 2.661135e-01 2.396722e-03 0.01
2 1.671582e+00 1.371375e-01 1.220827e-01 1.099524e-03 0.02
3 3.247714e+00 4.683911e-02 4.169716e-02 3.755409e-04 0.02
4 5.466823e+00 2.962828e-02 2.637572e-02 2.375500e-04 0.02
5 6.748515e+00 1.679716e-02 1.495319e-02 1.346743e-04 0.02
6 3.367365e+00 1.788542e-03 1.592198e-03 1.433995e-05 0.03
7 5.484853e+00 4.005449e-06 3.565735e-06 3.211443e-08 0.03
8 5.484859e+00 6.005173e-09 5.346126e-09 4.817329e-11 0.04
9 5.484864e+00 1.200136e-11 1.091778e-11 1.141043e-13 0.04
However, I am still getting a -2 exit flag and the message:
Problem is infeasible.
Is there anyway to extract anymore information about why this solution is infeasible? The functions where the solver operations occur are .p files so I can't find what's going wrong on the inside. Also, when a solution is returned infeasible all output fields are empty except the error message. I am using optimality and constraint tolerances of 1e-8 for reference, but even when I drop them down to 1e-1 just for the sake of trying to get a feasible solution returned it still does not work. Does this mean maybe that the solution converges but upper/lower bounds are violated? Any advice would be much appreciated.
15 Comments
I suggest setting MaxIterations=9 which, judging from the iterative display that you posted, should force the algorithm to terminate at the 9th iteration with exitflag=0. Then the output arguments from coneprog() should be non-trivial and you can better inspect whether the solution x up to that point is truly feasible or infeasible.
Torsten
on 8 Jul 2022
I mean: Can't you use "fsolve" to determine a feasible point before you call "coneprog" ?
Yes, or use fmincon to find the nearest feasible point to your initial point. If fmincon comes up empty, that will add to the evidence that your problem is infeasible. Regardless, with fmincon, you will definitely be able to track the iteration history using the OutputFcn option.
Nick
on 9 Jul 2022
Bruno Luong
on 9 Jul 2022
Edited: Bruno Luong
on 9 Jul 2022
"exitflag — Reason coneprog stopped -2: No feasible point was found."
What else information do you need?
If you are looking for a fish that living in mars and MATLAB tells you it doesn't exist, do you want to know it because you ask for a "fish" or because you ask for "living in mars"? The right answer is neither, but both combined is impossible.
Bruno Luong
on 9 Jul 2022
Indeed but OP asks why the solver does not tell more details when it says it fails to detect feasible point. What the solver can tell more????
Torsten
on 9 Jul 2022
I would have expected that coneprog at least reports the actual x-value after "MaxIterations" iterations.
Bruno Luong
on 9 Jul 2022
Edited: Bruno Luong
on 9 Jul 2022
If that is the case it's easy, just make a wrapper around the p function and capture the last call input. I still don't understand how he would use it. But can we just let him answer the question?
Nick
on 4 Aug 2022
Alan Weiss
on 4 Aug 2022
The solver is designed to return empty outputs for infeasible problems. Otherwise, people are tempted to use the outputs as solutions, which they are not.
If you want to investigate why your problem is infeasible, you can try relaxing constraints until you get a feasible solution. There are several ways of relaxing constraints. You can give a linear constraint more room, such as writing A*x <= b + 10, or some other positive added constant other than 10. For cone constraints you can include them one at a time until your problem becomes infeasible. Or you can relax them similarly to the linear constraint: \norm(A*x - b) <= d*x - gamma + 10, or some other positive added constant instead of 10. Sometimes it is an interaction between bounds and other constraints that makes a problem infeasible.
You mentioned that you are doing a trajectory optimization problem. If it is similar to the one in the documentation, then I suggest that you model your problem on the problem in the documentation, which works, and change things one at a time until you reach an issue.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Nick
on 4 Aug 2022
Torsten
on 4 Aug 2022
Can you show how to "make a wrapper around the p function and capture the last call input" ? I honestly don't know how this can be done in the case of "coneprog".
Accepted Answer
More Answers (0)
Categories
Find more on Linear Least Squares 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!