I am trying to use a binary variable based on an inequality. The value of binary variable $q $ is 1 or 0 based on the following equation.
[ $q $ = \begin{cases} 0,& \text{if } b \geq \pi ,\\ 1, & \text{otherwise} \end{cases}
Here, b and $\pi$ are real numbers. Sample value b = 20 , $\pi$ = 30.
I have tried to represent this by:
\begin{equation} q \geq \dfrac { (\pi - b )} {M} \end{equation}
\begin{equation} q \leq 1 + \dfrac { (\pi - b )} {M} \end{equation}
By using these two equations I am able to cover the cases for when $b > \pi $ and when $b < \pi $. Unfortunately I am unable to set $q$ as 0 when $b=q$ without violating other conditions.