Non-linear problem with non_linear constraints
回答済みHello everyone,
I have a optimization problem with bilinear objective function. To solve that problem I used the example of quadratic programming : qp.m with gurobi_write(model, 'qp.lp'); https://www.gurobi.com/documentation/9.5/examples/qp_m.html
However, now I want to add a bilinear constraint like x*y +z<1
I was searching on the example qcp.m and I couldn't find a way to include linear and bilinear terms on the same constraint.
Is it possible to add a constraint with both linear and bilinear terms using gurobi on matlab?
Also, is it possible to have both bilinear objective function and constraints?
how should I build the model?
gurobi_write(model, 'qcp.lp');or
gurobi_write(model, 'qp.lp');
?
Many thanks
-
正式なコメント
This post is more than three 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. -
Hi Bruna,
You can set the linear part of quadratic constraints via the \(\texttt{q}\) vector, cf. The model argument. In the bilinear example, you could set the linear part of the bilinear equality via
m.quadcon(2).q = [1,2,3];
Also, is it possible to have both bilinear objective function and constraints?
Yes, you can set the \(\texttt{Q}\), \(\texttt{obj}\), and \(\texttt{quadcon}\) fields.
how should I build the model?
gurobi_write(model, 'qcp.lp');or
gurobi_write(model, 'qp.lp');
?The \(\texttt{gurobi_write}\) function writes an lp file and does not build it. Model building takes place before the \(\texttt{gurobi_write}\) function is called.
Best regards,
Jaromił0
投稿コメントは受け付けていません。
コメント
2件のコメント