Hello Everyone,

I am developing a pricing model, where I need to determine the price of selling electricity as a part of my research project for a master’s degree. This is my first time using GAMS and I kindly ask for help to add the model into GAMS and run it without errors.

In the pricing model, I have two pricing schemes; one pricing scheme (called RTP) has hourly values (over the year), and the other scheme (called ToU) has only 3 values over the whole year, where each value corresponds to a period of set of hours of each day. The hours and the periods do not change over the year.

On the other hand, the demand for electricity in both pricing schemes is changing hourly. This means that there is agreement in the time periods between one pricing scheme and disagreement with the other pricing scheme. Equation to clarify,

i Real Time Pricing Sectors /Residential, Commercial/

j Time of Use Tariff Sectors /Industrial, Water/

k Time Periods /1*8760/
p Pricing Periods in Time of Use Tariff /1*3/

d Number of Days in a Year /1

*365/*

n Number of Hours in a day /124/

n Number of Hours in a day /1

h Number of Hours in a Period /1*8/;

- The Demand_RTP(i,k) matches in terms of sets the Price_RTP(i,k)
- The Demand_ToU(j,k) does not match in terms of set the Price_ToU(j,p)

Note: Price_ToU(j,p), Price_RTP(i,k), Demand_RTP(i,k), Demand_ToU(j,k) are all variables to be determined by the optimisation problem.

I need to calculate the total payments for sectors set (j), which essentially Price_ToU(j,p)*Demand_ToU(j,k), and to multiply the demand of certain hour of a certain day with the correspondsing pricing period, I developed this equation:

k= (d-1)*24+(p-1)*8+h,

to help me allocate the demand value of each (k) period into each respective period over the whole year. However, I could not translate this into GAMS, where I receive the following errors,

146 Total_Bills… B=e=sum((i,k),Price_RTP(i,k)*Demand_RTP(i,k))+sum[j,sum(d,sum[p(sum[(h),Price_ToU(j,p)*Demand_ToU(j,(p-1)*8+(d-1)*24+h)])])];

**** $145 $145,278 $148,133$148,133,133,654,300

**** 133 Incompatible operands for addition

**** 145 Set identifier or quoted element expected

**** 148 Dimension different - The symbol is referenced with more/less

**** indices as declared

**** 278 Lags are not allowed on maps

**** 300 Remaining errors not printed for this line

**** 408 Too many ),] or }

**** 654 The right side of an equation cannot be a set expression

In addition, I am trying to add a constraint that make sure that there is no change in the daily demand energy consumption before and after the pricing policy implementation. Since, the demand is hourly based values, I created this equation,

k=n+(d-1)*24,

to help sum each 24 hours and compare them with the coressponding day before the implementation of the policy, but I also fail into translate this into GAMS and receive the following errors:

138 Energy_Consumption_Residential(d)… Demand_BeforeResidential(d)=e=sum(n,Demand_RTP(‘Residential’,n+(d-1)*24));

**** $171,148,133,147,8,408

**** 8 ‘)’ expected

**** 133 Incompatible operands for addition

**** 147 Real value for lag operator expected

**** 148 Dimension different - The symbol is referenced with more/less

**** indices as declared

**** 171 Domain violation for set

**** 408 Too many ),] or },

where Demand_BeforeResidential(d) is a known parameters, and the Demand_RTP is orginally indexed with (i,k).

I am sorry for the long question, I sincerely apprecaite any inputs or help!

kind regards,

Omar

Fourth Draft.gms (10.5 KB)

Wind_Available.xlsx (216 KB)

Demand_BeforeIndustrial.xlsx (12.2 KB)

Demand_BeforeResidential.xlsx (12.2 KB)

Demand_BeforeWater.xlsx (12.2 KB)

PV_Available.xlsx (186 KB)

Demand_BeforeCommercial.xlsx (12.2 KB)