Skip to main content

Adding a quadratic constraint as a ratio of two expressions to a model

Answered

Comments

3 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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi Syed,

    Did you have a look at our Knowledge Base articles How do I model multilinear terms in Gurobi? and How do I divide by a variable in Gurobi? For the polynomial terms, you might want to use the addGenConstrPow() or the addGenConstrPoly() function.

    These most likely will provide you the answer.

    Best regards,
    Jaromił

    0
  • Syed Asad Alam
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromil,

    Thanks for your response. I did not look at the two articles you referred to but I was able to resolve this last night by just using the addGenConstrPow() to generate my power terms and then add the expression directly as a constraint. For the division, I cross multiplied to remove any denominator term. I didn't use addGenConstrPoly() but it may help in having a clean code.

    0

Post is closed for comments.