Hi,

I have a little super annoying problem in GAMS.

I have the variables

t(i,j) ‘what person i should pay j’

z ‘number of kroner to be transferred’ ;

And a constant av.

The objective function is transfer … z =e= sum((i,j),

t(i,j)) ;

The constraint is:

balance(i) … sum(j, t(i,j))-sum(j,t(j,i)) =e= av ;

The problem is that since t is defined with the indexes t(i,j) it

can’t do the sum sum(j,t(j,i)). It just gives the error message

“Domain violation for set”…

How do I make a sum using another index than what it was defined with?

Thank you in advance

\

instead of balance(i) … sum(j, t(i,j))-sum(j,t(j,i)) =e= av ;

try this balance… sum(i,(sum(j, t(i,j))-sum(j,t(j,i))) =e= av ;

On Jan 5, 12:35 pm, Karonia wrote:

Hi,

I have a little super annoying problem in GAMS.

I have the variables

t(i,j) ‘what person i should pay j’

z ‘number of kroner to be transferred’ ;

And a constant av.

The objective function is transfer … z =e= sum((i,j),

t(i,j)) ;

The constraint is:

balance(i) … sum(j, t(i,j))-sum(j,t(j,i)) =e= av ;

The problem is that since t is defined with the indexes t(i,j) it

can’t do the sum sum(j,t(j,i)). It just gives the error message

“Domain violation for set”…

How do I make a sum using another index than what it was defined with?

Thank you in advance

\

Hi Karonia,

You probably define the sets i and j separately, in that case t(i,j) and t(j,i) indeed create domain violation error.

If that is the problem, you can define a single set i and create alias(i,j) to define j . Leave the equations as they are.

Hope this helps!

On Thu, Jan 5, 2012 at 11:35 AM, Karonia wrote:

Hi,

I have a little super annoying problem in GAMS.

I have the variables

t(i,j) ‘what person i should pay j’

z ‘number of kroner to be transferred’ ;

And a constant av.

The objective function is transfer … z =e= sum((i,j),

t(i,j)) ;

The constraint is:

balance(i) … sum(j, t(i,j))-sum(j,t(j,i)) =e= av ;

The problem is that since t is defined with the indexes t(i,j) it

can’t do the sum sum(j,t(j,i)). It just gives the error message

“Domain violation for set”…

How do I make a sum using another index than what it was defined with?

Thank you in advance

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.

Hi Paolo.

My experience for busses like DDR w SSTL technology that signals switch around VddQ/2 as a DC value, then extracted S-parameters from EM field solvers should solve @ DC operating VddQ/2 accurately as the signal shape due to reflections on the memory channel especially ISI effects r greatly dependent on accurate DC solution of the S-parameters.

One of the big benefits of MOM from EEsof is that it solves the fields @ DC n not extrapolate to DC.

U can also choose between RF modes n uwave mods while assuring accurate DC solution that is critical to such interfaces as memory DDR, GDDR n LPDDR where switching happens starting from a DC level such as VddQ/2 or VddQ.

Hope this helps.

Regards

On Fri, May 18, 2012 at 3:41 AM, Paolo Agnolucci wrote:

Hello,

I need to incorporate the index of a sum in the expression being summed. For example suppose that I have a set i with a parameter defined over the set i. I need to sum something like:

ATot= sum(i, i *a(i))

Can somebody please let me know how I can do this?

Thanks,

Paolo

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.

Use the ord() function like this:

ATot= sum(i, ord(i)*a(i))

On Thu, May 17, 2012 at 3:11 PM, Paolo Agnolucci wrote:

Hello,

I need to incorporate the index of a sum in the expression being summed. For example suppose that I have a set i with a parameter defined over the set i. I need to sum something like:

ATot= sum(i, i *a(i))

Can somebody please let me know how I can do this?

Thanks,

Paolo

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 Paolo,

ATot = SUM(i, ORD(i)*a(i))

Cheers,

Pedro

On Thu, May 17, 2012 at 11:11 PM, Paolo Agnolucci wrote:

Hello,

I need to incorporate the index of a sum in the expression being summed. For example suppose that I have a set i with a parameter defined over the set i. I need to sum something like:

ATot= sum(i, i *a(i))

Can somebody please let me know how I can do this?

Thanks,

Paolo

PEDRO JAVIER RAMÃREZ TORREALBA

Ingeniero Civil ElÃ©ctrico PUC

MSc en IngenierÃa ElÃ©ctrica PUC

Londres, REINO UNIDO

Celular: +44-(0)-75-806-93119

Casa: +44-(0)-20-785-22591

–

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 Nikit,

I reckon I should have thought of ord( ) but I hadn’t so thanks a lot!

Paolo

On 18 May 2012 08:20, Nikit Abhyankar wrote:

Use the ord() function like this:

ATot= sum(i, ord(i)*a(i))

On Thu, May 17, 2012 at 3:11 PM, Paolo Agnolucci wrote:

Hello,

I need to incorporate the index of a sum in the expression being summed. For example suppose that I have a set i with a parameter defined over the set i. I need to sum something like:

ATot= sum(i, i *a(i))

Can somebody please let me know how I can do this?

Thanks,

## Paolo

\

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.