How to express this logic ?

36 views
Skip to first unread message

Zhongjie Guo

unread,
May 31, 2019, 10:15:07 PM5/31/19
to YALMIP
Dear,
      I have an optimization problem in which there is a logical operation:
      A = 1, if Q>0; A = 0, if Q=0.
      where Q is a continuous variable great than or equal to 0.      A is a binary variable.
      Does any friend know how to expression this logical operation in Yalmip+cplex?

      thx

Johan Löfberg

unread,
Jun 1, 2019, 2:43:46 AM6/1/19
to YALMIP
That is practically impossible to implement as solvers work with numerical tolerances, and thus cannot work with strict inequalities, and 0 and 1e-10 and -1e-10 etc are essentially the same numbers.

the closest big-M model you can do is variants of [-epsilon + Q <= M*A, epsilon-Q <= M*(1-A)]

Zhongjie Guo

unread,
Jun 2, 2019, 1:38:06 PM6/2/19
to YALMIP
Alright.
Thank you  all the same :)
Reply all
Reply to author
Forward
0 new messages