# If then condition on mixed linear integer programming [closed]

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$?

-

## closed as off-topic by Ricardo Andrade, Andrey Rekalo, Lucia, Stefan Kohl, David WhiteDec 2 '13 at 22:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question does not appear to be about research level mathematics within the scope defined in the help center." – Ricardo Andrade, Andrey Rekalo, Lucia, Stefan Kohl, David White
If this question can be reworded to fit the rules in the help center, please edit the question.

$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.
$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 '12 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 '12 at 5:30