constraint with binary variable

Hi
I’m trying to code this constraint (which is not a standard constraint) with gams. Can anybody please help me?


if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0}


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/d/optout.

Edition :
if {X(i,j)=1 and X(i,j+1)=0 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0}

Date: Tue, 7 Jul 2015 06:39:32 -0700
From: bahman.alipourr@gmail.com
To: gamsworld@googlegroups.com
Subject: constraint with binary variable

Hi
I’m trying to code this constraint (which is not a standard constraint) with gams. Can anybody please help me?


if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0}


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/d/optout.


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/d/optout.

Use Big M method to write if/then, i.e., if ==> f(x) -(g(x) -1) wrote:

Hi
I’m trying to code this constraint (which is not a standard constraint) with gams. Can anybody please help me?

if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0}


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/d/optout.


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/d/optout.

Dear Saeed
Thanks for your soon reply,
I already tried using big M method , But since this constraint is a bit more complicated, I couldn’t get a proper result. There is a “and” in the “if” statement and it makes problems.

From: ssal21@gmail.com
Subject: Re: constraint with binary variable
Date: Tue, 7 Jul 2015 09:01:33 -0500
To: gamsworld@googlegroups.com

Use Big M method to write if/then, i.e., if ==> f(x) -(g(x) -1) wrote:

Hi
I’m trying to code this constraint (which is not a standard constraint) with gams. Can anybody please help me?


if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0}


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/d/optout.

\

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/d/optout.


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/d/optout.

Hi, First of all I completed your Constraint as follow:

if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0} Else {X(i,j+2)+X(i,j+3)+X(i,j+4) 0}

And X(i,j) are Binary Variables for All i & j

The Above Constraint Can be modeled as follow:

X(i,j+2) + X(i,j+3) + X(i,j+4) = - 3 * (2 - X(i,j) - X(i,j+1))


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/d/optout.

Hi, First of all I completed your constraint as follow:

if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0} Else {X(i,j+2)+X(i,j+3)+X(i,j+4) 0}

And X(i,j) are Binary Variables for All i & j

The Above Constraint Can be modeled as follow:

X(i,j+2)+X(i,j+3)+X(i,j+4) = 3*(2 - X(i,j) - X(i,j+1))


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/d/optout.

Hi, First of all I completed your Constraint as follow:

if {X(i,j)=1 and X(i,j+1)=1 } then {X(i,j+2)+X(i,j+3)+X(i,j+4) =0} Else {X(i,j+2)+X(i,j+3)+X(i,j+4) 0}

And X(i,j) are Binary Variables for All i & j

The Above Constraint Can be modeled as follow:

X(i,j+2) + X(i,j+3) + X(i,j+4) <= 3 * (2 - X(i,j) - X(i,j+1))


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/d/optout.