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.
Code: Select all
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
Any help is greatly appreciated. Cheers!