メインコンテンツへスキップ

Modeling variable multiplication and/or divisions

回答済み

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff

    The Knowledge Base article How do I divide by a variable in Gurobi? discusses the implementation of division of two optimization variables.

    Gurobi natively supports the multiplication of two optimization variables.

    For the particular two constraints you have shown, as long as \(z>0, y > 0\), and \(2x -y > 0\), you can formulate your constraints as

    \[\begin{align*}
    x\cdot z &\geq y + \epsilon \cdot y \cdot z\\
    x &\geq 2\cdot x \cdot z -  y \cdot z + 2\cdot \epsilon \cdot x - \epsilon \cdot y
    \end{align*}\]

    If one of the variables is negative, you would have to adjust the sense of the constraints.

    Note that it is crucial that \(z \neq 0, y\neq 0\), and \(2x -y \neq 0\) for all values of \(z,x,y\) to avoid singularities.

    Moreover, it is strongly recommended to provide tight bounds for all variables participating in a nonlinear term. This is because, the relaxation of nonlinear terms depends on variable bounds. For more details, I recommend having a look at our Non-Convex Quadratic Optimization webinar and Non-Convex Tech Talk.

    0

サインインしてコメントを残してください。