Problem with set declaration

Hi everyone

I’m building a CGE model and have some troubles. Let me describe clearly my problem.
I declared a set for activity sectors like this

set i sectors / a1*a43 /

So, set I has 43 elements. It combines component of agricultural sector (from a1 to a4), of industry (from a5 to a30) of services sector (from a31 to a38) and public sector (a39 to a43).

I want to know first the impacts on all the 43 sectors (here there is no problem). Secondly, I want to address the impacts on the 4 aggregated sectors (agriculture, industry, private services and public services). This is where my problem lies on. I don’t know how to implement it.

I thought I can define another set which contains (agr, ind, ser, sad) but I don’t know how to do that. If this is done, I thought I would need declare a parameter after the solve statement to catch variables I want to display on the aggregated set.

Please I need your help. Thanks in advance!

Rodrigue

Hi,

The documentation on subsets might be helpful.

Best,
Fred

Hi Fred

I appreciated your reply and went through the link many times. I learned many things about set declaration. Unfortunately I didn’t find any solution to my problem.

As I said, I have the following set declaration

Set i /a1*a43 /

Now, I also want to declare another set let’s say

Set k / agr, ind, ser, sad /

By doing so, the elements of set k are the summation of some elements of set i.

To be more precised, agr must take the 4 first elements of set i

Something like agr = a1+a2+a3+a4 and so on. You understand that I want to link agr, ind, ser and sad to a1, a2,…,a43.

Any other idea?

Rodrigue,

If I understand correctly, you have a set of activities a1*a43, and these activities belong to one of the following 4 types: agr, ind, ser, sad. You want to make this assignment and use it.

This is a very standard thing to do. You should use a multi-dimensional set as described here:

https://www.gams.com/32/docs/UG_SetDefinition.html#UG_SetDefinition_Multi-dimensionalSets

The mapping sets let you operate over the activities a_i that belong to each of the activity types.

-Steve

Thank you Steve.

You have got me very well. Thank you for the way you provide me. I’m going to follow that description and I will let you know wether it works.