メインコンテンツへスキップ

how to write a square constraint?

回答済み

コメント

2件のコメント

  • 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
    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

サインインしてコメントを残してください。