Hello Everybody,

I have tried a model with an objective function and some secondary functions.
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:

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

## SUM-Problem

### Re: SUM-Problem

I think the message from the compiler for error 125 is pretty clear:

-Michael

*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

### Re: SUM-Problem

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?

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?

### Re: SUM-Problem

No, not really. If your program does not do what you expect than you need to

-Michael

*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