Conditional binary variable logic in gams model -


this model in gams,

i have binary variable (b(n)) , real variable (u(n)), n set. want binary variable equal 0 when u zero, , equal 1 when u isn't zero.

this easy if use 'if' statements can't use them in model equations, needs done math logic...

it's ok! found solution:

b(n) =l= rel_ne(u(n),0) b(n) =g= rel_ne(u(n),0) 

this seams working fine. it's not elegant solution whatever.

rel_ne returns 1 if u(n) not equal 0, , returns 0 otherwise.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -