Command to aggregate parameters

Problems with syntax of GAMS
Post Reply
Abich1414.
User
User
Posts: 7
Joined: 3 months ago

Command to aggregate parameters

Post by Abich1414. » 3 months ago

Dear Micheal and GAMS family, I am trying to calculate the aggregated weighted average of parameters of the aggregated regions. But I failed to do that. it is very urgent. Could you please help me?. I have attached the file below and i am grateful if you could help me.

I have 3 parameters (AVEt,AVEnt and trade), sector I_org, region R_org and S_org in the gdx file
I have aggregated the sectors from i_org to I, Regions from R_org to R and S_org to S.
Now what i want to calculate is the new parameter of weighted average of AVET of the new aggregated sector I from the aggregated R to the other aggregated region S that is ( sum (trade*AVEt/ sum trade)

WAVEt(i,r,s)=

Thank you in advance.
Agg.gdx
(1.48 MiB) Downloaded 51 times

User avatar
bussieck
Moderator
Moderator
Posts: 832
Joined: 6 years ago

Re: Command to aggregate parameters

Post by bussieck » 3 months ago

Why don't you share your attempts that also shows the aggregation of the sets etc. Please share where the issue are and what you are struggling with. You need to have a basic understanding of GAMS and its language before you can use it. I understand and sympathetic about the struggles learning GAMS, it is quite different than regular programming languages, but it is worth learning starting with the tutorials on the GAMS web site.

-Michael

Abich1414.
User
User
Posts: 7
Joined: 3 months ago

Re: Command to aggregate parameters

Post by Abich1414. » 3 months ago

Dear Micheal, Thank you for your dedicated response to GAMS users and sorry for not sharing my attempt.
Please have a look at the following code.
The problem I faced is the newly created parameter WAAVEt(i,r,s) is not displayed in the GDX file.
Here is, the command I used to create the new parameter.
Parameter WAAVEt(i,r,s) " trade based weighted average of AVEt";
WAAVET(i,r,s) =SUM((i_org,r_org,s_org, AVEt(i_org,r_org,s_org ))$ (AVEt(i_org,r_org,s_org)* trade(i_org,r_org,s_org))/sum(trade(i_org,r_org,s_org)));


DISPLAY AVEt, AVEnt , r , i, WAAVEt;

But WAAVEt is not displayed in the GDX file

For your reference, I have attached the GMS and GDX file.
Sincerely,
Agg.gms
(3.96 KiB) Downloaded 63 times
Agg.gdx
(1.48 MiB) Downloaded 64 times

Post Reply