could you please tell me exactly what is the solution of the above issue if i need to refer to index plus variable

Ø¨ØªØ§Ø±ÙŠØ® Ø§Ù„Ø®Ù…ÙŠØ³ØŒ 24 Ù…Ø§ÙŠÙˆØŒ 2012 UTC+3 5:00:01 ØµØŒ ÙƒØªØ¨ Ryan Ren:

ff(i,j)… f(i,j) =e= e_t(j+s(i,j)) *p_n(i)*x(i,j)*p1(i,j)

the lag operation used at e_t(j+s(i,j))

when i run the program,there will be a error 62:endogenous lag

operations are illegal.

‘j+s(i,j)’ is illegal and cannot be used as a index.

s(i,j) is a value, while j is an index here ( in fact it is a string).

in e_t(j+s(i,j)) you are using ‘+’ operation for index and values,

this is not illegal in GAMS.

for example:

Set j /1,2,three/;

Parameter S(j)

/

1 11,

2 22,

three 33

/;

then S(‘1’) have value 11 and S(‘three’) have value 33

the order of a index, which is an positive integer, can be obtained using function ord().

for example:

ff(i,j)… f(i,j) =e= e_t(i,j) + ord(j);

HTH,

Yan

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.