TOWARDS IMPOSING DAYPARTED RESTRICTIONS ON TOKENISED ENERGY WITHIN PEER-TO-PEER MARKETS

This piece proposes a novel mechanism for peer-to-peer electricity trading whereby energy tokens can only be redeemed in the same part of the day as when they were generated. The aim of this regulatory mechanism is to reduce token hoarding by consumers to better align the physical production and consumption of electricity, which in turn could decrease electrical system losses and minimise the chance of grid imbalances. To establish the effectiveness of this dayparting mechanism a market simulation is performed. This simulation is made up of 24 consumers and five producers profiles over a seven-day week. An optimisation is performed to most effectively allocate energy tokens from producers to consumers, aiming to minimise the total energy imported from the larger grid i.e. to make most effective use of local generation. Consumers are permitted to perform a measure of demand response by modulating their demand at certain points while keeping their total energy consumption constant. Allocated energy tokens can be consumed immediately, or during any subsequent daypart to the same type. A series of power flow analyses are performed using the market simulation out-turns to establish the electrical system effects. Consumers are found to move some demand to weekend days when demand is lower but generation is equally abundant. Electrical results reveal a decrease in system losses, as well as less fluctuation from the larger grid supply.


Introduction
An industry-wide move towards decentralised electricity generation has given rise to a heightened interest in Peer-to-Peer (P2P) energy trading [1], [2]. Within this paradigm consumers and producers are allowed to transact freely, without significant regulator involvement [3]. This serves as a progression away from the traditional top-down centralised model, with local generation being encouraged and becoming more commonplace. Furthermore, consumers are no longer in a purely passive role, becoming more pro-active in their consumption trends and electricity market interaction [4]. Blockchain is proposed as the mechanism facilitating this paradigm, with a large base of research arising around the concept [2].
Blockchain is a term referring to a cryptographic decentralised ledger, first proposed by Satoshi Nakamoto in 2008 [5]. Immutable and trustless, transactions are recorded in "blocks" linked by hash chains [6]. Although most closely associated with cryptocurrency, the technology has found itself utilised in multiple industries, including considerable consideration in the electricity industry [7], [8].
The P2P paradigm makes use of energy tokenisation, illustrated in figure 1. A term borrowed from data science [9], tokenisation refers to the process of substituting a unit of electrical energy, e.g. a Megawatt hour, with a cryptographic token. Utilising a dedicated blockchain as a platform [10], these Enertoks [11] can be transferred and traded between participating parties. Tokens are generated by blockchain-enabled smart meters, and are dissolved when the energy is "redeemed". Thus, tokens serve as a "license to consume", rather than being a physical packet of energy being transferred. An advantage of tokenised energy trade is the associated smart mechanisms that can be implemented [11], [12].
A concern arises in P2P tokenised energy that Enertoks may be hoarded during abundant low-demand periods when excess generation is present [11]. This may result in grid imbalance and line congestion during high-demand periods. This paper will examine the effects of locking Enertok to the daypart periods they were generated in i.e. a token generated in a specific daypart can be used immediately or during any corresponding daypart in the future. The mechanism could encourage more effective demand response from consumers.

Methodology
The study aims to simulate a local P2P energy marketplace, where the grid utility serving as liquidity provider. An optimisation is performed so as to most effectively allocate the generated electricity from local sources i.e. minimise the total amount of energy purchased by consumers from the utility, as in equation 1. Local production is assumed to be preferable to consumers, with parties competing for access. Consumers are afforded the freedom to shift their consumption within a certain margin, so as to most effectively avail of generation. This serves as an approximation of demand response activation.
The dayparting mechanism imposed on generation ensures that an Enertok, when allocated to a consumer, can only be used in its respective daypart of generation. For example, a token generated on Tuesday during the breakfast daypart can be consumed during that daypart or during any breakfast daypart in subsequent days. This mechanism attempts to transparently ensure that consumption will line up with the fluctuating generation trends of local renewable energy producers.

Dayparting
Dayparting is a term borrowed from broadcast programming referring to how 24-hour periods are divided with various categories of media allocated to each slot [13]. In the case of this study, dayparting is used as a means of categorising electrical consumption at different relevant times during a 24-hour cycle. The method is used as an extension to the common practice of Time-of-Use. A typical day is notionally divided into four quadrants, as shown in figure 2. The four categories consist of overnight, breakfast, daytime and peaktime. This serves as a condensed version of broadcast dayparting, which typically has more quadrants [13]. The dayparted profile is an expansion on typical Time-of-Use profiles that usually only have three categories (Peak, Off-peak and Standard [14]).

Proposed Simulation of Potential Marketplace Equilibrium
The methodology developed in this piece aims to simulate a local P2P free market for energy. All involved parties are assumed to have dedicated smart meters installed that perform energy tokenisation and communicate with the utilised blockchain. Consumers have large, Megawatt-scale demands. Thus, these can represent very large data centres or production facilities, capable of shifting and rescheduling energy-intensive practices (such as routine maintenance) within a one week time frame. These consumers have access to a grid utility which serves as liquidity provider. Consumers have access to PAYG electricity, with the continuous option to purchase from local sources or the liquidity provider. The simulation does not consider the financial layer, with no auction mechanics or cost minimisation methods included. Rather, the process serves to approximate a potential equilibrium that may arise under certain assumptions of market efficiency.
Consumers are assumed to make the most logical choices towards lowering their electricity demand. It should be noted that this broad-view optimisation may be considered at odds with the decentralised model of P2P energy trading (and blockchain itself). This optimisation thus serves as a steady-state approximation of potential market conditions and should not be viewed as decision-making information for market operators. For the avoidance of doubt: the optimisation framework is not proposed here as any kind of market clearing mechanism, but simply as a simulation and research tool to explore the type of equilibrium that may arise when Enertoks are freely traded in an ad-hoc way.
An optimisation variable, E, is defined. This (I × U) matrix is the energy consumption of each individual consumer during every unique daypart, after demand shifting has been applied. A second (I × J × U) optimisation variable, H, represents the allocation of Enertoks from each producer to each consumer in each daypart. Enertoks are not granular in any way, with infinitely small subdivisions possible. For clarity and simplicity in this specific example, the standard Enertok is assumed to have a 1 MWh value, although a real-world implementation may select a smaller value.
The considered objective function, shown in equation 1, attempts to minimise the consumption of energy outside of the Enertok structure. While a liquidity provider is available to facilitate consumers drawing more power than is covered by their Enertok holdings, it is assumed that this Pay-As-You-Go (PAYG) energy is more expense that the Enertok offering.
Enertoks are allocated in such a way as to decrease the total pay-as-you-go consumption of all consumers, as facilitated by their demand shifting. where: • u is the unique daypart index, • U is total number of unique dayparts considered, • i is the consumer index, • I is total set of consumers considered, • j is the producer index and • J is total set of producers considered.
With the objective function set, the first step of the process sees restrictions placed on the allocation of Enertoks in line with daypart periods. Furthermore, the constraints ensure that Enertoks can only be consumed in the period they are generated in or in subsequent chronological periods i.e. Enertoks cannot be "sent back in time". This is accomplished by equations 2-5. where: • is day of the week index, • T is the total considered days, • u is daypart considered, • G is a parameter matrix of generator outputs.
Indices for general dayparts (w) are as below. The complete set of dayparts for each day of the week make up the total considered period U, as in equation 1.
• o is the overnight index, • b is breakfast index, • d is the daytime index and • p is peak time index.
A scalar parameter s represents the percentage whereby a consumer's demand can be raised or lowered at any point. However, each consumer's total energy consumption across all time points needs to remain unaffected. This is expressed as the constraint in equation 6.
The H values in constraint equation 6 allow the optimisation to consider the allocated Enertoks when shifting the load i.e. load will be shifted to periods when more Enertoks are available.
A necessary consideration is to ensure that total consumption before and after shifting remains constant. This is accomplished by the constraint in equation 7. where: • is the total consumption of consumer i before load shifting has occurred. The second step sees the simulation ensure that allocated Enertoks never exceed the consumption at any point. This is shown in constraint equation 8. Similarly, equation 9 ensures that consumption is never negative.

Time Series Powerflow Analysis
Having established how consumption is affected, an AC powerflow analysis is performed. Each unique daypart is interpolated to produce hourly results, resulting in average power figures. These results are then able to be processed by the powerflow calculation. A unique powerflow is performed per hour for each of the three cases.

Test Platform
The Matlab environment, in combination with Yalmip optimisation package [15] is used to simulate the market conditions in this study. The second step of the process sees the Matpower package [16] used for powerflow analyses. The test power system under consideration is IEEE Case_30 as shown in figure 3, while the test dataset is acquired and modified from [17].   Table 1 shows the total generation and consumption for the test dataset. It can be seen that in some dayparts generation exceeds local demand. It is assumed that the liquidity provider will purchase excess Enertoks for export to the larger grid. A number of test cases are examined. A comparison demand response only case is included which removes the dayparting mechanism from the process in section 2. This comparison method is included to establish if any potential positive outcomes are purely the result of the demand response activation or if the proposed dayparting mechanism is truly advantageous. The three cases are considered and compared, as below: • Before: the test data without any applied mechanisms, • Dayparts and Demand Response: the case where consumers are afforded a measure of demand response and the dayparting mechanism is applied and • Demand Response Only: the "comparison" case with only the demand response component.

Results
This section describes how Enertoks are allocated and demand response is activated in the market simulation. The results of the powerflow analyses are also shown and discussed.

Market Simulation Results
Each of the 24 consumers can shift their demand by up to 20% during any daypart. However, their individual total consumption across the considered period must remain unchanged. Figure 5 shows the change between the consumption of all consumers in the test dataset (the before case) against the market simulation results (the dayparts and demand response case) i.e. the difference between C and E as above. Segment colours correspond to those in figure 2. Fig. 5: Change in energy consumption per daypart between "before" case and dayparting with demand response Examining figure 5 reveals that the dayparting mechanism significantly decreased consumption during weekday daytime and peaktime periods and slightly increased during overnight and breakfast periods. This largely occurs to make more effective use of local generation during these periods. However, over the weekend an overall increase in consumption is observed. The before case's weekend consumption is lower than weekdays, typical in demand profiles. However, the simulation increases demand during all weekend dayparts, again to make more effective use of generation. Figure 6 shows a plot of post-optimization Enertok allocation (H as above). As above, daypart colours correspond to figure 2. Overall, Enertoks are consumed in greater amounts during weekend periods, perhaps pointing to some electrical foresight by consumers. Fig. 6: Total Enertoks allocated to each daypart Figure 7 shows the total consumption from local sources at each daypart. It should be noted that only 75.1% of total generation is allocated to local consumers for this optimal solution.
The remaining generation is thus sold to consumers outside the test network, or to the utility grid itself. In the demand response only case, all available generation is supplied to local consumers. This higher percentage is due to the lack of restriction placed on time period consumption. The difference in local purchase by local generation is evidence of how placing some restrictions on tokens may affect local purchase trends. Examining these results shows that in some instances generation exceeds consumption, even with demand response. Thus, the dayparting mechanism results in sub-optimal results for consumers, with not all needs met by local generation (as in figure 7).

Power Flow Results
The results produced in section 4.1 are applied to the power system, as described in chapter 2.3. A baseline case is also performed with the unaltered test dataset serving as input, as shown in figure 9. Figure 8 shows the hourly losses in the powerflow against time over the 168 hour week. A 9.23% decrease can be observed when dayparted tokens and demand response are implemented. Examining the demand response only case, an 8.50% increase in losses is present, largely owing to the grid imbalance created by allowing consumers to redeem Enertoks during any time period deemed convenient. This phenomenon is visible in figure 8 and figure 9 in the significant increase in weekend consumption. Table 2 shows the total system losses in each of the considered cases.   The slackbus serves to approximate a connection between the test power system and the greater electrical grid. Figure 10 shows the energy flow to/from the slackbus across the considered period against time for the considered week. Additionally, figure  11 shows the demand response only case where only demand response is incorporated. It can be observed that peaktime consumption is far higher than daytime demand, partially owing to the increased production of PV plant generator 5. During overnight and breakfast periods, power is supplied to the slackbus, due to the surplus of generation from local producers in these periods. Fig. 10: Energy transfer to/from greater power grid before and with daypart mechanism and demand response It can be observed that peaktime consumption is far higher than daytime demand, partially owing to the increased production of PV plant generator 5. During overnight and breakfast periods, power is supplied to the slackbus, due to the surplus of generation from local producers in these periods. Fig. 11: Energy transfer to/from greater power grid with only demand response A significant decrease in draw from the slackbus can be observed in all periods until the start of the weekend. This is due to more effective utilisation of local generation as described above. During the Saturday and Sunday periods the increased consumption vs the before case result in a greater net draw of energy. Despite this, variance is decreased by 23.4% between the before and dayparts and demand response cases. Examining the demand response only case in 11 shows an increase in slackbus fluctuation, especially towards the end of the examined week, as evidenced by a 16.1% increase in variance from the before case.

Conclusion
The dayparting mechanism proposed in this paper is intended to discourage Enertok hoarding and encourage purchase from local generators. Furthermore, the mechanism is intended to stimulate favourable demand response and decrease system losses to some degree. Results of the market simulation and powerflow analyses support these hypotheses, with a decrease in powersystem losses and more beneficial consumption trends as a whole. Comparing these results to P2P simulations without the dayparting mechanism shows that fully unrestricted Enertok trade and consumption serves only to increase the prevalence of negative grid conditions. Future studies may combine the mechanisms with a true financial market simulation i.e. some form of auction mechanism that sees consumers compete more realistically for the cheap local generation. This can be combined with Time-of-Use tariff pricing from the grid liquidity provider, which could effectively make Enertoks from separate dayparts more or less valuable.

Acknowledgments
This publication has been funded by the Sustainable Energy Authority of Ireland under the SEAI Research, Development & Demonstration Funding Programme 2018, grant number 18/RDD/373.
Interests disclosure: the authors hold cryptographic assets.