Dimension Different Error (electricity pricing model)

Problems with syntax of GAMS
Post Reply
omarrossan
User
User
Posts: 9
Joined: 10 months ago

Dimension Different Error (electricity pricing model)

Post by omarrossan »

Hello Everyone,

I am developing a pricing model, where I need to determine the price of selling electricity.
The pricing scheme should determine three pricing values where each value corresponds to a pricing period. Each pricing period consist of a set of number of hours (let's simplify it 8 hours). However, even though, the price of each period is constant over the period, there is an electricity demand which changes on hourly basis. therefore, the demand values of each period should be have the same price.

Based on that, I defined the following sets

Sets
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/
h Number of Hours in a Period /1*8/;

I have defined a varaible called Demand_ToU (j,k) and as you can see it is indexed for two sectors (Industrial, Water) and each time period (from 1 to 8760) becuase these sector have to consume each hour. Also, I have defined also a varaible called Price_ToU (j,p) and it is indexed for two sectors but only for three pricing periods, which resembles the time of use tariff, which means I need to apply the three pricing periods on all demand values (which are indexed with k).

In addition, I have defined 365 days (d), each day has 24 hours as you know. - I have divided the day into 3 equal periods (p) (1,2,3). - Each period will then have 8 hours, where each hour has its own value of demand.ToU (that's why I have defined demand.ToU(j,k)). However, these periods will repeat over the whole year (365 days) and I will always use the same pricing values for the periods (1,2,3). In other words, the first period (let's day the first eight hours) of each day, I will use always use p1.

Accordingly, to be able to call the right index value of Demand.ToU (j,k), I defined a equation [j, p-1+8*(d-1)+h]
to help me find the right demand.value for the each prcing period,

then, I added a function to calculate the total bills as follows:

Total_Bills.. B=e=sum((j,p),Price_ToU(j,p))*(sum(d,h),Demand_ToU(j,((p-1)*8+(d-1)*24+h)));

but I receive the follwoing error,

Total_Bills.. B=e=sum((j,p),Price_ToU(j,p))*(sum(d,h),Demand_ToU(j,((p-1)*8+(d-1)*24+h)));
**** $148,8,409
**** 8 ')' expected
**** 148 Dimension different - The symbol is referenced with more/less
**** indices as declared
**** 409 Unrecognizable item - skip to find a new statement
**** looking for a ';' or a key word to get started again

I would be grateful if anybody could help me on these errors,

p.s. there are parts of the code, but I have exluded them to keep the question short
User avatar
bussieck
Moderator
Moderator
Posts: 1043
Joined: 7 years ago

Re: Dimension Different Error (electricity pricing model)

Post by bussieck »

I think you need to upload something that lets us reproduce the error. I can't do this from the code snippets you have pasted.

-Michael
omarrossan
User
User
Posts: 9
Joined: 10 months ago

Re: Dimension Different Error (electricity pricing model)

Post by omarrossan »

Dear Michael,

Thank you for your reply!
Sorry for the incovenience and please find attached the code file,
I look forward to your reply,

kind regards
Omar
Attachments
Third Draft.gms
(11.22 KiB) Downloaded 71 times
Post Reply