Skip to main content

Exponential constraints make the model infeasible

Answered

Comments

1 comment

  • Maliheh Aramon
    Gurobi Staff Gurobi Staff

    Hi Ali, 

    When I add constraints to enforce those feasible solutions, the entire model becomes infeasible.

    This suggests that the solutions you expect to be feasible may not be feasible.

    You can identify the source of infeasibility by calling the GRBModel.computeIIS() method and writing the IIS to a file for further analysis.

    I suspect this issue occurs when the value of x becomes very small (e.g., -50) or very large. 

    Small values in the domain of x are not typically problematic, but large values can cause numerical issues during piecewise linear approximation. The parameter FuncMaxVal controls the maximum allowed values in the domains of xand y when using piecewise linear approximation.

    When nonlinear relationships are modeled using GRBModel.addGenConstrXXX(), you can choose to solve the model as an MINLP or approximate it as an MILP by setting the FuncNonlinear parameter to 1 or 0, respectively. Note that the default behavior of FuncNonlinear depends on the Gurobi version: it defaults to 1 in version 12 and 0 in version 11.

    In Gurobi version 12, you can model nonlinear constraints of the form \( using expression trees. This eliminates the need for auxiliary variables when modeling multivariate nonlinear functions. For more details, refer to the nonlinear constraints documentation and the example code GenconstrNL.java.

    Could you please advise if these issues can be resolved?

    • As mentioned, please ensure that the solutions you expect to be feasible are feasible by examining the IIS.
    • In case you are using Gurobi version 11, you can set the FuncNonlinear parameter to 1 to solve the model as an MINLP.

    Best regards,

    Maliheh

    0

Please sign in to leave a comment.