Hello, I am trying to linearise this equation : variable2=Max(0,variable1) but when I try to do this introducing a binary variable I always end with BinaryVariable*variable1 that is not linear... Do you have any solution ? Thanks,
asked
youkier |

If \(y_1,y_2\) are binary and \(M\) is enough big then linear constraints are as follows. \[ \begin{cases} & -M\cdot y_1 \leq variable2 \leq M\cdot y_1 \\ & -M\cdot y_2 \leq variable2 - variable1 \leq M\cdot y_2 \\ & -M(1-y_1) \leq variable1 \leq M(1-y_2) \\ & y_1+y_2 =1 \end{cases} \]
answered
Slavko |