Omitting dimensions

Hello everyone!

The following three parameters are loaded from a GDX file, partly defined over the universal set (*).

parameter1(r,i,,t)
parameter2(
,,,,,,)
parameter3(r,,i,,t)

Now, I want to omit some dimensions by summing over ().
However, this doesn’t work with GAMS.
Note that the universal sets (
) refer to different sets.

For parameter1(r,i,,t) I found a solution by using the alias command (,g) and then summing over the subset of g, i(g):
parameter11(r,i,t) = sum(i(g),parameter1(r,i,g,t));

Yet, this solution doesn’t work anymore for parameter2 or parameter3, as they are defined over more than one universal set (*).

Do you have a suggestion how to solve this problem?

Thanks in advance!

Hi hein,

Have a look here and especially at example 4: https://www.gams.com/latest/docs/UG_GDX.html
You might want to use something like: “$load setNo1<Parameter2.dim1” etc. to load the setelements from GDX.

Regards,
GFA

Yet, this solution doesn’t work anymore for parameter2 or parameter3, as they are defined over more than one universal set (*).

Why not? Just make more aliases: alias(*,u1,u2,u3,u4,u5,u6,u7) and use the same technique as for parameter1.

-Michael

Thanks for the suggestions, GVA and Michael!

Both methods worked!