Index change for constraints

Problems with syntax of GAMS
Post Reply
mrv_ce
User
User
Posts: 19
Joined: 5 years ago

Index change for constraints

Post by mrv_ce »

Hello everybody,

I need to write an equation for my model.
I m trying to write T(i) > T(i-1) for every i .
T is decision variable and i is index for T variable.
i is a set which includes 1,2,3,...,N. N is very big integer.

Can you help me please?

Thanks a lot.
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Index change for constraints

Post by Manassaldi »

Hi, Is T a binary or continuous variable?
Is "T(i)" greater (>) or greater than or equal (>=) than "T(i-1)" ?
Bye
mrv_ce
User
User
Posts: 19
Joined: 5 years ago

Re: Index change for constraints

Post by mrv_ce »

Hi,
T is continuous and positive variable.
Constraint has equality.
In gams code is like " eq(i).. T(i) =g= T(i-1)"
However for the i-1 case it can not run.
Thanks.
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Index change for constraints

Post by Manassaldi »

Ok, you must start with the second value of i

eq(i)$(ord(i) ge 2).. T(i) =g= T(i-1);

Bye!
mrv_ce
User
User
Posts: 19
Joined: 5 years ago

Re: Index change for constraints

Post by mrv_ce »

That is worked. Thanks a lot :)
Post Reply