Hi all,
I am currently working on a MILP problem that requires two variables to be either negative or positive, but not zero. Below, f(aij,t) is a variable that can be either negative or positive, which is calculated elsewhere in the model, while qout(aij,t) and qin(aij,t) are variables that are both negative if f(aij,t) is negative, or both positive if f(aij,t) is positive, but both qout(aij,t) and qin(aij,t) must have non-zero value. I therefore cannot specifically define both qout(aij,t) and qin(aij,t) as positive or negative variables, and defining them as normal variables results in one (usually qin(aij,t)) being zero.
variable f(aij,t), qout(aij,t), qin(aij,t);
equation averagef;
averagef(aij(ap,gn,gm),t) .. f(aij,t) =e= (qout(aij,t)+qin(aij,t))/2
Currently, the above code results in qin.L(aij,t) = 0 , and qout.L(aij,t) = 2*f(aij,t). Thus, is there a way to enforce both qout(aij,t) and qin(aij,t) to both have non-zero values?
Any help is greatly appreciated. Cheers!