Hello All I need to make a set of linear constraints to represent this problem: There are two kinds of variables: Statuses are: The problem is that I need to model this statuses together in a set of linear constraints that work simultaneously. I wonder if any body knows an approach to figure this out. Thanks 
Suppose \(L \leq S \leq U\) and we desire the following: $$ Y = \begin{cases} 0, & S = 0 \\ 1, & S \neq 0 \end{cases} $$ We relax this using \(\epsilon\) (a small positive number) as follows: $$ Y = \begin{cases} 0, & \epsilon \leq S \leq \epsilon \\ 1, & \text{otherwise} \end{cases} $$ Formulation We can use range constraints to model the above behavior: (range constraints are my goto technique for these kinds of problems) $$ \delta_1 \epsilon + \delta_2 L + \delta_3(\epsilon) \leq S \leq \delta_1 U + \delta_2 (\epsilon) + \delta_3(\epsilon) $$ $$ \delta_1 + \delta_2 + \delta_3 = 1 $$ $$ Y = 1  \delta_3 $$ where \(Y, \delta_3 \in \mathbb{R}\) and \( \delta_1, \delta_2 \in \{0,1\} \). Check If \(\epsilon \leq S \leq U\), this implies \(\delta_1 = 1, \delta_2 = 0, \delta_3 = 0\), therefore \(Y = 1\). If \(L \leq S \leq \epsilon \), this implies \(\delta_1 = 0, \delta_2 = 1, \delta_3 = 0\), therefore \(Y = 1\). If \(\epsilon \leq S \leq \epsilon \), this implies \(\delta_1 = 0, \delta_2 = 0, \delta_3 = 1\) therefore \(Y = 0\). QED. answered 04 Aug '12, 18:37 Gilead ♦ 
A similar question, I see solvers provide feature of indicator variables and constraints. For example, if use cplex to model this one, it's something like:
So C4 and C5 can be added into the IModel which I think also satisfy the requriement. However, I notice that in the manual of CPLEX, they encourage to use the indicator cosntraint rather than the big M or small epsilon approach as it may introcude "Numerical instability" (like here). So the question is, how do they implement the indicator cosntraints? What do they mean by "numerical instability"? answered 06 Aug '12, 02:14 jc W 1
Numerical instability can be caused by having coefficients with large order of magnitude differences. See this post for a nice explanation Making a singular matrix nonsingular. Look for the explanation of condition number. Numerical instability means you have a large condition number, too large to warrant accurate results.
(08 Aug '12, 22:37)
jfpuget
