question about summation

Dear my friend
I have the following function that I want to formulate in gams , could you please giude me how could I formulat it?

num=sum(from i=1 to i=T-k) , (1+r)**i

T=5
K={1,2,3,4}

after solve I need the following outputs
for k=1 (1+r)^1+(1+r)^2+(1+r)^3+(1+r)^4
for k=2 (1+r)^1+(1+r)^2+(1+r)^3
for k=3 (1+r)^1+(1+r)^2
for k=4 (1+r)^1


thanks in advance
mohammad


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/groups/opt_out.

mohammad, something along the lines of…

eqnum(k)… num(k)=e=sum(i$(ord(i) le (T-ord(k)),(1+r)**ord(i));

regards
Claudio

On Fri, Feb 7, 2014 at 4:23 AM, m asgary wrote:

Dear my friend
I have the following function that I want to formulate in gams , could you
please giude me how could I formulat it?

num=sum(from i=1 to i=T-k) , (1+r)**i

T=5
K={1,2,3,4}

after solve I need the following outputs
for k=1 (1+r)^1+(1+r)^2+(1+r)^3+(1+r)^4
for k=2 (1+r)^1+(1+r)^2+(1+r)^3
for k=3 (1+r)^1+(1+r)^2
for k=4 (1+r)^1

thanks in advance
mohammad


“gamsworld” group.
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/groups/opt_out.

\