How to include negative exponent in model
Awaiting user inputHi everyone,
Now I have a constraint of y=x^-0.5, where y and x are both decision variables. When I code the constraint as below in my model. Result shown that the model is infeasible. But when I make -0.5 becomes 0.5, the model works. If someone have ideas on how to solve this problem?
model.addGenConstrPow(x,y,-0.5)
Thanks in advanced !
Best regards
0
-
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,
addGenConstrPow(x, y, a) should accept a=-0.5 as an argument. But there are a few things to note.
- If the exponent a is negative, the lower bound on x must be strictly positive.
- If the exponent isn’t an integer, the lower bound on x must be non-negative.
You can also use computeIIS() to see why it is Infeasible. Please see: How do I determine why my model is infeasible?
Regards,
Ryuta0
Post is closed for comments.
Comments
2 comments