Making a Variable Non-Zero

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!

Optimization happens over compact sets, so no >0 is allowed. You need to specific, like >= 1e-6. But even this one is so so, because every solver works with feasibility tolerances (usually around 1e-4 to 1e-6) and hence the variables can still be zero even if you require them to be >=1e-6 or <= -1e-6.

-Michael