SUM-Problem

Problems with syntax of GAMS
Post Reply
sph_93
User
User
Posts: 8
Joined: 3 years ago

SUM-Problem

Post by sph_93 »

Hello Everybody,

I have tried a model with an objective function and some secondary functions.
grafik.png
With these two secondary functions, I get errors again and again and I do not know why.(Error125,171)

This is my written code for the two functions:
grafik.png
I can't find anything in the error descriptions of Gams that can help me with this problem.
I hope you can help me. Thanks a lot
User avatar
bussieck
Moderator
Moderator
Posts: 1038
Joined: 7 years ago

Re: SUM-Problem

Post by bussieck »

I think the message from the compiler for error 125 is pretty clear: Set is under control already. The cursor is under your r. You already control r on the equation, so you can't sum over it. You probably want an alias of r. Check out aliases in the GAMS documentation: https://www.gams.com/latest/docs/UG_Set ... mesForASet.

-Michael
sph_93
User
User
Posts: 8
Joined: 3 years ago

Re: SUM-Problem

Post by sph_93 »

Hello, Michael,

thank you for your prompt assistance. The equations are now without errors. But I have another problem now. I have declared the parameters with values, but when I execute the model I get the value 0 for the target function.
Can you help me with that?
Untitled_6.gms
(7.63 KiB) Downloaded 214 times
User avatar
bussieck
Moderator
Moderator
Posts: 1038
Joined: 7 years ago

Re: SUM-Problem

Post by bussieck »

No, not really. If your program does not do what you expect than you need to debug. You are best suited to do that. You know what you want and you know what you programmed. For someone else to dig in is very time intensive. Good luck.

-Michael
Post Reply