Dear all,
I have a free variable that I do not want it to accept the value of zero. How can I fix this variable?
Regards,
Arman
Dear all,
I have a free variable that I do not want it to accept the value of zero. How can I fix this variable?
Regards,
Arman
You cannot exclude a single value from the domain of a continuous variable. Optimization regions need to be compact. You can exclude an interval around 0, so x<=-1e-6 or x>=1e-6. For that you need to introduce a binary variable (b) that decides on what side of 0 you are. Moreover, you need good finite bounds for x (xlo and xup). Then you can write:
x <= -1e-6 + b*(xup+1e-6)
x >= 1e-6 - (1-b)*(xlo-1e-6)
So for b=0 you have x<=-1e6 and x>=xlo and for b=1 you have x<=xup and x>=1e-6;
Since you will have a binary variable your model type might change from LP to MIP or NLP to MINLP.
-Michael
Dear Bussieck,
I guessed so. Thank you very much for your reply.
Regards,
Arman