Gurobi does not support dividing by variables. However, one can model the expression \(\frac{1}{x}\) by introducing a continuous variable \( z \) and adding the constraint

$$x \cdot z = 1.$$

By the above constraint, \(z = \frac{1}{x}\). Wherever the expression \( \frac{1}{x} \) would appear in the model, the variable \( z \) can be used instead.

In order for the above formulation to work properly and avoid division by \( 0 \), one must provide appropriate bounds for both \(x\) and \(z\). For \(x \in [x^L, x^U], x^L>0\), the bounds for \(z\) should be \(z \in \Big[\frac{1}{x^U}, \frac{1}{x^L}\Big]\).

Additionally, for Gurobi to solve this reformulation, the NonConvex parameter must be set to 2.

### Further information: