> 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