Skip to main content

how to write a square constraint?

Answered

Comments

2 comments

  • Riley Clement
    Gurobi Staff 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
    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

Please sign in to leave a comment.