how to impose that $y_i = 0 $ if $q_i> C$

29 Views Asked by At

How Can I impose that $y_i = 0 $ if $q_i> C$ where C is a constant My problem is defined by those constraints: $$x_i \in \{0 ; 1\}$$ $$q_i \in R^+_0$$ $$y_i \ge x_i - x_{i+1}$$ $$y_i \le x_{i}$$ $$y_i \le 1 - x_{i+1}$$ $y_i$ is defined to detect the transition $x_1=0 \rightarrow x_{i+1}=1$ $$x_i*q_{min} \le q_i \le x_i*q_{max}$$ $q_{min}$ and $q_{max}$ are constants.

1

There are 1 best solutions below

0
On BEST ANSWER

Your constraint $$q>C \Rightarrow y=0$$ can be rewritten as: $$y=1 \Rightarrow q \le C$$ A standard formulation is: $$ \begin{align} &q \le C + M (1-y)\\ &y \in \{0,1\} \end{align} $$ where $M=q_{max}-C$.