## Map set elements to another set

Problems with modeling
reddragon10
User
Posts: 2
Joined: 3 months ago

### Map set elements to another set

The following parameters are given, with a being a subset of aa. However, all the non-overlapping elements of aa with a are already kicked out of emis2. Hence, the remaining aa and a are basically the same.

emis1(r,a,t)
emis2(r,aa,t)

Now I want to define the dimensions of emis2 dependent from a, not aa - so that emis2(r,a,t).

Do you have any idea how I can do that? Maybe by mapping the remaining elements from aa to a?

dirkse
Moderator
Posts: 170
Joined: 5 years ago
Location: Fairfax, VA

### Re: Map set elements to another set

Hi,

Your subject talks about set elements, but your example mentions parameters, so I'm not sure what you're asking. But perhaps this is what you want:

Code: Select all

``````sets aa / blah blahblah /, a(aa) / blah /;
parameter pa(a), paa(aa);
paa('blah') = 1215;
pa(a) = paa(a);
``````
Since a is a subset of aa, you can index paa by a in the assignment above. The result is independent of paa('blahblah'), i.e. of the contents of paa for elements in aa - a.

HTH,

-Steve

reddragon10
User
Posts: 2
Joined: 3 months ago

### Re: Map set elements to another set

Hi,

sorry about the confusion with the topic, my question was how the parameter could be defined in dependence from a, not aa.