Skip to main content

PWL objective function

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    You can model the following equivalent formulation

    \[\begin{align*}
    \min &\,\,z_1 \cdot z_2 \\
    z_1 & = f_{1}^{pwl}(x_1) \,\, (1)\\
    z_2 & = f_{2}^{pwl}(x_2) \,\, (2)
    \end{align*}\]

    You can use the addGenConstrPWL() method to model the equalities \((1)\) and \((2)\). Note that you will have to introduce 2 auxiliary variables \(z_1, z_2\). Since Gurobi supports bilinear terms, you can then multiply the two in the objective function.

    Best regards, 
    Jaromił

    0

Post is closed for comments.