CONDITIONAL EQUATION. INDEX RESTRICTION

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro

\

This may help

set i /N1*N6/
set ii(i) /N6/;

GENERATION(i)$(i ne ii(i)).




Pedro escreveu:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

So you suggest to create a subset and use it as the relationship of
values of i that I don’t want to evaluate in the case of GENERATION(i)
Thank you.

On 9 mayo, 13:33, Edson Cordeiro do Valle wrote:

This may help

set i /N1*N6/
set ii(i) /N6/;

GENERATION(i)$(i ne ii(i)).

Pedro escreveu:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equationdefined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro

\

Or you could try:

GENERATION(i)$(NOT SameAs(i,“N1”))…


On May 9, 8:50 pm, Pedro wrote:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro

\

Hello,

I have a similar problem as described above. I would like to exclude some indices (defined as parameters) from the summation within a conditional equation. I tried something like below, but it didn’t work.


PARAMETERS

BETA(I)
GAMMA(I) // define the indices that should be excluded from summation for every t

VARIABLES //binary
Y(I,J,K,L)
W(I)

CHANGE(I)… SUM((J$(J ne BETA(I)), K$(K ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);

neither this nor

CHANGE(I)… SUM((J$((ord(J)-1) ne BETA(I)), K$((ord(K)-1) ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);

worked. It returns error 148 (dimension different) and apparently, there’s also a parenthesis ‘)’ missing but all of them are paired.
Is a potential cause that the excluding indices are defined as parameters, not sets? I would be grateful for any hints on how to work around this.

Thanks!
Anna



On Wednesday, May 11, 2011 4:21:00 AM UTC+2, AC wrote:

Or you could try:

GENERATION(i)$(NOT SameAs(i,“N1”))…


On May 9, 8:50 pm, Pedro wrote:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/Xz7OR7Xx8pcJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Anna



Just split the sum in 3 spearate sumes and then you can use the sign on the indices \ \ \ CHANGE(I).. SUM(J((ord(J)-1) ne BETA(I)), sum(K$((ord(K)-1) ne GAMMA(I)), sum(L ,Y(I,J,K,L))))=L= W(I);



Cheers

Renger

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Anna
Sent: Wednesday, October 10, 2012 6:30 PM
To: gamsworld@googlegroups.com
Subject: Re: CONDITIONAL EQUATION. INDEX RESTRICTION



Hello,



I have a similar problem as described above. I would like to exclude some indices (defined as parameters) from the summation within a conditional equation. I tried something like below, but it didn’t work.





PARAMETERS



BETA(I)

GAMMA(I) // define the indices that should be excluded from summation for every t



VARIABLES //binary

Y(I,J,K,L)

W(I)



CHANGE(I)… SUM((J$(J ne BETA(I)), K$(K ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);



neither this nor



CHANGE(I)… SUM((J$((ord(J)-1) ne BETA(I)), K$((ord(K)-1) ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);



worked. It returns error 148 (dimension different) and apparently, there’s also a parenthesis ‘)’ missing but all of them are paired.

Is a potential cause that the excluding indices are defined as parameters, not sets? I would be grateful for any hints on how to work around this.



Thanks!

Anna






On Wednesday, May 11, 2011 4:21:00 AM UTC+2, AC wrote:

Or you could try:

GENERATION(i)$(NOT SameAs(i,“N1”))…


On May 9, 8:50 pm, Pedro wrote:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/Xz7OR7Xx8pcJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Works well, thank you very much Renger!

Regards,
Anna


On Wednesday, October 10, 2012 8:58:29 PM UTC+2, Renger van Nieuwkoop wrote:

Hi Anna



Just split the sum in 3 spearate sumes and then you can use the sign on the indices \ \ \ CHANGE(I).. SUM(J((ord(J)-1) ne BETA(I)), sum(K$((ord(K)-1) ne GAMMA(I)), sum(L ,Y(I,J,K,L))))=L= W(I);



Cheers

Renger

From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Anna
Sent: Wednesday, October 10, 2012 6:30 PM
To: gams...@googlegroups.com
Subject: Re: CONDITIONAL EQUATION. INDEX RESTRICTION



Hello,



I have a similar problem as described above. I would like to exclude some indices (defined as parameters) from the summation within a conditional equation. I tried something like below, but it didn’t work.





PARAMETERS



BETA(I)

GAMMA(I) // define the indices that should be excluded from summation for every t



VARIABLES //binary

Y(I,J,K,L)

W(I)



CHANGE(I)… SUM((J$(J ne BETA(I)), K$(K ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);



neither this nor



CHANGE(I)… SUM((J$((ord(J)-1) ne BETA(I)), K$((ord(K)-1) ne GAMMA(I)), L) ,Y(I,J,K,L))=L= W(I);



worked. It returns error 148 (dimension different) and apparently, there’s also a parenthesis ‘)’ missing but all of them are paired.

Is a potential cause that the excluding indices are defined as parameters, not sets? I would be grateful for any hints on how to work around this.



Thanks!

Anna






On Wednesday, May 11, 2011 4:21:00 AM UTC+2, AC wrote:

Or you could try:

GENERATION(i)$(NOT SameAs(i,“N1”))…


On May 9, 8:50 pm, Pedro wrote:

Hello,

I have a doubt with GAMS, I hope somebody can help me. I’ve got a
equation defined for all values of an index and I want to make an
exception with one of the particular values that the index can have.
Example:

set i /N1*N6/

GENERATION(i)$(i ne “N1”)…

So I want to define GENERATION for all values of the index i but “N1”.

Thank you so much for your help

Pedro


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/Xz7OR7Xx8pcJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/_xhU6sCP7MEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

dear
you can use “$ord 1” as a condition
regards


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.