Defining Binary Variable Condition

Hi,
I’m trying to write this constraint.

Here Ho is unit step function. Ho(0)=0 , otherwise it’s equal to 1.
I define Ho(i,j) as Binary Variable. I wrote the constraint like :

extrabitConstraint(i)(ord(i)>1).. e(i) =g= Prx*(sum(j(ord(j) > 1),f(j,i)))+sum(j,(Ptx(i,j)*f(i,j))) + sum(j,(Oc + Otx(i,j))*Ho(i,j));

. And now i have to define Ho(0)=0 like if there’s no flow (fij=0 and fji=0) then Ho=0. But, i’m not sure how to write this. Can you help me , please ?

Thanks



\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Sayda,

Why not this?

extrabitConstraint(i)$(ord(i) eq 1)…

e(i) =g= Erx*sum(j, f(j,i)) + sum(j, Etx(i,j))*f(i,j)) + sum(j, (Oc + Otx(i,j))*1

New Constraint:

constraint1…

Ho =l= sum(i,j, f(i,j));

constraint2…
Ho =l= sum(j,i, f(j,i));

If one of f are zero, so, Ho is zero.

If you need only when both are zero, so:

constraint1…
Ho =l= sum(i,j, (f(i,j) + f(j,i));

Or something like that. Think about it.

I have never used the “0” position of a vector or matrix. I think all Gams start in 1. So, you need to shift to index start in 1.

About f(i,j) = and f(j,i) = 0, what are they? Are linear continuos variables? Binary variables? Or just a parameter?

Because if “f” variable are both zero, so you are multiplying the rest of the equation by zero.

Best Regards,
Jack Hagart


2013/12/26 seyda cankaya

Hi,
I’m trying to write this constraint.

Here Ho is unit step function. Ho(0)=0 , otherwise it’s equal to 1.
I define Ho(i,j) as Binary Variable. I wrote the constraint like :

extrabitConstraint(i)(ord(i)>1).. e(i) =g= Prx*(sum(j(ord(j) > 1),f(j,i)))+sum(j,(Ptx(i,j)*f(i,j))) + sum(j,(Oc + Otx(i,j))*Ho(i,j));

. And now i have to define Ho(0)=0 like if there’s no flow (fij=0 and fji=0) then Ho=0. But, i’m not sure how to write this. Can you help me , please ?

Thanks



\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.