summation of a variable over a scalar

Dear all

how is it possible to write summation of x to the power of i which i goes from 1 to c-1 in which c is a decision variable?
many thanks in advance,
Regards

\

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.

Try this:
sum(i$ ((ord(i) ge 1) and (ord(i) le card(c)-1)), x**i)

On Wed, Apr 15, 2015 at 9:07 AM, mahmood golabi wrote:

Dear all

how is it possible to write summation of x to the power of i which i goes from 1 to c-1 in which c is a decision variable?
many thanks in advance,
Regards

\

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.



\


\

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.

Thanks dear Rubaiee


by using your idea with a little change I wrote the code and the result is true:

set i /1*1000/
sum(i$((ord(i) ge 1) and (ord (i) le ((c)-1))),power(x, ord (i)))

Thanks again for your nice idea

\

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.