Hello. I am new to GAMS, I’ve been trying to programmed the following equation into GAMS as parameter but somehow cannot obtain my desired result. My code is as below.
sets
i temperature interval /i0*i13/
parameters
T(i) Length of interval i
/ i0 0
i1 2
i2 6
i3 2
i4 8
i5 2
i6 4
i7 0
i8 2
i9 6
i10 2
i11 8
i12 2
i13 4/
Parameter Time(i)/i0 0/;
Time(i) = Time(i-1) + T(i);
The result are as below
i1 2.000, i2 6.000, i3 2.000, i4 8.000, i5 2.000, i6 4.000
i8 2.000, i9 6.000, i10 2.000, i11 8.000, i12 2.000, i13 4.000
My intended code is to make it so that:
Time(i0) = 0
Time(i1) = Time(i0) + T(1)
Time(i2) = Time(i1) + T(2)
Thank you