Page 1 of 1

Index change for constraints

Posted: Tue Apr 02, 2019 11:34 pm
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.

Re: Index change for constraints

Posted: Thu Apr 04, 2019 1:30 pm
by Manassaldi
Hi, Is T a binary or continuous variable?
Is "T(i)" greater (>) or greater than or equal (>=) than "T(i-1)" ?
Bye

Re: Index change for constraints

Posted: Thu Apr 04, 2019 1:57 pm
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.

Re: Index change for constraints

Posted: Thu Apr 04, 2019 2:10 pm
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!

Re: Index change for constraints

Posted: Mon Apr 15, 2019 6:26 pm
by mrv_ce
That is worked. Thanks a lot :)