Defining an eqation

Hi

Dear all
I want to define an equation that : if binary variable named A(a,b,c) is 1 then A(a,b,c+1) and A(a,b,c+2) be equal to 1.

I mean :

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =3 ;


and C is a set /1*24/

But when i write my code as above error 145 happens!

how should i write this equation ??

thanks you in advance

Regards

AZAD


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.

Hello,

I think that you should try:

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =E=3 ;

maybe it will help.

Best regards,

Kostas


Τη Σάββατο, 22 Νοεμβρίου 2014 12:57:44 μ.μ. UTC, ο χρήστης Azad έγραψε:

Hi

Dear all
I want to define an equation that : if binary variable named A(a,b,c) is 1 then A(a,b,c+1) and A(a,b,c+2) be equal to 1.

I mean :

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =3 ;


and C is a set /1*24/

But when i write my code as above error 145 happens!

how should i write this equation ??

thanks you in advance

Regards

AZAD


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 Azad



First of all, you cannot have A refer to both a set and a variable.



Apart from that, I think you can use



EQ1(a,b,c+1)… AV(a,b,c+1) =G= AV(a,b,c);

EQ2(a,b,c+2)… AV(a,b,c+2) =G= AV(a,b,c);



Regards



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, email: adrud@arki.dk



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Azad
Sent: Saturday, November 22, 2014 1:58 PM
To: gamsworld@googlegroups.com
Subject: Defining an eqation



Hi

Dear all
I want to define an equation that : if binary variable named A(a,b,c) is 1 then A(a,b,c+1) and A(a,b,c+2) be equal to 1.

I mean :

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =3 ;


and C is a set /1*24/

But when i write my code as above error 145 happens!

how should i write this equation ??

thanks you in advance

Regards

AZAD


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.

Reply-to: gamsworld@googlegroups.com


HI Aren tanks alot

but this EQAtion checck my binary variable at every “c” but i want it to be qualify for one time i mean just three of this variable should be equal to 1 respectively and others should be zero like that : 0 0 0 0 0 1 1 1 0 0 0

i define an another EQ in advance that allowances my variable to be 1 in just 3 time i just do not know how to set them respectively as i mention in above line.

thank you in advance

Best rearguards



On Monday, November 24, 2014 1:42:42 PM UTC+3:30, Arne Stolbjerg Drud wrote:

Hi Azad



First of all, you cannot have A refer to both a set and a variable.



Apart from that, I think you can use



EQ1(a,b,c+1)… AV(a,b,c+1) =G= AV(a,b,c);

EQ2(a,b,c+2)… AV(a,b,c+2) =G= AV(a,b,c);



Regards



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, email: ad…@arki.dk



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Azad
Sent: Saturday, November 22, 2014 1:58 PM
To: gams...@googlegroups.com
Subject: Defining an eqation



Hi

Dear all
I want to define an equation that : if binary variable named A(a,b,c) is 1 then A(a,b,c+1) and A(a,b,c+2) be equal to 1.

I mean :

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =3 ;


and C is a set /1*24/

But when i write my code as above error 145 happens!

how should i write this equation ??

thanks you in advance

Regards

AZAD


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@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.

Azad



With your new definition you key decision is to define a single critical AV(a,b,c). You can only choose one and then this and the next two AV will be 1.



Try something like this



Binary variable AC(a,b,c) first AV that is nonzero for each a-b

AV(a,b,c) decision;



Equations ……



EqSum(a,b) … sum(c, AC(a,b,c)) =L= 1;

EQ0(a,b,c) … AV(a,b,c) =G= AC(a,b,c);

EQ1(a,b,c+1) … AV(a,b,c+1) =G= AC(a,b,c);

EQ2(a,b,c+2)… AV(a,b,c+2) =G= AC(a,b,c);

EQtot(a,b) … sum(c,AV(a,b,c) =L= 3*sum(c,AC(a,b,c));


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, email: adrud@arki.dk



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Azad
Sent: Tuesday, November 25, 2014 6:04 PM
To: gamsworld@googlegroups.com
Cc: adrud@arki.dk
Subject: Re: Defining an eqation




HI Aren tanks alot

but this EQAtion checck my binary variable at every “c” but i want it to be qualify for one time i mean just three of this variable should be equal to 1 respectively and others should be zero like that : 0 0 0 0 0 1 1 1 0 0 0

i define an another EQ in advance that allowances my variable to be 1 in just 3 time i just do not know how to set them respectively as i mention in above line.

thank you in advance

Best rearguards



On Monday, November 24, 2014 1:42:42 PM UTC+3:30, Arne Stolbjerg Drud wrote:

Hi Azad



First of all, you cannot have A refer to both a set and a variable.



Apart from that, I think you can use



EQ1(a,b,c+1)… AV(a,b,c+1) =G= AV(a,b,c);

EQ2(a,b,c+2)… AV(a,b,c+2) =G= AV(a,b,c);



Regards



Arne


\

Arne Stolbjerg Drud

ARKI Consulting & Development A/S

Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark

Phone: (+45) 44 49 03 23, email: ad…@arki.dk



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Azad
Sent: Saturday, November 22, 2014 1:58 PM
To: gams...@googlegroups.com
Subject: Defining an eqation



Hi

Dear all
I want to define an equation that : if binary variable named A(a,b,c) is 1 then A(a,b,c+1) and A(a,b,c+2) be equal to 1.

I mean :

EQ(a,b,c)… A(a,b,c)+A(a,b,(c+1) ) + A(a,b,(c+2) ) =3 ;


and C is a set /1*24/

But when i write my code as above error 145 happens!

how should i write this equation ??

thanks you in advance

Regards

AZAD


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@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.