how to deal with the objective function containing binary variable product of sdpvar

36 views
Skip to first unread message

马彦锴

unread,
Sep 16, 2018, 2:12:48 AM9/16/18
to YALMIP
Dear Johan,
 I have a nonlinear program problem. The  objective function have binary variable product  sdpvar. But Contraints are linear. Can I use Yalmip and Gurobi to solve it? I think it could be linearizied, however I don't know how to do it. Thank you very much if you could help me out of this problem.
mayankai
solve_question2_2.m

Johan Löfberg

unread,
Sep 16, 2018, 2:59:50 AM9/16/18
to YALMIP
your code is way to messy to see the interesting thing

Binary product x*y is linearized by replacing the product with new binary w and [w <= [x y], w >= x + y -1]

If y is continuous, you can derive the big-M model using [implies(x==1, w==y) + implies(x==0,w==0)]

If you are lazy, you can use the command binmodel.

马彦锴

unread,
Sep 20, 2018, 9:31:22 PM9/20/18
to YALMIP
Sorry for my mess code. But your advice is really help me solve the problem. Thank you a lot.
Reply all
Reply to author
Forward
0 new messages