Primal infeasibility error on simple convex combination problem #619
Replies: 1 comment
-
There was nothing wrong with the way I modeled it, the problem was the osqp version. Version 0.6.0, the one that I was using, was giving primal infeasibility for some reason. I tested it with the latest stable version 0.6.3 and new current version 1.0.0.beta0 and they both work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I came across your library and have been trying to apply a simple convex combination problem to it but I keep getting primal infeasibility when adding the boundary constraints for the problem.
minimize$\ || Ax - b || $ $\ \; x >= 0$ and $\ \sum(x) = 1 $
s.t.
I have used Julia software to run the same problem (not with the same QP library) therefore I know it should work, I just figured I'm modelling it incorrectly using your library.
I rewrote the least squares problem in the form of$\ x^TPx + q^Tx$ where $\ P = A^TA$ and $\ q = -b^TA $ . In this case, $\ A$ is a 2-by-n matrix describing the input points, $x$ is an n-by-1 vector describing the weights of the convex combination and $b$ is a 2-by-1 vector describing the point that the weighted linear combination $\ Ax$ needs to add up to.
My objective matrix is$\ P$ and my objective vector is $\ q$ . If I just place a 1-by-n vector of 1's as the constraint matrix and a lower and upper bound of 1.0 (that just models the sum constraint of the problem), I get correct results in the sense that they add up to 1.0 and $\ Ax$ equals to $\ b$ (however they are a mix of positive and negative numbers). When I add the boundary conditions ($\ x >= 0$ ) I start running into the primal infeasibility problem.
Given three input points (as an example), I would construct the constraint matrix as a 4-by-3 matrix, where the first row would be all 1's for the sum constraint and the bottom 3-by-3 would be an identity matrix for the inequality constraints, and the lower and upper bounds would be 4x1 vectors where the first value is 1.0 for both (sum constraint) and the remaining ones would be 0.0 and +infinity respectively. I have tried with different combinations of lower and upper bounds but I always keep getting primal infeasibility. Is this problem something that the library cannot model or did I model it incorrectly?
Thank you very much for your time!
Beta Was this translation helpful? Give feedback.
All reactions