## ERROR 125 existing

Problems with syntax of GAMS
kenho12345
User Posts: 3
Joined: 1 year ago

### ERROR 125 existing

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
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.

Renger
Posts: 263
Joined: 2 years ago

### Re: ERROR 125 existing

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

kenho12345
User Posts: 3
Joined: 1 year ago

### Re: ERROR 125 existing

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?

Renger
Posts: 263
Joined: 2 years ago

### Re: ERROR 125 existing

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