How to model exponential relations between two variables?



1 comment

  • Jaromił Najman

    Hi Jessica,

    The default lower bound for variables in Gurobi is set to 0. However, in the exponential formulation, the variable \(\texttt{help_2}\) can become negative. Thus, setting

    help_2 = m.addVar(vtype=GRB.CONTINUOUS, name="help_2", lb=-GRB.INFINITY)

    should resolve the issue. Additionally, you should set an upper bound on variable \(\texttt{price}\). This is because a piecewise-linear approximation can only be performed correctly, if there are finite bounds given. Setting an upper bound of \(100\) for variable \(\texttt{price}\) seems good enough. Please additionally note that your problem is nonconvex due to the objective function \(x\cdot y\) so you need to set the NonConvex parameter to 2.

    Best regards,

    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk