Indexing variables over a subset of the product of two sets

As the title of this thread describes, I’d like to index variables
over a subset of the product of two sets.

Here’s an example which yields: “Error 122. One dimensional set
expected”.

Sets

M /i1i10/
N /j1
j5/
P(M,N) /i2.(j3*j5),i3.j2/
;

Variable x(P);

I could achieve my goal by simply declaring x(M,N) instead of x(P) and
controlling values of M and N in equations with, for example, $
(P(M,N)). However, in the case I’m considering, M and N are sets which
both have cardinality around 1000 and P contains about 100 points.
Therefore, I’d rather declare 100 variables (indexing over P) rather
than 10^6 variables (indexing over (M,N)).

I apologize if this is too basic a question for this group.

Thanks in advance for your answers.

\

Hello
Can you check if it is what you need:

Sets
M /i1i10/
N /j1
j5/
P(M,N) /i2.(j3*j5),i3.j2/ ;

and then whenever you need x use:

X(M,N) $ P(M,N)

Let me know if it works.
Regards


محمد صادق تولّلی
Mohammad Sadegh Tavallali
National University of Singapore



On Fri, May 27, 2011 at 8:54 PM, aTn wrote:

As the title of this thread describes, I’d like to index variables
over a subset of the product of two sets.

Here’s an example which yields: “Error 122. One dimensional set
expected”.

Sets

M /i1i10/
N /j1
j5/
P(M,N) /i2.(j3*j5),i3.j2/
;

Variable x(P);

I could achieve my goal by simply declaring x(M,N) instead of x(P) and
controlling values of M and N in equations with, for example, $
(P(M,N)). However, in the case I’m considering, M and N are sets which
both have cardinality around 1000 and P contains about 100 points.
Therefore, I’d rather declare 100 variables (indexing over P) rather
than 10^6 variables (indexing over (M,N)).

I apologize if this is too basic a question for this group.

Thanks in advance for your answers.


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.