I have a problem which often occurs in energy system modelling (modelling of storages) where charging of a storage system is not allowed to when it is discharging and vice versa.
Let x and y be continous positive decision variables that represent the charging/discharging power of the storage unit. Now I am trying to express the following logic in equations or inequalities:
if x > 0:
y = 0
if y > 0:
x = 0
I know this can be realized with binary variables via the following equations if b is a binary variable and x_ub and y_ub represent the respective upper bound of the variables:
x <= b * x_ub
y <= (1-b) * y_ub
This results in a mixed-integer linear programm (MILP) and of course induces all the properties of a MILP which lay in higher runtimes, other interpretations of the solution, ...
Another way to get a pure LP formulation is to work with (very low) costs that are attached to x and y so that only one of both variables is set to a positive value. But this also affects my objective, has other disadvantages as is is somewhat of a hotfix.
So here's my question: Is there any way to express the logic above (if/else) in a purely linear program (LP)?
Thanks in advance!
This can't be expressed as an LP. Conceptually you're after the following constraints: $x \geq 0, y \geq 0, xy=0$.
The third constraint isn't convex, so there's no way you could represent that in terms of LP constraints, since those can only define convex regions.