Domain filtering

Problems with syntax of GAMS
Post Reply
yamaz
User
User
Posts: 2
Joined: 1 year ago

Domain filtering

Post by yamaz » 1 year ago

I tried to make a set of constraints.

It is something like:

set time /t1*t4/;
set t(time) /t1*t3/;

Variables
A(time)
Equations
Eq1(t).. A(t+1)-A(t) =E= 1;


it is very annoying that even though A(t4) exist, the constrains of Eq(t3) is always become:
0-A(t3) =E= 1;

How can I deal with such situation?
Please tell me the solutions of following two cases:
(1) To make Eq(t3) as "A(t4)-A(t3) =E= 1";
(2) To exclude Eq(t3);

Thank you very much for your kindly help.

User avatar
Renger
Posts: 221
Joined: 2 years ago

Re: Domain filtering

Post by Renger » 1 year ago

Hi Yamaz

See my reply in this post from last week: viewtopic.php?f=2&t=10156#p23277

Cheers
Renger

yamaz
User
User
Posts: 2
Joined: 1 year ago

Re: Domain filtering

Post by yamaz » 1 year ago

Hi Renger,

Thanks very much for your help.
According to that post

I can modify the equation as follow:
Eq1(t) $ (ord(t) ne card(t)) .. A(t+1)-A(t) =E= 1;

It works as that it excluded Eq1(t3);

However, what if I what to introduce A(t4) into Eq1(t3) instead of excluding it without expanding the domain, as I mention in Case (1)?
Be noted that A(t4) is also variables but not in the domain of t.

Thanks again for your help
Renger wrote:
1 year ago
Hi Yamaz

See my reply in this post from last week: viewtopic.php?f=2&t=10156#p23277

Cheers
Renger

User avatar
Gideon Kruseman
User
User
Posts: 23
Joined: 1 year ago

Re: Domain filtering

Post by Gideon Kruseman » 1 year ago

set time /t1*t4/;
set t(time) /t1*t3/;

Variables
A(time)
Equations
Eq1(time)$t(time).. A(time+1)-A(time) =E= 1;
Gideon Kruseman
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData

Post Reply