Skip to main content

gurobi does not support signomial equality constraints

Answered

Comments

6 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Gurobi v11 does not directly support terms of this kind. However, you can use Gurobi's general function constraints to model the term you need. In particular, you will need to model each signomial term via two equality constraints, i.e., you will need to introduce equalities

    \[\begin{align*}
    w_t &= \frac{x_t+y_t+z_t}{a} &\forall t \in T \quad (1)\\
    v_t &= w_t^{s_t} &\forall t \in T \quad (2)
    \end{align*}\]

    where \(w_t, v_t\) are free auxiliary continuous variables, equalities \((1)\) are linear constraints, and equalities \((2)\) are introduced via the addGenConstrPow method.

    You can then finally introduce the multilinear product as described in How do I model multilinear terms in Gurobi?

    Please note that I don't know whether YALMIP supports Gurobi's general constraints feature.

    Best regards, 
    Jaromił

    0
  • 信 谢
    First Comment
    First Question

    Hello Jaromil,

    Thanks for replying to my question!

    This function is a part of optimization function. And its constraints are linear with some equality. When I set this into constraints(including vectors),the problem occurred.

    Kind regards,

    Xiexin.

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Xiexin,

    This function is a part of optimization function. And its constraints are linear with some equality. When I set this into constraints(including vectors),the problem occurred.

    Could you please explain which problem occurred?

    Best regards, 
    Jaromił

    0
  • 信 谢
    First Comment
    First Question

    Hi Jaromil,

    It is still gurobi does not support signomial equality constraints. And this time I added the constraint of Wt.

    The code are as follows:

    C=[C,Stage_1_1_1 == (((ISW_1(1,1)+IOW_1(1,1)+IGW_1(1,1))/A_K_1(1,1)+Pe_1(1,1))/ET_max_k_1(1,1)).^landa_1(1,1)];
    C=[C,Stage_1_1_2 == (((ISW_1(1,2)+IOW_1(1,2)+IGW_1(1,2))/A_K_1(1,1)+Pe_1(1,2))/ET_max_k_1(1,2)).^landa_1(1,2)];
    C=[C,Stage_1_1_3 == (((ISW_1(1,3)+IOW_1(1,3)+IGW_1(1,3))/A_K_1(1,1)+Pe_1(1,3))/ET_max_k_1(1,3)).^landa_1(1,3)];
    C=[C,Stage_1_1_4 == (((ISW_1(1,4)+IOW_1(1,4)+IGW_1(1,4))/A_K_1(1,1)+Pe_1(1,4))/ET_max_k_1(1,4)).^landa_1(1,4)];
    C = [C,TISW == TISW+sum(ISW_1(1,:))];
    C = [C,TIOW == TIOW+sum(IOW_1(1,:))];
    C = [C,TIGW == TIGW+sum(IGW_1(1,:))];

    F1 = sum(Y_1_1*A_K_1*PC_1_k -((TISW+TIOW+TIGW/a_surfacewater_1)*Pc_water);

    IGW,ISW and IOW are variables with constraints. A_K_1,PC_1_k,a_surfacewater_1,Pc_water,Pe_1,ET_max_k_1 and landa_1 are constants.
    TISW,TIGW and TIOW are continuous variables with constraints.F1 is optimization function.

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Xiexin,

    It looks like YALMIP does not support Gurobi's nonlinear features. If you would like to use Gurobi as a nonlinear solver, I would recommend switching to one of Gurobi's native APIs. I would recommend gurobipy (Python), but since you are familiar with YALMIP, you might want to have a look at Gurobi's MATLAB API.

    If you want to stick to YALMIP, then you would very likely have to use a different solver for which YALMIP implements the nonlinear capabilities.

    Best regards, 
    Jaromił

    0
  • 信 谢
    First Comment
    First Question

    Hi Jaromil,

    It is feasible to run the model with equality constraints. Thanks for advise.

    Kind regards,

    Xiexin.

    0

Please sign in to leave a comment.