Problem with sum in GAMS

Hi all,

I have problem with this sum:

set t / 1 * 24 /;

set t1 / 22 * 24 /;


variable U(t);

In my equation, I would like to sum the variable U(t) on all values of t equal to t1, in other words, I want to make a sum: sum(t $ (t = t1), U(t)).

(Normally, I can only make a sum like this: sum(t $ (ord(t) = ord(t1)), U(t)) ).

Is there anyone know how to do this, please help me?

Thank you!


Kind regards,
Ni



\

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.

Dear Ni,

Try with SAMEAS(t,t1).


Cheers,
Pedro

On Tue, Jan 27, 2015 at 2:07 PM, ni le wrote:

Hi all,

I have problem with this sum:

set t / 1 * 24 /;

set t1 / 22 * 24 /;


variable U(t);

In my equation, I would like to sum the variable U(t) on all values of t equal to t1, in other words, I want to make a sum: sum(t $ (t = t1), U(t)).

(Normally, I can only make a sum like this: sum(t $ (ord(t) = ord(t1)), U(t)) ).

Is there anyone know how to do this, please help me?

Thank you!


Kind regards,
Ni



\

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.



\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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.

Hi Pedro,

Thank you so much for your reply.
It works nicely.

Cheers,
Ni

On Tuesday, January 27, 2015 at 3:50:16 PM UTC+1, PowerChile wrote:

Dear Ni,

Try with SAMEAS(t,t1).


Cheers,
Pedro

On Tue, Jan 27, 2015 at 2:07 PM, ni le wrote:

Hi all,

I have problem with this sum:

set t / 1 * 24 /;

set t1 / 22 * 24 /;


variable U(t);

In my equation, I would like to sum the variable U(t) on all values of t equal to t1, in other words, I want to make a sum: sum(t $ (t = t1), U(t)).

(Normally, I can only make a sum like this: sum(t $ (ord(t) = ord(t1)), U(t)) ).

Is there anyone know how to do this, please help me?

Thank you!


Kind regards,
Ni



\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.



\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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.