Skip to main content

Mutual Information as PWL Constraint

Answered

Comments

4 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    But is this the best approach? Is there a standard way to deal with multiple layers of non-linearity?

    Currently yes, introducing (possibly many) auxiliary variables and equations is the best and only approach to deal with nonlinear composite functions in Gurobi.

    Best regards, 
    Jaromił

    1
  • Alexander Haberman
    Gurobi-versary
    Curious
    First Comment

    Thank You!

    1
  • Alexander Haberman
    Gurobi-versary
    Curious
    First Comment

    I am having trouble writing constraints of the form:

    ln(x+y)=z

    where x,y and z are all variables. Why is this? Is there a solution or should I just add an auxiliary variable equal to x+y? The error I get is:

    <gurobi.Var *Awaiting Model Update*> + <gurobi.Var *Awaiting Model Update*> is not a variable
    1
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    General function constraints only accept a single variable as argument input. Expressions are currently not allowed. Thus, you have to introduce an additional auxiliary variable \(w = x+y\). This API may be extended in a future release.

    0

Please sign in to leave a comment.