Gurobi error 10020: Constraint Q not PSD (diagonal adjustment of 5.6e+01 would be required)
回答済みHi everyone.
I am solving an optimization with a quadratic constraint:
x'*Q*x + q'*x >= c.
Q is semi-definite positive. The adjustment requested is very large, so I assume is not an approximation error. What could be the cause? I also know that the constraint is not active for the optimum in the specific instance of the optimization I am performing (the objective function is limited by some other linear constraints).
Thanks!
If someone wants to have a look at the problem, this is as follows:
\ Model matlab
\ LP format - for model browsing. Use MPS format to capture full model detail.
Maximize
4.5 a_1_s_1 + 3.5 a_1_s_2 + 2.5 a_1_s_3 + 1.5 a_1_s_4 + 0.5 a_1_s_5
+ 4.5 a_2_s_1 + 3.5 a_2_s_2 + 2.5 a_2_s_3 + 1.5 a_2_s_4 + 0.5 a_2_s_5
Subject To
R0: a_1_s_1 <= 3
R1: a_1_s_2 <= 3
R2: a_1_s_3 <= 3
R3: a_1_s_4 <= 3
R4: a_1_s_5 <= 3
R5: a_2_s_1 <= 3
R6: a_2_s_2 <= 3
R7: a_2_s_3 <= 3
R8: a_2_s_4 <= 3
R9: a_2_s_5 <= 3
R10: a_1_s_1 <= 1.758458454848485
R11: a_1_s_1 + a_1_s_2 <= 1.758458454848485
R12: a_1_s_1 + a_1_s_2 + a_1_s_3 <= 1.758458454848485
R13: a_1_s_1 + a_1_s_2 + a_1_s_3 + a_1_s_4 <= 1.758458454848485
R14: a_1_s_1 + a_1_s_2 + a_1_s_3 + a_1_s_4 + a_1_s_5 <= 1.758458454848485
R15: a_2_s_1 <= 7.435834567878438
R16: a_2_s_1 + a_2_s_2 <= 7.435834567878438
R17: a_2_s_1 + a_2_s_2 + a_2_s_3 <= 7.435834567878438
R18: a_2_s_1 + a_2_s_2 + a_2_s_3 + a_2_s_4 <= 7.435834567878438
R19: a_2_s_1 + a_2_s_2 + a_2_s_3 + a_2_s_4 + a_2_s_5 <= 7.435834567878438
R20: a_1_s_1 >= -0.1
R21: a_1_s_2 >= -0.1
R22: a_1_s_3 >= -0.1
R23: a_1_s_4 >= -0.1
R24: a_1_s_5 >= -0.1
R25: a_2_s_1 >= -0.1
R26: a_2_s_2 >= -0.1
R27: a_2_s_3 >= -0.1
R28: a_2_s_4 >= -0.1
R29: a_2_s_5 >= -0.1
R30: a_1_s_1 >= -13.24154154515152
R31: a_1_s_1 + a_1_s_2 >= -13.24154154515152
R32: a_1_s_1 + a_1_s_2 + a_1_s_3 >= -13.24154154515152
R33: a_1_s_1 + a_1_s_2 + a_1_s_3 + a_1_s_4 >= -13.24154154515152
R34: a_1_s_1 + a_1_s_2 + a_1_s_3 + a_1_s_4 + a_1_s_5
>= -13.24154154515152
R35: a_2_s_1 >= -7.564165432121562
R36: a_2_s_1 + a_2_s_2 >= -7.564165432121562
R37: a_2_s_1 + a_2_s_2 + a_2_s_3 >= -7.564165432121562
R38: a_2_s_1 + a_2_s_2 + a_2_s_3 + a_2_s_4 >= -7.564165432121562
R39: a_2_s_1 + a_2_s_2 + a_2_s_3 + a_2_s_4 + a_2_s_5
>= -7.564165432121562
qc0: - 371.6306304681818 a_1_s_1 - 289.046045919697 a_1_s_2
- 206.4614613712121 a_1_s_3 - 123.8768768227273 a_1_s_4
- 41.29229227424243 a_1_s_5 - 582.11255555453 a_2_s_1
- 452.7542098757456 a_2_s_2 - 323.3958641969611 a_2_s_3
- 194.0375185181767 a_2_s_4 - 64.67917283939222 a_2_s_5 + [
20.25 a_1_s_1 ^2 + 31.5 a_1_s_1 * a_1_s_2 + 22.5 a_1_s_1 * a_1_s_3
+ 13.5 a_1_s_1 * a_1_s_4 + 4.5 a_1_s_1 * a_1_s_5 + 12.25 a_1_s_2 ^2
+ 17.5 a_1_s_2 * a_1_s_3 + 10.5 a_1_s_2 * a_1_s_4
+ 3.5 a_1_s_2 * a_1_s_5 + 6.25 a_1_s_3 ^2 + 7.5 a_1_s_3 * a_1_s_4
+ 2.5 a_1_s_3 * a_1_s_5 + 2.25 a_1_s_4 ^2 + 1.5 a_1_s_4 * a_1_s_5
+ 0.25 a_1_s_5 ^2 + 20.25 a_2_s_1 ^2 + 31.5 a_2_s_1 * a_2_s_2
+ 22.5 a_2_s_1 * a_2_s_3 + 13.5 a_2_s_1 * a_2_s_4
+ 4.5 a_2_s_1 * a_2_s_5 + 12.25 a_2_s_2 ^2 + 17.5 a_2_s_2 * a_2_s_3
+ 10.5 a_2_s_2 * a_2_s_4 + 3.5 a_2_s_2 * a_2_s_5 + 6.25 a_2_s_3 ^2
+ 7.5 a_2_s_3 * a_2_s_4 + 2.5 a_2_s_3 * a_2_s_5 + 2.25 a_2_s_4 ^2
+ 1.5 a_2_s_4 * a_2_s_5 + 0.25 a_2_s_5 ^2 ] >= -5554.576490445143
Bounds
End
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Christian,
If \( Q \) is positive semidefinite, then the constraint \( x^\top Q x + c^\top x \leq b \) is convex, but the constraint \( x^\top Q x + c^\top x \geq b \) is not (in general). A simple example of this can be found in \( \mathbb{R}^2 \): the set \( \{ (x, y) : y^2 \leq x \} \) is convex, but the set \( \{ (x,y) : y^2 \geq x \} \) is not.
Nonetheless, Gurobi 9.0 is able to solve problems with non-convex constraints and objectives. To enable this, set the NonConvex parameter to 2.
I hope this helps. Thanks!
Eli
1
投稿コメントは受け付けていません。
コメント
2件のコメント