I have if statements in my constraints and I'm having trouble turning it into an inequality problem. The statement is as following:
IF a>=x1, THEN f(x1,x2) = a+x2, Else f(x1,x2) = a.
x1 and x2 are integer (but not binary) decision variables, f(x1,x2) is an expression calculated based on x1 and x2, a is a constant.
I want to turn this into an inequality form, but not sure how.
I prefer to think of these problems as first listing a set of disjoint cases.
Case 1 $a \geq x_1, f = a + x_2$
Case 2 $a \leq x_1-\epsilon, f = a$
Now introduce binary variable variables $d_1$ and $d_2$ constrained as $d_1+d_2=1$ to say that one case must hold, and you want to have the implications
$d_1 \rightarrow a \geq x_1, f = a + x_2$
$d_2 \rightarrow a \leq x_1-\epsilon, f = a$
Now you apply standard big-M for implied inequalities, $d \rightarrow g(x)\leq 0$ is $g(x)\leq M(1-d)$ and $d \rightarrow g(x)=0$ is $-M(1-d) \leq g(x) \leq M(1-d)$
You can derive the model more directly, but by listing disjoint cases and explicit enumeration you get basically the same approach for almost any problem of this kind that you encounter.