Model infeasible for with general constraint genConsrSin
AnsweredI have trying to use Gurobi to minimize non convex function Levy (https://www.sfu.ca/~ssurjano/levy.html), and I couldn't get the optimal solution. After further digging, I found the following IIS when I manually tried to limit the solution space to around optimality:
\ Model _copy
\ LP format - for model browsing. Use MPS format to capture full model detail.
Minimize
0
Subject To
w0: - 0.25 x0 + w0 = 0.75
sin_1_in: - 3.141592653589793 w0 + sin_1_in = 0
const_sin_inter_in0: - 3.141592653589793 w0 + var_sin_inter_in0 = 1
x0upper: x0 <= 4
Bounds
w0 free
sin_1_in free
var_sin_inter_in0 free
General Constraints
sin_1_out: sin_1_out = SIN ( sin_1_in )
const_sin_inter_out0: var_sin_inter_out0 = SIN ( var_sin_inter_in0 )
End
Solving this model with gurobi_cl would result in infeasibility. However, I cannot deduce anything conflict when I try writing out the above constraints by hand. May I get any help on why the model would be infeasible?
Many thanks!
-
Official comment
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Zhizhen,
The error comes from the bounds of the resulting sin variables, the ones containing \(\texttt{out}\).
The constraints imply these variables must be negative, but the default LB of a variable is 0 (e.g. see model.addVar).
If you explicitly set the lower bound to -1 and the upper bound to 1, for these variables, the problem should be feasible.Cheers,
David1 -
Hi David:
The problem indeed is due to the range of variables. After setting the variables to correct ranges I am now able to find a feasible solution to the posted instance, and to minimize the Levy function which is my original task. Thanks a lot!
Best,Zhizhen
0
Post is closed for comments.
Comments
3 comments