uncontrolled set

Problems with syntax of GAMS
Post Reply
omarlma
User
User
Posts: 1
Joined: 5 months ago

uncontrolled set

Post by omarlma » 5 months ago

i want to get the the percentage of the shift in a table that depend on 3 sets,

TABLE Avg_F_dem(Sta_Gas, Yearr, Fuel_edo)
$ondelim
$include \\HWDMYCLOUD\example.csv
$offdelim
;

parameter F_dem_sta(Sta_Gas, Fuel_edo);
F_dem_sta(Sta_Gas, Fuel_edo)=((sum(yearr, Avg_F_dem(Sta_Gas, Yearr, Fuel_edo))/4)*6.29)/1000000;

the other sets like Sta_gas, yearr, fuel_edo are defined before
this is a brief exmple of the code so far, i have been trying to do something like,

"
set

diferencias_1 / 2013, 2014, 2015 /
diferencias_2 /2014, 2015 ,2016 /
Avg_F_dem_1(Sta_Gas, diferencias_1, Fuel_edo)
Avg_F_dem_2(Sta_Gas, diferencias_2, Fuel_edo)
;

Avg_F_dem_1(Sta_Gas, diferencias_1, Fuel_edo)= Avg_F_dem(Sta_Gas, Yearr, Fuel_edo)$(yearr<2016);
Avg_F_dem_1(Sta_Gas, diferencias_1, Fuel_edo)= Avg_F_dem(Sta_Gas, Yearr, Fuel_edo)$(yearr>2013);
shift2025fuelSta(Sta_Gas, Fuel_edo)= (sum(( diferencias_1 , diferencias_2), Avg_F_dem_1(Sta_Gas, diferencias_1, Fuel_edo)-Avg_F_dem_2(Sta_Gas, diferencias_2, Fuel_edo))/2

"

And neither i can get that shift using yearr("2014") or $(year<2016) with other kinds of aproches (so far...)
Please help!

User avatar
Gideon Kruseman
User
User
Posts: 23
Joined: 1 year ago

Re: uncontrolled set

Post by Gideon Kruseman » 5 months ago

It looks like you are trying to use subsets. You need to define diferencias_1 and diferencias_2 as such

sets
diferencias_1(yearr) / 2013, 2014, 2015 /

diferencias_2(yearr) / 2014, 2015, 2016 /

;
Gideon Kruseman
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData

Post Reply