Hello everyone,

I have a problem with indices k and m, where m is alias of k.

and these are varying as k = 1 to 96; m= 1 to 95.

now the equation that i have to write is-

p(k) = sum(m, pd(m)*x(k-m+1));

here pd(k) is input power, and x(k) is binary variable, and p(k) is positive variable.

But i am facing problem in writing this equation.

The code is-

set k /1*96/

alias(m,k);

set lim(m) /1*95/;

parameter pd(k);

variables

z;

positive variable

p(k);

binary variable

x(k);

equations

cost

power(k);

power(k)… p(k)=e= sum(m$lim(m),pd(m)*x(k-m+1));

The parameters price and power are imported from excel sheet.

but i am not able to write this equation as GAMS considers indices as character and any operation between two indices or like ‘-m’ wont work.

PLEASE help me through this equation

if i simplify this equation, then i get

p(k)= pd(1)*x(k) + pd(2)*x(k-1) + …+ pd(k)*x(1);

but i am getting problem with variable x as indices is varying in reverse order. So i am not able to write it in this way also.

Please help, it is urgent.

–

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 https://groups.google.com/group/gamsworld.

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