0

Hi all. Let $a$ and $b$ be two real variables such that $0 \le a \le a_{max}$ and $0 \le b \le b_{max}$. I must write the following if-then-else condition with linear inequalities:

if $a < a_{max}$ then $b = 0$ else $b \ge 0$.

Is it possible by adding a single binary variable $y$?

flag

1 Answer

0

Yes.

$a_{\text{max}} y \leq a \leq (1-y)(a_{\text{max}} - \epsilon) + a_{\text{max}}y$

$0 \leq b \leq b_{\text{max}} y$

where $y \in \{{0,1\}}$ and $\epsilon$ is a small positive real.

link|flag
$epsilon$ is emulating the "<" condition, right? If I set $epsilon=0$ then I get the $a \le a_{max}$ condition. I'll mark as an answer. – ashade Aug 14 at 23:51
In general, you cannot write strict inequality constraints (< or >) in numerical math programs. The $\epsilon$ is used as an approximation, and is usually set to your solver's numerical tolerance. – Gilead Aug 15 at 5:30

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.