Wotan
Wotan

Reputation: 3

How do I sum up over an uncontrolled set?

I have to develelop a mcp model using GAMS. I am not quite experienced with this program but the error compilation website was not quite helpful either.

I have tried varying the indices but this would only change the error from uncontrolled set to controlled set. I did also try using the Alias function but either I did it wrong or it did not work at all.

Variables
 lambda(p)       shadow price
;

POSITIVE VARIABLES
         R(t,p)    production
         S(t,p)    Stock at time t
;


RES_resource_lambda(p)..
         -(SUM(t, R(t,p)) - S(t,p)) =g= 0
;

Upvotes: 0

Views: 114

Answers (1)

Lutz
Lutz

Reputation: 2292

The problem is about the last t in the equation:

RES_resource_lambda(p)..
         -(SUM(t, R(t,p)) - S(t,p)) =g= 0
;

The t in R(t,p) is controlled by the SUM, but nothing controls the t in S(t,p). You need to specify, what you want to do with this one, e.g. add it to the SUM as well.

Upvotes: 1

Related Questions