In our current project we need to model the following if-statement in linear programming:
If T1 < b < T2 then z = s else z = 0
where T1 and T2 are two integer values (e.g. T1 = 10 and T2 = 100) and s is also an integer value (e.g. 5).
We already know how to model a simpler if-statement with for example A > 0 but we can not figure out how to model an if-statement with a condition t1 < b < t2.
Can someone help us?
Here is a little more detailed explanation of the problem:
In our problem we have several different ranges, each range with a lower and an upper bound, and for each of these steps we have to multiply another value to a variable (lets call this variable k and the result of this multiplication z). For example we have the following range and if-statements:
Ranges: 0 - 10 : 0 11 - 100: 9 101 - 200: 8.5 201 - 300: 8 IF-Statements if 0 < b < 10 then z = k * 0 if 11 < b < 100 then z = k * 9 if 101 < b < 200 then z = k * 8.5 if 201 < b < 300 then z = k * 8
The lower and the upper bounds as well as the multiplication values are constants and known upfront. The rest (i.e. b, z, k) are integer variables for which we don't know the exact upper bound (lower bound is 0), but we know that they will not get too big. So, we are able to define M values for the M technique.
We already figured out how to do an if-statement like the following (T1 and T2 are the thresholds of the ranges from above, e.g. T1=0 & T2=10):
if T1 < b then z = k * something
if b < T2 then z = k * something
For this we transform T1 < b to 0 < b - T1 and b < T2 to 0 < T2 - b and then we use the way described here.
But we are stuck at how we can do the:
0 < b - T1 && b < T2 to 0 < T2 - b
The whole problem is a mixed integer linear programming problem, because we have also boolean decision variables and integer values like for example b.