Skip to main content

Nonlinear constraint with two variables multiplied together and raised to some power

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    Hi Grace,

    It is possible to formulate your constraint in Gurobi with a few additional variables and equality constraints as long as your exponents \(const_2, const_3\) are \(> 0\). What you have to model in Gurobi is

    \[\begin{align*}
    w_1 &= \sum_e E_e \\
    z_{1} &= w_1^{const_2} \text{     use addGenConstrPow} \\
    z_{2,i} &= S_i^{const_3} \,\,\forall i \text{ use addGenConstrPow}\\
    V_i & \leq const_1 \cdot z_{1} \cdot z_{2,i} \,\, \forall i
    \end{align*}\]

    Link to documentation of addGenConstrPow.

    Best regards, 
    Jaromił

    0
  • Grace Jia
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromił,

    Thanks for your reply! I implemented what you suggested, and it worked. There are some follow-up questions after seeing the output message.

    1. my Q matrix is not positive semi-definite, and I would like to know how gurobi gets around with it, i.e., what algorithm it invokes and any assumptions it uses. Can I get this kind of information by looking at gurobi's documentation?

    2. My model now looks nonconvex and nonlinear. Are there any tricks for me to see where the nonconvexity shows up and potential ways to make it convex? (I'm assuming the nonlinearity is unavoidable since I'm constructing the constraint in this way.)

    3. I'm also interested in some sensitivity analysis. I'm considering adjusting the constraints to see whether I can still obtain the same solution or when the problem becomes infeasible. Does gurobi have built-in functions for that?

    Thanks much!

    Grace

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi Grace

    1. my Q matrix is not positive semi-definite, and I would like to know how gurobi gets around with it, i.e., what algorithm it invokes and any assumptions it uses. Can I get this kind of information by looking at gurobi's documentation?

    I recommend having a look at our non-convex webinar. This should be a good starting point and give you enough ideas to search for more in the literature.

    2. My model now looks nonconvex and nonlinear. Are there any tricks for me to see where the nonconvexity shows up and potential ways to make it convex? (I'm assuming the nonlinearity is unavoidable since I'm constructing the constraint in this way.)

    Any nonlinear equality constraint is automatically nonconvex. Thus, simply the reformulation into a quadratic form can already make the problem nonconvex. As long as the solver does not handle higher degree multilinear terms natively, there is no way to get around it.

    3. I'm also interested in some sensitivity analysis. I'm considering adjusting the constraints to see whether I can still obtain the same solution or when the problem becomes infeasible. Does gurobi have built-in functions for that?

    I think that Gurobi's multi-scenario feature might be helpful here.

    Best regards, 
    Jaromił

    0

Post is closed for comments.