Indexing

Problems with syntax of GAMS
Post Reply
Kobby56
User
User
Posts: 1
Joined: 1 month ago

Indexing

Post by Kobby56 » 1 month ago

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?

abhosekar
Moderator
Moderator
Posts: 176
Joined: 8 months ago

Re: Indexing

Post by abhosekar » 1 month ago

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

Post Reply