Problems with syntax of GAMS
Post Reply
Posts: 1
Joined: 2 months ago


Post by Kobby56 » 2 months 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


R renewable energy capacity
E(t) conventional energy consumption
C RE energy released
z total cost;
variable M(t);
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?

Posts: 190
Joined: 10 months ago

Re: Indexing

Post by abhosekar » 2 months 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