Conditional constraints for continuous variables

142 Views Asked by At

How could we model conditional constraints for two continuous variables? Suppose the two variables are: $$x\geq0$$ $$y\in\mathbb R.$$ The conditions are: if $y>0$, then $x>0$ and if $y\leq0$, then $x=0$.

1

There are 1 best solutions below

2
On

Let $\epsilon>0$ be a small constant. Introduce a binary variable $z$ and impose linear big-M constraints: \begin{align} \epsilon (1-z) \le x &\le M(1-z) \tag1 \\ -Mz + \epsilon (1-z) \le y &\le M (1-z) \tag2 \\ \end{align}

  • If $z=0$, then $\epsilon \le x \le M$ and $\epsilon \le y \le M$.
  • If $z=1$, then $0 \le x \le 0$ and $-M \le y \le 0$.