ERROR 125 existing

Problems with syntax of GAMS
Post Reply
kenho12345
User
User
Posts: 3
Joined: 6 years ago

ERROR 125 existing

Post by kenho12345 »

i would like to check the output emssion is within the limit by inputing the following,

VARIABLES
z objective function variable
p(J,K) output power of generator j at period k
v(J,K) is equal to 1 if generator j is committed in period k

COST objective function
LOAD(K) load balance equation
EMISSION (J,K) emission limit equation;

OST.. z =e=SUM((K,J), GDATA(J,'A')*p(J,K)+GDATA(J,'E')*s(J,K)+ GDATA(J,'B')*y(J,K));
LOAD(K)$(ord(K) GT 1).. SUM(J,p(J,K))=e=PDATA(K,'D');
EMISSION(J,K)$(ord(K) GT 1).. sum(J,f(J,K))=l=PDATA(K,'N');

However, error 125 keep informing me set is under control alreay.
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: ERROR 125 existing

Post by Renger »

Hi

In your equation you have:

EMISSION(J,K)$(ord(K) GT 1).. sum(J,f(J,K))=l=PDATA(K,'N');

Note, however, that your equation is defined over J and K and then you try to use J again for summing. THis won't work (how will GAMS keep track of which j to use for the equation itself and the sum?).

The equation makes more sense as being defined only over the set K (EMISSION(K)).

Hope this helps
CHeers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
kenho12345
User
User
Posts: 3
Joined: 6 years ago

Re: ERROR 125 existing

Post by kenho12345 »

hi benger,

i had tried using K (EMISSION(K)) before ,but more error appeared
8 ')' expected
10 ',' expected
119 Number (primary) expected
121 Set expected
171 Domain violation for set
257 Solve statement not checked because of previous errors


Maybe i should say i propose of those,
i would mutiply the p(j.k) with a coeifficent f which less than a limit value,
is it possible to do that? Or i need to review my model?
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: ERROR 125 existing

Post by Renger »

Hi Kenhoe

GAMS points you to the place where the error appears and you should only check the first error because the other errors are usually caused by the first error.

It is not K (emissions(K)), but

equations
emissions(k);

emissions(k)..
....

Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply