Index change for constraints

Problems with syntax of GAMS
Post Reply
mrv_ce
User
User
Posts: 11
Joined: 7 months ago

Index change for constraints

Post by mrv_ce » 2 weeks ago

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: 81
Joined: 2 years ago
Location: Rosario - Argentina

Re: Index change for constraints

Post by Manassaldi » 2 weeks ago

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: 11
Joined: 7 months ago

Re: Index change for constraints

Post by mrv_ce » 2 weeks ago

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: 81
Joined: 2 years ago
Location: Rosario - Argentina

Re: Index change for constraints

Post by Manassaldi » 2 weeks ago

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: 11
Joined: 7 months ago

Re: Index change for constraints

Post by mrv_ce » 1 week ago

That is worked. Thanks a lot :)

Post Reply