Page 1 of 1

Indexing

Posted: Sat May 08, 2021 11:29 am
by Kobby56
I am working on a dynamic model where most of the variables have are indexed with time. However one of my decision variables is constant and i want it to remain constant across time. So i created a new variable that varies with time and assigned it to the one which does not vary;

Code: Select all

Variables

R renewable energy capacity
E(t) conventional energy consumption
C RE energy released
z total cost;
variable M(t);
M(t)=R;
But I always get the error that a suffix is missing. It does same when i assign the variable as a constraint in the LP model. Any way to get this worked around?

Re: Indexing

Posted: Mon May 10, 2021 4:01 pm
by abhosekar
The error you get makes sense. Before solve, the variables do not have any values, they have attributes (lower bound, upper bound, level values). Therefore, when you say M(t) = R, GAMS gives you error.
If you want a variable to stay constant, you should fix it using .fx as follows.

M.fx(t) = R;

Hope this helps.

- Atharv