Division between float and grb variable
AnsweredI am trying to add a constraint on the inverse of the variable of the form
$$1/x[i, j] + a^Ty + b \leq c$$
but I get the message that div does not support float and MVar. Is this currently supported?

Hi Surya,
Division of variables is currently not supported.
You can model the division \(\frac{1}{x}\) with an additional variable \(z\) as
\[\begin{align*}
x \cdot z = 1.
\end{align*}\]In the above \(z\) has to be equal to \(\frac{1}{x}\) and can be used throughout your model.
Please note that you have to provide appropriate bounds for both \(x\) and \(z\) to make the above formulation work properly. For \(x \in [x^L, x^U], x^L>0\), the bounds for \(z\) should be \(z \in [\frac{1}{x^U}, \frac{1}{x^L}]\).
It is also required to set the NonConvex parameter to 2.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment