swap indices

Hi All,

I have a constraint as follows:

cons1(i,j)…z(i,j)+u(j)-u(i)+w(j)=g=0;

if ord(i)ord(j), then I want to exchange the indices in z variable.

Some examples:
CONS1(3,4)… z(3,4) + u(4) - u(3) +w(4) =G= 0 ;
CONS1(4,3)… z(3,4) + u(3) - u(4) +w(3) =G= 0 ;
CONS1(4,5)… z(4,5) + u(5) - u(4) +w(5) =G= 0 ;
CONS1(5,4). .z(4,5) + u(4) - u(5) +w(4) =G= 0 ;

Any comments would be highly appreciated.
Bests.


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.

I solved my problem after I posted. The solution is

cons1(i,j)…z(i,j)$(ord(i)ord(j))+u(j)-u(i)+w(j)=g=0;

From: hak_kut@hotmail.com
To: gamsworld@googlegroups.com
Subject: swap indices
Date: Tue, 19 Jun 2012 12:36:27 +0000

Hi All,

I have a constraint as follows:

cons1(i,j)…z(i,j)+u(j)-u(i)+w(j)=g=0;

if ord(i)ord(j), then I want to exchange the indices in z variable.

Some examples:
CONS1(3,4)… z(3,4) + u(4) - u(3) +w(4) =G= 0 ;
CONS1(4,3)… z(3,4) + u(3) - u(4) +w(3) =G= 0 ;
CONS1(4,5)… z(4,5) + u(5) - u(4) +w(5) =G= 0 ;
CONS1(5,4). .z(4,5) + u(4) - u(5) +w(4) =G= 0 ;

Any comments would be highly appreciated.
Bests.


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.


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.

Dear Hakan,

Check whether this helps.

cons1(i,j)$( ord(i)ord(j))…z(j,i)+u(j)-u(i)+w(j)=g=0;

but I think ur i and j should be defined as same sets.

Regards,
Cassandra, Nan YU

On Jun 19, 2012 8:39 PM, “Hakan Kutucu” wrote:

Hi All,

I have a constraint as follows:

cons1(i,j)…z(i,j)+u(j)-u(i)+w(j)=g=0;

if ord(i)ord(j), then I want to exchange the indices in z variable.

Some examples:
CONS1(3,4)… z(3,4) + u(4) - u(3) +w(4) =G= 0 ;
CONS1(4,3)… z(3,4) + u(3) - u(4) +w(3) =G= 0 ;
CONS1(4,5)… z(4,5) + u(5) - u(4) +w(5) =G= 0 ;
CONS1(5,4). .z(4,5) + u(4) - u(5) +w(4) =G= 0 ;

Any comments would be highly appreciated.
Bests.


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.


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.

OK, great!

On Jun 19, 2012 8:45 PM, “Hakan Kutucu” wrote:

I solved my problem after I posted. The solution is

cons1(i,j)…z(i,j)$(ord(i)ord(j))+u(j)-u(i)+w(j)=g=0;


From: hak_kut@hotmail.com
To: gamsworld@googlegroups.com
Subject: swap indices
Date: Tue, 19 Jun 2012 12:36:27 +0000

Hi All,

I have a constraint as follows:

cons1(i,j)…z(i,j)+u(j)-u(i)+w(j)=g=0;

if ord(i)ord(j), then I want to exchange the indices in z variable.

Some examples:
CONS1(3,4)… z(3,4) + u(4) - u(3) +w(4) =G= 0 ;
CONS1(4,3)… z(3,4) + u(3) - u(4) +w(3) =G= 0 ;
CONS1(4,5)… z(4,5) + u(5) - u(4) +w(5) =G= 0 ;
CONS1(5,4). .z(4,5) + u(4) - u(5) +w(4) =G= 0 ;

Any comments would be highly appreciated.
Bests.


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.


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.


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.