Skip to main content

how to write a square constraint?

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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.
  • Riley Clement
    • Gurobi Staff

    Hi,

    You can divide both sides of the inequality by 5, then square each side to get an equivalent form.  You can then use

    m.addConstr(x1*x1 + x2*x2 <= 36)

    - Riley

    0
  • w sj
    • Gurobi-versary
    • First Question
    • First Comment

    Thanks.This inequality is just a small example I gave to illustrate the problem, and it may not be very appropriate. I successfully wrote this constraint by introducing auxiliary variables .

    0

Post is closed for comments.