Error message on constraint

Problems with syntax of GAMS
Post Reply
Boumghar
User
User
Posts: 4
Joined: 4 years ago

Error message on constraint

Post by Boumghar »

I receive an error message for the CONSTRAINT(INT) as follows :

CONSTRAINT(INT).. SUM(JNT,SAM(INT,JNT)) =E= SUM(JNT,SAM(JNT,INT));

The error message is :

')' expected .

Where is the problem ?
I attach the error message and the whole program
image.png
image.png
MCS_DZ_2018_05032020.gms
(27.45 KiB) Downloaded 218 times
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Error message on constraint

Post by Renger »

Hii
It is in the constraint just above:

Code: Select all

OPTIMIZE.. OPT =E= SUM((INT,JNT)$(SAM0(INT,JNT) NE 0),(SAM(INT,JNT))
 *(LOG(SAM(INT,JNT)+delta)-LOG(SAM0(INT,JNT)+delta)));
The *-sign is in the first lne, so Gams assumes that it is a comment and not a mutitplcation. Add one space and all is fine.
(you also see this in your editor as the text is greyed out).

Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Boumghar
User
User
Posts: 4
Joined: 4 years ago

Re: Error message on constraint

Post by Boumghar »

Thank you for your response.
The error is fixed but I didn't get the solution beacause of restrictions of my licence!!
image.png
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Error message on constraint

Post by Renger »

Hi
Ask GAMS for a community license.
CHeers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply