Skip to main content

Quadratic constraint accuracy

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Dominique,

    In your code, the line

    m.addConstr(y - radius <= -bd, "ellipsoid_UBy ")

    should read

    m.addConstr(y - radius >= -bd, "ellipsoid_UBy ")

    Moreover, the default lower bound for optimization variables is \(0\). Once you make your coordinate variables \(x,y\) free variables by setting

    x = m.addVar(lb=-GRB.INFINITY,name="x")
    y = m.addVar(lb=-GRB.INFINITY,name="y")

    you get the desired solution.

    Best regards,
    Jaromił

    0

Please sign in to leave a comment.