Hello guys

I am new to GAMS.

While doing one programme I encountered following problem:-

I have one set for number of stages called k (having value 2) and

number of temperature locations (no. of stages+1 ). Now many of my

parameters are defined on number of stages and one on no. of

temperature locations.

I have expressions like

Set m /1*3/ number of temperature location*

k(m) /12/ number of stages;

Parameter t(i,m)

q(i,k) ;

t(i,k) - t(i,k+1) =e= constant*(sum(k,q(i,k))); …(1)

and t(i,k)*t(i,k+1);

the problem is that I need to have t(i,“1”) to t(i,“3”) while using k

set because there is other parameter (q(i,k)) depending on k. So I run

into problem by not getting t(i,“3”).

Can anyone suggest any alternative usage of sets so that this

problem can be resolved? I will be greatful.

\

Hi

the easiest way is removing the dimension of parameter t in definition(i.e. Parameter t;) and define an separate equation for k=2,i.e.

t(i,‘2’) - t(i,‘3’) =e= constant*(sum(k$(ord(k)=2),q(i,k))); …(1)

and t(i,‘2’)*t(i,‘2’);

On Mon, Aug 1, 2011 at 12:29 PM, pratik patil wrote:

Hello guys

I am new to GAMS.

While doing one programme I encountered following problem:-

I have one set for number of stages called k (having value 2) and

number of temperature locations (no. of stages+1 ). Now many of my

parameters are defined on number of stages and one on no. of

temperature locations.

I have expressions like

Set m /1*3/ number of temperature location*

k(m) /12/ number of stages;

Parameter t(i,m)

q(i,k) ;

t(i,k) - t(i,k+1) =e= constant*(sum(k,q(i,k))); …(1)

and t(i,k)*t(i,k+1);

the problem is that I need to have t(i,“1”) to t(i,“3”) while using k

set because there is other parameter (q(i,k)) depending on k. So I run

into problem by not getting t(i,“3”).

Can anyone suggest any alternative usage of sets so that this

problem can be resolved? I will be greatful.

To post to this group, send email to gamsworld@googlegroups.com.

To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hello,

Not quite sure what the issue is but maybe you want to use an alias

for k. Aliases let you run over a set with multiple indices, like

this:

set k / 1 * 3 /;

alias (k,k2);

f(k)… s(k) =e= sum{k2$[ord(k2) wrote:

Hello guys

I am new to GAMS.

While doing one programme I encountered following problem:-

I have one set for number of stages called k (having value 2) and

number of temperature locations (no. of stages+1 ). Now many of my

parameters are defined on number of stages and one on no. of

temperature locations.

I have expressions like

Set m /1*3/ number of temperature location*

k(m) /12/ number of stages;

Parameter t(i,m)

q(i,k) ;

t(i,k) - t(i,k+1) =e= constant*(sum(k,q(i,k))); …(1)

and t(i,k)*t(i,k+1);

the problem is that I need to have t(i,“1”) to t(i,“3”) while using k

set because there is other parameter (q(i,k)) depending on k. So I run

into problem by not getting t(i,“3”).

Can anyone suggest any alternative usage of sets so that this

problem can be resolved? I will be greatful.

–

To post to this group, send email to gamsworld@googlegroups.com.

To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

– Steven Dirkse, Ph.D. GAMS Development Corp., Washington DC Voice: (202)342-0180 Fax: (202)342-0181 sdirkse@gams.com http://www.gams.com