Next Article in Journal
Scientific Attention to Sustainability and SDGs: Meta-Analysis of Academic Papers
Next Article in Special Issue
Wavelet Energy Fuzzy Neural Network-Based Fault Protection System for Microgrid
Previous Article in Journal
Numerical Study of Heated Tube Arrays in the Laminar Free Convection Heat Transfer
Previous Article in Special Issue
A Data-Driven Method with Feature Enhancement and Adaptive Optimization for Lithium-Ion Battery Remaining Useful Life Prediction
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Market Design and Trading Strategies for Community Energy Markets with Storage and Renewable Supply

by
Abdullah M. Alabdullatif
1,*,
Enrico H. Gerding
2 and
Alvaro Perez-Diaz
2
1
Saudi Aramco, Dhahran 31311, Saudi Arabia
2
Department of Electronics and Computer Science, University of Southampton, Southampton SO17 1BJ, UK
*
Author to whom correspondence should be addressed.
Energies 2020, 13(4), 972; https://doi.org/10.3390/en13040972
Submission received: 30 December 2019 / Revised: 11 February 2020 / Accepted: 14 February 2020 / Published: 21 February 2020
(This article belongs to the Special Issue Artificial Intelligence Applications to Energy Systems)

Abstract

:
Community Energy Markets (CEMs) enable trading opportunities between participants in a community to achieve savings and profits. However, the market design and the behaviour of participants are key factors that determine the success of such markets. To this end, this research presents a CEM model and conducts agent-based simulations to study the benefits of the CEM to consumers and prosumers. The proposed market structure is an hour-ahead periodic double auction. In particular, market rules are proposed that incentivise the provision of energy supply to the community and the investment in energy storage. Furthermore, a trading strategy is introduced that leverages energy flexibility created by the storage devices. Finally, as well as the hour-ahead market, we include a minute-by-minute balancing as part of the CEM’s energy exchange mechanism. The balancing approach is introduced to account for a community budget deficit caused by the time difference between supply and demand. The proposed market results in cost savings for consumers and profit for prosumers similar to existing approaches, while increasing the energy suppliers’ percentage of financial benefits from 50% to a range between 60–96% depending on the community configuration. Moreover, the market model accounts for uncertainties in supply and demand and suggests a methodology to overcome the community budget deficit.

Graphical Abstract

1. Introduction

The smart grid is a promising technology to transform the traditional energy industry. Nowadays, the growth of Distributed Energy Resources (DERs) such as Renewable Energy Sources (RESs), energy storage and electric vehicles (EV) is significantly impacting energy networks [1]. Furthermore, consumers in the residential sector are increasingly aware of the environmental and economic benefits of using DERs such as solar photovoltaic (PV) or wind-based energy sources. Such on-premise RES combined with storage make their energy demands more flexible. In addition, it enables consumers to also become producers, the so-called prosumers (producers and consumers), and look for energy trading opportunities. To this end, some incentives have been put in place to encourage the use of RES at the residential levels, such as the Feed-in-Tariff (FIT) schemes where prosumers sell their surplus energy to the grid [1]. However, the FIT schemes are not always appropriately designed and can be inefficient, and thus often do not provide sufficient incentive for DER investment [2]. Therefore, there is a need to design energy markets where consumers and prosumers can trade with each other. Now, Community Energy Markets (CEMs) are a way to facilitate trading between participants in a community and create better financial situations compared to dealing with the grid. However, the market mechanism and the behaviour of participants are key factors that determine their success. Researching those factors contributes to the creation of beneficial markets that could be adopted in the future to help reduce global CO 2 emissions and promote the use of sustainable energy sources. To this end, the aim of this paper is to propose a novel market mechanism for community energy markets, and through simulations show the benefits of such a market for the various participants.
There has been extensive work on designing and evaluating energy markets in recent years [3,4,5,6,7,8], ranging from economically to environmentally focused (see also Section 2). Most research in this area usually focuses on the overall economic benefits, such as cost reductions and profits to the community as a whole, and neglects how those benefits are distributed. Some research considers the equal distribution of benefits as one reasonable objective for CEM designs [9,10]. However, bearing in mind the investments that prosumers made to supply energy, other consumers in the market who are not adding any value are exploiting this equality. Moreover, the uncertainty in energy supply and demand poses a limitation to CEMs and needs to be thoroughly evaluated [11]. Therefore, in this study, we seek to design a CEM that promotes renewable energy supply through financial motivations and storage consideration, and that incorporates uncertainty in supply and demand. Moreover, we seek to evaluate the proposed model using agent-based simulations. In more detail, our contributions are as follows. First, we design a market model which provides financial incentives for energy suppliers and suppliers with storage capabilities. Second, we introduce a mechanism to address uncertainties in supply and demand. Third, we perform simulations using real market and household data in order to investigate and validate the proposed model.
The rest of this paper is structured as follows. Section 2 summarises related work in the area of CEMs and highlights the motivational research gaps for this work. Section 3 presents the proposed market model. Section 4 discusses the considered market agents and their trading strategy. Section 5 explains the market simulations performed, and Section 6 discusses the obtained results. Lastly, Section 7 summarises the paper and suggests areas for future work.

2. Related Work

The issue of market design for CEMs and microgrids has been widely explored in the literature. These studies can be broadly categorised into two groups depending on the market structure considered: peer-to-peer (P2P) approaches, where energy is traded bilaterally between pairs of participants, and centralised auctions. More specifically, the first group includes the works in [10,12,13,14,15,16,17,18], and the second group includes works in [3,5,7,9,16,19,20].
In more detail, focusing on the former category, in [12] a local energy exchange system is presented, considering both the physical and the trading infrastructures, and simulating user behaviour using game theory. Focusing on the trading aspect, the authors of [13] consider different existing P2P energy sharing mechanisms with a focus on both economic and technical indices and realistic scenarios from the UK. Moreover, a very similar setting is also studied by the authors of [10], with a focus on PV generation integration. In a slightly different vein, the authors of [14] propose a regret-matching P2P procedure, which also includes transmission costs and a game theoretic analysis of the participants. Focusing now on the integration of RES, the authors of [15] employ a random-matching P2P procedure to link households with surplus RES generation with others with excess demand; their results showing that RES utilisation is greatly improved by the proposed P2P market. Moreover, this work is subsequently extended in [16], where the authors focus on the effect of different participant strategies, including zero-intelligence and learning agents. The authors of [21] take a different perspective and focus on the storage aspect of local P2P trading, considering both decentralised household-owned batteries, and centralised community storage. Finally, the authors of [17,22] review the state-of-the-art in real-world P2P trials and discuss their relative merits. All these works present consistent results: CEMs and local P2P trading present significant improvements, including monetary savings and profits, RES utilisation and congestion mitigation.
Regarding the second category, we can find two different types of auctions in the literature: continuous [19,20] and discrete [3,5,7,9,18]. In more detail, continuous auctions match buy and sell orders instantly and keep an order book continuously open (like stock markets). In contrast, discrete auctions are open for a certain interval of time, and clear the market periodically considering all the received orders. Specifically, the authors of [19] propose using a continuous double auction for energy trading, together with a real-time balancing market to mitigate energy imbalances. Moreover, line congestion is dynamically taken into account in the pricing of the traded energy. Furthermore, trading agents are also considered, including zero-intelligence and adaptive-aggressiveness strategies. In a slightly different vein, the authors of [20] also consider a continuous double auction in a similar setting but focus on agent behaviour, presenting a prediction-integration strategy that the market participants can use in order to perform more informed trading. In a different vein, the authors of [4,18] focus on the possibilities offered by blockchain technology as a framework for implementing CEM auctions, such as increased transparency and trust-less execution.
These existing P2P- and auction-based approaches demonstrate the benefits offered by CEMs, such as reductions in energy costs and grid congestion, and better grid stability by increased accommodation of RES. However, these works do not account for the uncertainty of future supply and demand. More specifically, the realised demand or supply will differ from the amounts of energy bid in a given market, given that no forecast is perfect. In this work we address this issue by considering both an hour-ahead market and a minute-by-minute balancing market where forecast deviations can be addressed. Moreover, although often the aim is to optimise the social welfare of all agents, little attention has been devoted to who the main beneficiaries are at the individual level, e.g., whether it is prosumers with storage supply and renewable energy or regular consumers as well. To this end, we consider the effects of the proposed CEM for different types of households and, in so doing, study the use of monetary incentives for investment in RES.
In addition to the works studying the design of CEMs reviewed above, the role of energy storage in such markets has also received considerable interest in recent years [16,21,23,24,25,26,27,28,29]. In more detail, the authors of [23] study the creation of charging and discharging schedules for storage systems, with a focus on profit maximisation for communities purchasing energy from the grid, and their results show the economic benefits associated with the addition of storage. Similarly, the authors of [16,21] study the effects of adding storage to a P2P CEM design, and their results emphasise the higher market efficiency achieved with the introduction of storage. In a slightly different vein, others study the effects of adding storage to households with RES [24,25]. In these studies, storage and RES are shown to be tightly coupled and to provide significant cost reductions together, in comparison to only either of them being present in the household. Similar scenarios, but from a business perspective, are analysed in [26,27]. In these works, both the accommodation of solar generation and the load-shifting necessary to avoid congestion and demand peaks are considered. Moreover, different battery technologies are considered, and several techno-economical indicators studied, showing that storage is able to significantly reduce the dependence on the grid. The authors of [28] consider a different perspective, focusing on the issue of planning the location and capacity of local storage systems in a micro-grid with photovoltaic generation. In more detail, the authors perform a cost–benefit analysis of such storage systems and propose a planning strategy that maximises the total net present value of the storage system for the micro-grid. Finally, the authors of [29] look at the possibilities offered by storage from a policy perspective. With the aim of improving the efficiency and operation of both large-scale grids and micro-grids, the authors propose defining storage as a new and important class of grid participants, and consider it essential for the the smart-grid paradigm. Overall, storage is seen as a key element in the transition to the smart-grid paradigm and is shown to provide ample benefits to prosumers participating in both CEMs and traditional electricity markets. However, many of these works ignore the business aspect of investment in storage. To address this issue, we study the provision of monetary incentives to households for investing in storage solutions.
Finally, another relevant area of the literature is the investigation of trading strategies for household participation in CEMs. Different types of algorithms have been proposed in previous literature, including zero-intelligence (ZI) [3,16,30], zero-intelligence plus [19] and forecasting-based agents [16,20]. Among these, the former are only valid as a proof-of-concept due to their simplicity. The second type include some degree of sophistication, usually by keeping track of margin prices that get updated with some simple rule in every sequential auction. Although these techniques have been shown to significantly outperform ZI agents, they are quite simple and do not exploit most of the information available to the agent. Finally, the third group is quite generic and may contain many different types of algorithms, characterised by exploiting the data available to the agent and using forecasts to optimise their behaviour. Examples of these include the extreme machine learning models presented in [20], the reinforcement learning approach in [31], the constraint satisfaction problem in [32] or the support vector machine forecaster in [30]. In a similar vein to these works, we propose a trading algorithm which exploits the flexibility provided by the available storage and a forecast about future supply and demand to optimise the household participation strategy.

3. Market Design

In this research, a residential community is considered where the physical exchange of energy is assumed possible via a microgrid network and smart grid technologies. The households are participants in the CEM. The community is assumed to be always connected to the grid. The grid is assumed to have a continuous supply of energy without interruptions and no limits on the feed-in energy from households with excess renewable supply. A household can only import or export energy at any moment and cannot do both at the same time. This constraint is referred to as the one-way flow of energy assumption. This section is structured as follows. First, a brief explanation of the two-sided auction is presented in Section 3.1, followed by definitions of the market players in Section 3.2 and the trading rules in Section 3.3. Section 3.4 explains the optimisation problem to solve for pricing and clearing. Section 3.5 presents the adopted method for allocation. Section 3.6 describes the minute-by-minute balancing approach to fulfil energy and the proposed secondary market. Finally, the accounting method to calculate the bills is presented in Section 3.7.

3.1. Two-Sided Auction

Auctions are a common trading mechanisms whereby traders submit offers for buying or selling goods. A bid is an offer to buy a good, whereas an ask is an offer to sell a good. Two-sided auctions allow both bids or asks and aims to match these resulting in an exchange. The time interval when orders can be submitted is referred to as the trading period. A discrete-time auction permits the exchange of goods only at the end of the trading period. A famous example of a discrete-time two-sided market is the clearinghouse where the offers are cleared at the end of each trading period [33]. The CEM presented in this work is modelled as a repeated clearinghouse auction with uniform pricing, which means that there is a single price for all the accepted transactions in that period.

3.2. Players

The primary players are consumers (i.e., buyers), suppliers/producers (i.e., sellers) and prosumers (who can be both buyers and sellers). These players are represented by so-called software agents, which are able to autonomously trade energy on their behalf. The fourth market player is the grid. Last, a market facilitator is introduced to perform support tasks. The remainder of this section will detail these market players.
In more detail, buyers (i.e., consumers and prosumers) can submit bids to the market to purchase energy. A bid contains a quantity in kWh and the maximum price accepted to pay for each kWh in pence. Similarly, sellers submit asks containing a quantity in kWh and the minimum price accepted to sell each kWh in pence. More importantly, buyers and sellers can submit multiple such orders. For example, a seller may be willing to sell its first 10 kWh for 20 pence, and its next 10 kWh for 50 pence. This can be achieved by simultaneously submitting two asks.
Prosumers and suppliers can produce energy through either renewables or a storage device. In practice, storage is typically sold in combination with renewable energy installations. Therefore, we assume that households with storage will also have some renewable, although we will also have households with just renewable (or no supply at all). Prosumers with energy storage devices are referred to as flexible agents.
The grid is an essential player in the market and represents a (private) energy supplier. It resolves any imbalance by providing or accepting energy that could not be fulfilled within the community market. The grid is assumed to have two fixed prices: a bid and an ask. These are varied in our experiments. The bid price is denoted by G b per kWh and represents the residential energy price when energy needs to be purchased without the CEM. The second price is effectively a feed-in-tariff, and is denoted by G s . We assume these are available at sufficient capacity to address any imbalance.
The market facilitator receives the bids and asks from the agents, determine the exchange price, allocates energy fairly and calculates the agents’ bill. These issues are discussed in more detail in the subsections that follow.

3.3. Auction Rules

In this work, we consider an hour-ahead market. The trading period for exchange in the next hour opens at minute 45 of the current hour and closes at minute 55. Agents submit their bids and asks during this 10-minute interval. A trading period is referred to as a market round. The hour which agents are trading for and energy is physically exchanged in is referred to as the energy exchange period. An agent can submit multiple offers with different prices, but once an offer is submitted, it cannot be recalled. Two minutes before the energy exchange period starts, the facilitator announces the market round (auction) results, which specify the price, the winning agents and their energy allocations. At the end of each energy exchange period, the demand and supply amounts are used to calculate the agents’ bill. The proposed market timeline is depicted in Figure 1.

3.4. Clearing

At the end of each trading period, the clearing price and trading quantity or volume are calculated based on market equilibrium matching using uniform pricing [34]. The market objective is to maximise the equilibrium trading volume. There are typically two different types of goals when it comes to auctions: maximising social welfare or maximising trading volume. Maximising volume would be better for a community energy market because, in our proposed market, the private values of the buyers and sellers which are required to compute social welfare are unknown. In addition, using a uniform pricing approach, as in our model, we aim to trade as much energy as possible to reduce energy exchanged with the grid. Therefore, given the set of bids N T B for market a round T, where b i and d i i N T B are the bid price and demand quantity respectively, (1) calculates the demand quantity for a price p. Moreover, given the set of asks N T A , where o i and s i i N T A are the ask price and supply quantity, respectively, (2) calculates the supply quantity. Therefore, for a price, p, (3) calculates the market trading volume Q ( p ) .
D ( p ) = i = 0 N T B d i , if b i p 0 , otherwise
S ( p ) = i = 0 N T A s i , if o i p 0 , otherwise
Q ( p ) = min D ( p ) , S ( p )
The facilitator is responsible for finding the auction clearing price P that maximises Q. If there are two or more prices that achieve the same trading volume, this referred to as a buy–sell gap. In this case, the clearing price P is then chosen in the middle between the minimum ask and maximum bid so as to not favour suppliers in all situations, and to provide some benefits to consumers. Therefore, P is the average of the set P returned by (4) as represented by (5).
P = argmax p Q ( p )
P = P ¯
Algorithm 1 shows the steps to compute the clearing price and the trading volume given N T B and N T A . Moreover, Figure 2 shows an example clearing price alongside the corresponding supply and demand curves. The shaded area refers to social welfare, which is the total utility of the buyers minus the total cost of the sellers [35]. Although social welfare as defined in (6) assumes the knowledge of the true demand and supply curves using the private sellers’ cost (c) and buyers’ marginal benefit (m), in our setting, the submitted bids and asks are used to represent the supply and demand curves.
S o c i a l W e l f a r e = i = 0 N T B ( m i b i ) d i i = 0 N T A ( o i c i ) s i
Algorithm 1 Compute Clearing Price and Volume.
Input bids list N T B , asks list N T A
Output clearing price P and trading volume V
procedure ComputeClearingPriceandVolume ( N T B , N T A )
Require: N T B   &   N T A
   P 0
   V 0
   b i d s Q [ ] ▹ Initialise empty list
   a s k s Q [ ] ▹ Initialise empty list
  for p in [ N T B . b ] do▹ Loop over the unique set of bid prices
    q Q ( p ) ▹ Compute the volume for price p using (3)
    b i d s Q b i d s Q | | ( p , q ) ▹ Append price p and volume q to the bids list
  for p in [ N T A . o ] do▹ Loop over the unique set of asks prices
    q Q ( p )
    a s k s Q a s k s Q | | ( p , q ) ▹ Append price p and volume q to the asks list
   m a x Q b i d max ( b i d s Q . q ) ▹ Get the bid with max volume
   m a x Q a s k max ( a s k s Q . q ) ▹ Get the ask with max volume
  if m a x Q b i d . q > m a x Q a s k . q then
    V m a x Q b i d . q
    P m a x Q b i d . p
  else if m a x Q b i d . q < m a x Q a s k . q then
    V m a x Q a s k . q
    P m a x Q a s k . p
  else
    V m a x Q b i d . q
    P ( m a x Q b i d . p + m a x Q a s k . p ) / 2
  if V = 0 then
   return Null▹ Return null if no trade can be done
  return P , V ▹ Return the clearing price and the trading volume

3.5. Allocation

After the clearing price and the trading volume are computed, the facilitator needs to distribute the cleared energy among the winning agents. Sometimes demand from the winning buyers is more than supply or vice versa. Therefore, an allocation mechanism is needed to distribute the cleared energy. The adopted allocation approach is an envy-free division protocol [36]. To explain our motivation, let us consider this more detailed description of the problem. First, once a clearing price is determined, the clearing mechanism needs to determine a precise energy allocation, i.e., who supplies energy and whose demand is met. Buyers whose buy price is highest are matched with sellers whose price is lowest. However, at the border where demand meets supply, there could be multiple agents who have the same price. The problem is then choosing who should contribute and how many resources should they contribute. The algorithm is based on a proportional selection but takes into account the individual agent’s constraints. For example, suppose that, at a price p = 5 , there is demand of 9 units, and a supply of 2, 5 and 10 units by agents 1, 2 and 3, respectively. Therefore, there is a demand of 9, but a supply of 17. The question is: how to select who supplies energy and how many units. If we divide these proportionally, then each agent would contribute 3. However, agent 1 can supply a maximum of 2 units at that price. Therefore, we have a preliminary allocation of 2, 3, 3, which equals 8 units. Therefore, there is 1 unit left that needs to be allocated in a second round. Again we divide this proportionally between the remaining agents (2 and 3), and they contribute 0.5 each. This is within their maximum supply, so the algorithm stops, and the final allocation is 2, 3.5, 3.5. This seems a natural way of dividing the resources. We call this allocation envy-free as no agent is envious of the allocation of the other agents. In more detail, for a set of players R and an energy quantity E to be divided, this protocol guarantees at least 1 R for each player. This way, no player is envious or desires the share of another player. If a player desires less than the minimum share, he/she is allocated what he/she desires, and the leftover energy is redistributed on the remaining players who desire more. In situations where the winning demand is more than the winning supply, the set of players R becomes the winning buyers, and E becomes the wining supply. Otherwise, R becomes the set of winning suppliers, and E is the winning demand. The procedure for the division protocol is shown in Algorithm 2. Agents who did not win in the auction are implemented as if they have a desire of zero. For each round T, the demand allocation for an agent a is denoted as L D T a , and the supply allocation is denoted as L S T a .
Algorithm 2 Envy Free Division.
Input energy amount E and list of agents with their desire R
Output a dictionary of agents with their shares resulting from the division
procedure Divide ( E , R )
Require: E > 0   &   R
  if E = 0 then return 0 for all agents▹ No energy to divide
   r e s u l t s { } ▹ Initialise empty dictionary for the results
   R s o r t ( R . d e s i r e ) ▹ Sort winning agents’ desire in ascending order
   Rlength length of R
  for a in R do
    s h a r e min ( E R l e n g t h , a . d e s i r e )
    r e s u l t s [ a ] s h a r e
    E E s h a r e
    a g e n t s l e n a g e n t s l e n 1
  return r e s u l t s ▹ Return agents with their shares

3.6. Balancing

Agents are assumed to demand or supply more or less than what they were allocated in the market. The excess supply, for instance, can be caused by a surge in solar energy on a sunny day. Similarly, the excess demand can be caused by increased human activities. This behaviour is referred to as uncertainty in future supply and demand. Storage, on the other hand, can help reduce this uncertainty and preserve energy to be used when needed. Naturally, the difference between the allocated and exact energy amounts should be reflected in the agents’ final bills, which will be explained in Section 3.7. However, first, an energy balancing method needs to be implemented to fulfil the community’s energy needs. The proposed balancing mechanism is a minute-by-minute approach. Before we discuss how energy balancing is achieved, we need to consider the time differences between agents’ allocated supply and demand, as it is not reasonable to assume that energy exchange in the hourly round will overlap perfectly. This issue is depicted in Figure 3. This condition creates an energy quantity that has to be fulfilled by the grid, and for which no agent is responsible, as agents are only accountable for their net energy at the end of each hour. This results in what is referred to as a deficit in the community net bill.
We define three sources of energy used to satisfy the agents’ energy needs, which are inflexible energy, flexible energy and the grid. Inflexible energy is the energy that needs to be fulfilled no matter what, such as an appliance’s demand or excess solar energy with no storage which has to be exported. The energy that is or could be charged or discharged from storage devices is referred to as flexible energy. This energy is sometimes used to fulfil inflexible energy in order to avoid dealing with the grid and to maintain the benefits within the community. The grid’s energy is always considered as the last resort if any needs cannot be satisfied by the other two types of energy. Therefore, to fully utilise the energy within the community, the concept of demand and supply ability at a given minute is introduced, representing the amounts agents can demand or supply in a given minute. For agents without storage, the demand and supply abilities are the same as their exact needs in a given minute. However, for agents with storage, their abilities change every minute depending on their needs and their storage state. The formulas used to compute the demand and supply abilities will be explained in Section 4.2. The proposed balancing method uses the demand and supply abilities to facilitate the energy exchange of the allocated market amounts and resolve any imbalance. Energy can be exchanged between agents outside the allocated market amounts within what is referred to as the secondary market, which is explained next in Section 3.6. The algorithm for the balancing methodology is shown in Algorithm 3. This algorithm treats agents with no storage devices as if they have storage devices with zero capacity. This approach makes the implementation functional for agents with and without storage. The algorithm uses some functions that will be presented in Section 4.

Secondary Market

The uncertainty in supply and demand creates secondary exchange opportunities between agents. However, to avoid strategic behaviour, inflexible energy is exchanged at grid prices. Therefore, instead of one supplier exporting his energy at G s and the consumer importing it at G b , they exchange the energy at those prices, and the community gets the profit instead of the grid. This profit is referred to as a surplus in the community net bill, which is used to compensate for the deficit resulting from the imperfect overlap between supply and demand discussed in Section 3.6. If the energy exchanged is flexible, the situation is different. The secondary market provides an opportunity for agents with storage to capitalise on the inflexibility of other agents. Flexible supply can be used or sold later, whereas the flexible demand is extra energy that can be stored. Therefore, agents with storage involved in the secondary exchanged, act as the grid. They get the benefits of fulfilling inflexible energy. Therefore, when an inflexible consumer needs energy, he pays G b , the flexible agent providing this energy receives G b instead of G s because he supplied this energy as the grid would. The flexible agent does not lose anything because if this energy is needed later, it can always be imported from the grid at G b or from the market at a lower price.
Algorithm 3 Balance Market.
Input agents list A , allocated demand dictionary for current round L D T , allocated supply dictionary for the current round L S T , minute t, current round cleared price P T and the community energy accounts a c c o u n t s
Output updated community a c c o u n t s
procedure BalanceMarket ( a g e n t s , L D T , L S T , t , P , a c c o u n t s )
Require: A   &   L D T   &   L S T
   c o n s u m e r s A b i l i t y { } ▹ Initialise empty dictionary for consumers
   s u p p l i e r s A b i l i t y { } ▹ Initialise empty dictionary for suppliers
   D 0
   S 0
  for a in A do▹ Do agents who have remaining allocation
    c o n s u m e r s A b i l i t y [ a ] min ( MAXDEMAND ( a , t , t , 0 ) , L D T a )
    s u p p l i e r s A b i l i t y [ a ] max ( MAXDSUPPLY ( a , t , t , 0 ) , L S T a )
    D D + c o n s u m e r s A b i l i t y [ a ]
    S S + s u p p l i e r s A b i l i t y [ a ]
  if D + S 0 then▹ No enough supply to cover demand or equal
    s u p p l y S h a r e s s u p p l i e r s A b i l i t y ▹ Suppliers sell all their supply
    d e m a n d S h a r e s DIVIDE(S, c o n s u m e r s A b i l i t y )▹ Divide supply
  else
    d e m a n d S h a r e s c o n s u m e r s A b i l i t y ▹ Consumers buy all their demand
    s u p p l y S h a r e s DIVIDE(D, s u p p l i e r s A b i l i t y )▹ Divide demand
Secondary Market
   e x c e s s D e m a n d { } ▹ Initialise empty dictionary for excess demand
   e x c e s s S u p p l y { } ▹ Initialise empty dictionary for excess supply
   f l e x i b l e D e m a n d { } ▹ Initialise empty dictionary for flexible demand
   f l e x i b l e S u p p l y { } ▹ Initialise empty dictionary for flexible supply
   C A 0
   S A 0
  for a in A do▹ Now compute remaining for all agents for secondary market
    f l e x i b l e D e m a n d [ a ] FLEXIBLEDEMAND ( a , t , t , 0 )
    f l e x i b l e S u p p l y [ a ] FLEXIBLESUPPLY ( a , t , t , 0 )
    e x c e s s D e m a n d [ a ] min ( 0 , NET ( a , t , t , 0 ) d e m a n d S h a r e s [ a ] + f l e x i b l e S u p p l y [ a ] )
    e x c e s s S u p p l y [ a ] max ( 0 , NET ( a , t , t , 0 ) s u p p l y S h a r e s [ a ] + f l e x i b l e D e m a n d [ a ] )
    D D + e x c e s s D e m a n d [ a ]
    S S + e x c e s s S u p p l y [ a ]
   if s u p p l y S h a r e s [ a ] = 0 then▹ Make sure of one way flow of energy
     c o n s u m e r s A b i l i t y [ a ] c o n s u m e r s A b i l i t y [ a ] d e m a n d S h a r e s [ a ]
     C A C A + c o n s u m e r s A b i l i t y [ a ]
   else
     c o n s u m e r s A b i l i t y [ a ] 0
   if d e m a n d S h a r e s [ a ] = 0 then▹ Make sure of one way flow of energy
     s u p p l i e r s A b i l i t y [ a ] s u p p l i e r s A b i l i t y [ a ] s u p p l y S h a r e s [ a ]
     S A S A + s u p p l i e r s A b i l i t y [ a ]
   else
     s u p p l i e r s A b i l i t y [ a ] 0
  if D + S 0 then▹ Excess demand more than excess supply or equal
   if D S A then▹ Excess demand more than supply ability or equal
     s u p p l y S h a r e s 2 n d s u p p l i e r s A b i l i t y ▹ Suppliers sell all their ability
     d e m a n d S h a r e s 2 n d DIVIDE( S A , c o n s u m e r s A b i l i t y )▹ Divide supply ability
   else▹ Supply ability is more that excess demand
     d e m a n d S h a r e s 2 n d e x c e s s D e m a n d ▹ Consumers buy all their excess demand
     s u p p l y S h a r e s 2 n d DIVIDE(D, s u p p l i e r s A b i l i t y )▹ Divide excess demand
  else▹ Excess supply is more than excess demand
   if D A = 0 then
   else if S C A then▹ Excess supply more than demand ability or equal
     d e m a n d S h a r e s 2 n d c o n s u m e r s A b i l i t y ▹ Consumers buy all their ability
     s u p p l y S h a r e s 2 n d DIVIDE( C A , s u p p l i e r s A b i l i t y )▹ Divide all demand ability
   else▹ Demand ability is more that excess supply
     s u p p l y S h a r e s 2 n d e x c e s s S u p p l y ▹ Suppliers sell all their excess supply
     d e m a n d S h a r e s 2 n d DIVIDE(S, c o n s u m e r s A b i l i t y )▹ Divide excess supply
Grid State
   g r i d I m p o r t { } ▹ Initialise empty dictionary for grid import
   g r i d E x p o r t { } ▹ Initialise empty dictionary for grid export
  for a in A do▹ Now compute what is needed from the grid
    g r i d I m p o r t [ a ] max 0 , e x c e s s D e m a n d [ a ] d e m a n d S h a r e s 2 n d [ a ]
    g r i d E x p o r t [ a ] min 0 , e x c e s s S u p p l y [ a ] s u p p l y S h a r e s 2 n d [ a ]
   Update round allocated amounts
    L D T a max ( 0 , L D T a d e m a n d S h a r e s [ a ] d e m a n d S h a r e s 2 n d [ a ] g r i d I m p o r t [ a ] )
    L S T a max ( 0 , L S T a s u p p l y S h a r e s [ a ] s u p p l y S h a r e s 2 n d [ a ] g r i d E x p o r t [ a ] )
Update State
  Exchange energy and update agents storage devices
  Update a c c o u n t s with s u p p l y S h a r e s , d e m a n d S h a r e s
   s u p p l y S h a r e s 2 n d , d e m a n d S h a r e s 2 n d , g r i d I m p o r t , g r i d E x p o r t
   f l e x i b l e D e m a n d , f l e x i b l e S u p p l y , L D T , L S T

3.7. Accounting

Similarly, when an inflexible supplier exports energy, he/she receives G s , the flexible agent pays G s instead of G b because he/she received this energy as the grid would. Also, the flexible agent does not lose anything because this energy can always be exported at G s , used for self-consumption or sold to the market for profit. Note that when flexible energy is used in the secondary market, it always fulfils inflexible energy. Naturally, the benefits of the secondary market apply only to the flexible energy amount provided. For example, an agent might provide 1 kWh from his storage as flexible energy, and 2 kWh that could not be stored as inflexible, so he/she only gets the benefits of the flexible quantity. Because of the positive advantage crated by the secondary market, all flexible agents are assumed to participate. The energy exchanged within the secondary market creates a division problem to distribute inflexible energy that needs to be fulfilled, which is solved using the envy-free division presented in Section 3.5. A notable limitation to consider is the direction of energy. If a flexible agent is supplying energy to fulfil his allocated market amounts, he/she cannot also demand energy from the secondary market at the same minute. The flow of energy has to be one-way. Therefore, if a flexible agent is supplying to fulfil his allocated supply, he can only supply more energy to the secondary market in the same minute. The same applies to the demand case. Section 3.7 will explain how the energy from the primary and secondary markets are reflected in the agents’ bills.
The accounting function refers to the bill calculation method, which determines the cost of energy to consumers and the income from sold energy for suppliers. This accounting should be simple in order to clearly communicate to the market players how their bills are calculated. The results from the energy balancing are used in the accounting function with additional conditions. In the balancing function, energy might be fulfilled by the grid because of the imperfect overlap between agents supply and demand for which no agent is responsible. Yet, it is accounted in the community’s net bill. Thus, to calculate the agents’ bills, the total energy for each agent at end of each round is calculated. For a round T and an agent a, the sum of demand energy imported within the market allocation is denoted as D M T a , and the demand imported within the secondary market as D 2 T a , the demand imported from the grid as G I T a , his flexible demand as D X T a and his allocated demand L D T a . We denote the supply exported within the market allocation as S M T a , the supply exported within the secondary market as S 2 T a , the supply exported to the grid as G E T a , his flexible supply as S X T a and his allocated supply as L S T a . Last, Equations (7) and (8) calculate the total imported demand denoted as D T a and the total exported supply denoted as S T a .
D T a = D M T a + D 2 T a + G I T a
S T a = S M T a + S 2 T a + G E T a
The market facilitator maintains energy amounts from the balancing algorithm and is responsible for calculating all the bills at the end of each hour. A positive bill represents a cost, and a negative bill represents an income. The bill calculation for inflexible energy is straightforward. If an agent consumes or supplies what he was allocated in the round, he pays or receives the cleared market price P T for that energy amount. For each kWh of excess demand, he pays G b , and for each kWh of excess supply, he receives G s . When an agent consumes or supplies less than his allocation, he is penalised. The penalty is needed because the difference is still provided by other agents who trade all their allocated amounts using the cleared price. Besides, this charge is necessary to enforce the market allocations and prevent agents from exaggerating their offer with no consequences. The demand shortage fee is denoted as D F T and the supply shortage fee as S F T , which are defined in (9) and (10).
D F T = P T G s
S F T = G b P T
When excess inflexible demand and supply are exchanged within the secondary market, a surplus is created in the community net bill, as explained in Section 3.6. However, this unclaimed profit is needed to compensate for the deficit created from the imperfect overlap of supply and demand. Also, trading excess energy at grid prices prevents inflexible agents from misreporting in the auction to strategise over the secondary market.
Flexible energy bills are calculated slightly differently because of the secondary market. Similar to inflexible energy, for each kWh consumed or supplied within the allocated amounts, flexible agents pay or receive the cleared market price P T . If they provide any excess flexible supply or demand within the secondary market, they act as the grid. Therefore, for each kWh of excess flexible demand, they pay G s , and for each kWh of excess flexible supply, they get G b . If a flexible agent consumes less or supplies less than his allocation, he also pays the shortage fees. Thus, for an agent a and a round T, (11) and (12) compute the net demand cost denoted as C T a , and the net supply income I T a respectively. The agent net bill, denoted as B T a is defined by (13), and the grid net bill, denoted as B T G is defined by (14). Finally, a bill is defined for the community budget balance, which is the amount needed to balance all agents net bills and the grid to zero. The community budget balance is referred to as the community net bill, denoted as B T C and is represented by (15). The accounting algorithm to compute the hourly bills is shown in Algorithm 4.
C T a = min ( D T a , L D T a ) P T + max ( 0 , D T a L D T a ) G b + max ( 0 , L D T a D T a ) D F T min ( D X T a , D 2 T a ) ( G b G s )
I T a = max ( S T a , L S T a ) P T + min ( 0 , S T a L S T a ) G s min ( 0 , L S T a S T a ) S F T + max ( S X T a , S 2 T a ) ( G b G s )
B T a = C T a + I T a
B T G = a A G E T a · G s + a A G I T a · G b
B T C = a A B T a + B G a
The accounting algorithm maintains the hourly bills for all agents in the facilitator’s accounts database. The next section will present the agents’ energy prediction and their bidding strategy.
Algorithm 4 Compute Hourly Bills.
Input agents list A , accounts book a c c o u n t s and round T,
Output updated a c c o u n t s
procedure ComputeHourlyBills( A , a c c o u n t s , T )
Require: A
   b i l l s { } ▹ Initialise empty dictionary for the bills
   P T clear price for round T
  start of the round T t s , end of the hour t f
  for a in A do▹ Loop over all agents list
Demand Cost
    D T a a c c o u n t s . d e m a n d ( a , t s , t f )
    D x T a a c c o u n t s . f l e x i b l e D e m a n d ( a , t s )
    D 2 T a a c c o u n t s . s e c o n d a r y D e m a n d ( a , t s )
    m a r k e t min ( D T a , L D T a ) · P T
    e x c e s s max ( 0 , D T a L D T a ) · G b
    s h o r t a g e F e e max ( 0 , L D T a D T a ) · D F T
    f l e x D i s c o u n t min ( D x T a , D 2 T a ) · ( G b G s )
    C T a m a r k e t + e x c e s s + s h o r t a g e F e e f l e x D i s c o u n t
Supply Income
    S T a a c c o u n t s . s u p p l y ( a , t s , t f )
    S x T a a c c o u n t s . f l e x i b l e S u p p l y ( a , t s )
    S 2 T a a c c o u n t s . s e c o n d a r y S u p p l y ( a , t s )
    m a r k e t max ( S T a , L S T a ) · P
    e x c e s s min ( 0 , S T a L S T a ) · G s
    s h o r t a g e F e e min ( 0 , L S T a S T a ) · S F T
    f l e x B o n u s max ( S x T a , S 2 T a ) · ( G b G s )
    I T a m a r k e t + e x c e s s s h o r t a g e F e e + f l e x B o n u s
Agent Net
    B T a C T a + I T a
    b i l l s [ a ] B T a
Grid Net
    B T G a A a c c o u n t s . g r i d E x p o r t ( a , t s , t f ) G s + a A a c c o u n t s . g r i d I m p o r t ( a , t s , t f ) G b
    b i l l s [ Grid ] B T G
Community Net
    B T C a A B T a + B T G
    b i l l s [ Community ] B T C
Update a c c o u n t s with b i l l s

4. Agent Trading Strategies

This section will explain the energy profiles in Section 4.1, followed by the energy prediction method in Section 4.2, and concludes with the agents’ bidding strategy in Section 4.3.

4.1. Energy Profile

A set of agents A is defined where an agent a A has an energy profile in minute resolution n i a i [ 0 , , T ] where n i a is positive for energy demand and negative for energy supply. An agent with renewable supply or a prosumer is assumed to always first self-consume this supply. Therefore, when n i a is negative, this agent has already self-satisfied its demand and has more supply.

4.2. Energy Prediction

Agents in this work predict their demand or supply based on past values using a look-back amount denoted as k. Thus, for a given time t, the predicted energy n t a ¯ = n t k a where t [ 0 , , T ] . If k is 0 and t is in the future, this assumes the agent has complete knowledge of his future energy needs and can predict his profile with perfect foresight. Although such perfection in prediction, in reality, is highly unlikely, it is worth exploring and will be discussed in Section 5 in more details.
For an inflexible agent a A , the predicted energy demand, denoted as D ¯ T a , and the predicted energy supply, denoted as S ¯ T a , for a time interval T where the starting time in minutes is t s and the end time is t f , are represented by (16) and (17), respectively, where k is look-back amount in minutes used to compute n t a ¯ .
D ¯ T a = t = t s t f min ( 0 , n t a ¯ )
S ¯ T a = t = t s t f max ( 0 , n t a ¯ )
For a flexible agent a A , a storage device is defined with capacity a of C a , a charge power of V a and a discharge power of V + a and a state of charge profile S C t a where t [ 0 , , T ] . A storage device can only discharge or charge at any given time and cannot do both. An energy profile w t a is defined for the estimated energy profile after storage fulfilment. The predicted energy profile using the look-back k is used alongside the current S C t a to predict a new energy profile after using the energy storage. w t a is calculated using (18).
w t a = max 0 , n t a ¯ min ( S C t a , V + a ) , if n t a ¯ > 0 min 0 , n t a ¯ max ( S C t a C a , V a , if n t a ¯ < 0 0 , if n t a ¯ = 0
Note that while calculating the energy profile w t a , at each t, the S C t a is updated with the fulfilled amount from n t a ¯ . Similar to inflexible agents, the predicted demand and supply are calculated via (16) and (17), but using w t a instead of n t a ¯ . These are the predicted inflexible demand and supply, which cannot be fulfilled by the storage device.
Storage devices give flexible agents the ability to supply or demand more than they need. This ability allows these agents to sell or buy more if the price is suitable and to participate in the secondary market to fulfil their inflexible energy. First, flexible agents need to estimate how much demand or supply can they offer in the market. An agent’s maximum demand and supply abilities are defined as the maximum amounts the storage device can charge or discharge at time t plus the agent’s estimated net n t a ¯ . The flexible agents maximum demand for a time interval T with start time t s and finish t f , and a look-back value k is defined by (19). The storage demand is reduced by the predicted excess energy that needs to be stored, or is added to the agent’s demand. When n t a ¯ is positive, this means the agent has energy need that could either be fulfilled by the storage or by the market. However, if the storage fulfils this demand, then at this moment, the storage cannot charge because it is discharging to fulfil this energy need. Therefore, the storage demand ability at this moment is zero. In contrast, if the agent’s need is added to the storage demand, the agent can request more from the market to cover his needs and store the rest. The second approach is implemented to maximise the potential energy stored. If n t a ¯ is negative, the agent can demand from the market the remaining in his charge power if available or zero.
M a x D ¯ T = t = t s t f max 0 , min ( C a S C t a , V a ) + n t a ¯
Similarly, the maximum storage supply and for a time interval T is defined by (20). The storage supply is reduced by the predicted needed energy or is added to the agent’s supply. When n t a ¯ is negative, this means the agent has an excess supply that could be stored or exported to the market. However, if this supply is stored, then at this moment, the storage cannot discharge because it is charging with the excess supply. Therefore, the storage supply ability at this moment is zero. In contrast, if the agent’s supply is added to the storage supply, the agent can offer more to the market. If n t a ¯ is positive, the agents can offer the market the remaining in his discharge power if available or zero. Again, the second approach is implemented to maximise the potential energy offered to the market.
M a x S ¯ T = t = t s t f min 0 , max ( S C t a , V + a ) + n t a ¯
In computing the maximum demand ability and supply ability for a flexible agent, at each t, a temporary S C t a is updated with the maximum charge or discharge amounts to be included in the calculation of t + 1 . The maximum demand and supply in (19) and (20) contains both flexible and inflexible energy. Agents need to distinguish between them for bidding reasons. Therefore, flexible energy is calculated by subtracting inflexible energy from the maximum demand and supply.
D X ¯ T = M a x D ¯ T D ¯ T
S X ¯ T = M a x S ¯ T S ¯ T
The inflexible and flexible energy is priced differently, which is explained next in Section 4.3.

4.3. Bidding Strategy

The two grid prices, G b and G s , play an important role in the trading strategy. There is no reason for an agent to exchange energy within the community market at prices worse than the grid prices. Therefore, the maximum possible market price is G b and the minimum possible price is G s . As consumers are inflexible (i.e., they need to satisfy demand), we assume they are always prepared to pay G b to buy energy, and so their bids are always G b . Similarly, suppliers and prosumers without storage with any surplus supply are always prepared to sell at G s , their asks are always at G s (as otherwise the energy is wasted). Therefore, The bid for inflexible demand D ¯ T a is G b and the ask for the inflexible supply S ¯ T a is G s .
However, when prosumers have storage, they can offer different prices for both demand and supply. They can buy energy when supply is ample and sell it back when demand is higher. This is an essential element of the proposed market to create a profit opportunity for prosumers with storage. Thus, flexible agents can choose prices for S X ¯ T or D X ¯ T within the limits of the grid prices. No agent is allowed to sell energy at a lower price than G s or buy at a higher price that than G b .
Due to the complexity of the market model, a simple bidding strategy for flexible agents is implemented. The strategy is based on multiple parameters. The first one is the predicted price for the next market round denoted as P ¯ T + 1 . The prediction is performed by averaging the previously announced prices for the same round from past days. Thus, given the set of announced market prices H i T i [ T 24 , T 48 , , 0 ] and a size of the set M T for a market round T, Equation (23) represents the predicted price for the next round P ¯ T + 1 . If no market announcements exist for the next round, the predicted price is chosen halfway between the grid prices. To avoid having all agents adopt the same price prediction, a random noise ϵ , drawn from a standard uniform distribution with a minimum of −1 and a maximum of 1, is added to the predicted price. In summary, agents use the previously announced market prices to predict the price for the next round. ϵ is a random noise to introduce variance in the bidding strategy as all agents adopt the same strategy. The range (−1,1) is chosen because the price range between the gird prices is 5 in our simulations, and 20% of that range is 1, which is a reasonable variance.
P ¯ T + 1 = H T + 1 M T + 1 + ϵ U ( 1 , 1 ) , if M T + 1 > 0 G b + G s 2 , if M T + 1 = 0
The rationale behind predicting the price for the next market round is that agents can assume that if they do not sell their energy at the current round, they can sell it in the next round at P ¯ T + 1 . Thus, P ¯ T + 1 is the minimum asking price for the current round. The same applies to the demand, but instead of selling, agents assume they can buy it in the next round at P ¯ T + 1 . Therefore, P ¯ T + 1 is the maximum bidding price for the current round.
Another vital parameter in the bidding method is the gap between the selling and buying prices that flexible agents adopt. This gap is denoted as Δ . Agents adopt an increasing function for their flexible supply quantity S X ¯ T . They start at a price of P ¯ T + 1 + Δ 2 and increase it by an increment price z for each additional unit u that can be offered up to the maximum price of G b y . When the maximum price is reached, all the remaining quantity of S X ¯ T is offered at this maximum price even if it exceeds u. In the case of flexible demand quantity D X ¯ T , the price function is a decreasing function where agents start with the P ¯ T + 1 Δ 2 and decrease the price by z for each additional unit u demanded down to the minimum price of G s + y . Similarly, any remaining D X ¯ T is offered at the minimum price. Algorithm 6 shows the function used by agents to price their flexible energy using the mentioned parameters. Figure 4 provides an example quantity pricing for an agent with 5 kWh of D X ¯ T and 5 kWh of S X ¯ T . With this methodology, flexible agents participate in the market by providing their offers. The next section will present the agent-based market simulations.
Algorithm 5 Quantity Pricing.
Input the estimated price for the next round P T + 1 , the gap between the selling and buying prices Δ , price changing unit z quantity changing unit u, price of buying energy form the grid G b , price of selling energy to the grid G s , flexible demand quantity D X ¯ T , flexible supply quantity S X ¯ T
Output lists of bids and asks b i d s , a s k s
procedure Quantity Pricing ( P ¯ T + 1 , Δ , z , u , y , G b , G s , D X ¯ T , S X ¯ T )
Require: G b P ¯ T + 1 G s , Δ 0 , z > 0 , u 0 , y 0 , G b > G s , D X ¯ T 0 , S X ¯ T 0
   b i d s [ ] ▹ initialise bids list
   m a x B i d max ( P ¯ T + 1 Δ 2 , G s + y )
   m i n B i d G s + y
   a s k s [ ] ▹ initialise asks list
   m a x A s k G b y
   m i n A s k min ( P ¯ T + 1 + Δ 2 , G b y )
  if D X ¯ T > 0 then
    p r i c e S p a c e m a x B i d m i n B i d
   while D X ¯ T > 0 do
    if priceSpace = 0 then
      b i d s b i d s | | ( D X ¯ T , m i n B i d ) ▹ append quantity and price to bids list
      D X ¯ T 0
    else
      b i d s b i d s | | ( min ( D X ¯ T , u ) , m i n B i d + p r i c e S p a c e )
      D X ¯ T max ( 0 , D X ¯ T u )
      p r i c e S p a c e max ( 0 , p r i c e S p a c e z )
  if S X ¯ T > 0 then
    p r i c e S p a c e m a x A s k m i n A s k
   while S X ¯ T > 0 do
    if p r i c e S p a c e = 0 then
      a s k s a s k s | | ( S X ¯ T , m a x A s k ) ▹ append quantity and price to asks list
      S X ¯ T 0
    else
      a s k s b i d s | | ( min ( S X ¯ T , u ) , m a x A s k p r i c e S p a c e )
      S X ¯ T max ( 0 , S X ¯ T u )
      p r i c e S p a c e max ( 0 , p r i c e S p a c e z )
  return b i d s , a s k s

5. Simulations

To empirically validate the market mechanisms and agents proposed in earlier sections, we performed multiple simulations using data from real household appliances, random occupant activities and real energy prices. In more detail, the rest of this section is structured as follows. Section 5.1 gives an overview of the data used for energy profiles. Section 5.2 explains the measures evaluated in the simulations. Finally, Section 5.3 states the assumptions in the simulations and the parameters varied. We then present and discuss the results obtained in Section 6.

5.1. Data

The data used in the simulations are generated using the stochastic energy model developed by the Centre of Renewable Energy Systems Technology [37] to create realistic energy profiles. The model simulates households’ energy consumption using a range of electrical appliances and randomised human activities. Also, the model includes dwellings with Photovoltaic (PV) panels and models the energy generation by specifying the geographical coordinates in the UK, and using historical irradiation, temperature and cloud clearness data. The model is used to generate energy profiles for 100 agents with 50 consumers and 50 prosumers for 29 days in June, including weekends, using the geographical coordinates of Southampton. Five different solar array profiles are used with a maximum output of 2, 3, 3.5, 4 and 6 kW for 10 prosumers each to introduce variations in renewable supply among prosumers. The grid prices used in the simulations are from The Office of Gas and Electricity Markets (OFGEM), which is a UK government regulatory entity for energy markets. The selling to grid price G s is based on the latest Feed-In Tariff rates from OFGEM for 2019 [38]. The price used is 3.41 pence/kWh, which is the standard solar photovoltaic receiving the middle rate 0–10 kW as of Q1 2019. The buying from grid price G b is based on the annual average tariff prices for six large suppliers in the UK provided by OFGEM as of 28 June 2019 [39]: 8.3 pence/kWh.

5.2. Measures

Two measures of financial benefit are defined, one for consumers and one for suppliers. The saved demand cost attained from participating in the market compared to not being in the market, and buying the same energy from the grid at round T is referred to as demand savings, denoted as D S T , and represented by (24). The extra supply income received from participating in the market compared to not being in the market, and selling the same energy to the grid at round T is referred to as supply profit, denoted as S P T , and represented by (25). When D S T or S P T is negative indicates demand cost or supply income at this round is worse compared to the existence of no market.
D S T = a A D T a · G b C T a
S P T = a A S T a · G s I T a
The community net bill, B T C , defined in Section 3.7 is another measure considered. If B T C is positive, a deficit exists in the budget and cost needs to be paid by the community as a whole. If B T C is negative, a surplus exists in the budget and profit needs to be shared. The mechanism of distributing the community budget deficit or surplus is beyond the scope of this research, so only the net budget bill is reported.
In some cases, the fees from demand and supply shortage could result in agent bills that are worse than not being in the market. For example, let say an agent is allocated 5 kWh at the price of 6 pence/kWh, the agent then only uses 1 kWh. It is therefore charged a shortage fee of 4 · D F T = 4 ( 6 3.41 ) , which is 10.36. It pays this fee plus the 6 pence he pays for the 1 kWh which totals to 16.36 pence. On the other hand, importing 1 kWh from the grid with no market costs 8.3 pence. Therefore, this agent does not make any savings, and in fact, pays more for his energy compared to not participating in the market. Therefore, we introduce a notion of capped bills where the agent never pays more than the cost to import its true demand without participating in the market. Similarly, the agent never receives less than the income to export its true supply without participating in the market. The concept of the capped bill is adopted to avoid resulting in higher energy costs or profit compared to not participating in the CEM. In other words, agents are always at least as well off participating and never worse off. To this end, we compare what the cost would have been using the (fixed) grid prices. Note that we consider the caps ex-post, i.e., based on the actual consumption and/or production and so there is no uncertainty to consider here.
Equation (26) defines the capped bill B T a ^ for agent a at round T. Moreover, the capped community net bill B T C ^ is defined using B T a ^ in (26). Finally, the capped demand savings and supply profit D S T a ^ and S P T a ^ are defined in (28) and (29). The capped measures are important to note here as they will be discussed in more details under the imperfect predictions simulations Section 6.2.
B T a ^ = min ( C T a , D T a · G b ) + min ( I T a , S T a · G s )
B T C ^ = a A B T a ^ + B T G
D S T ^ = a A D T a · G b min ( C T a , D T a · G b )
S P T ^ = a A S T a · G s min ( I T a , S T a · G s )
Finally, the aggregate result for a day K is the sum of all results for rounds T where T K . Equations (30)–(35) define the aggregate uncapped and capped measures. The average daily aggregate results and the aggregate results for the entire simulations period will be compared in each setting presented in Section 6.
B K C = T K B T C
B K C ^ = T K B T C ^
D S K = T K D S T
D S K ^ = T K D S T ^
S P K = T K S P T
S P K ^ = T K S P T ^

5.3. Assumptions and Parameters

The simulations are performed over a 29 days period, which is referred to as M. The proposed market is simulated using two main settings, perfect predictions and imperfect predictions. Each setting is executed for a market without storage and varying the prosumer ratio in the community from 0% to 100%. Increasing the prosumer ratio also increases the renewable capacity of the community as prosumers have different solar profiles. Then, each setting is run for a market with 40% prosumers with storage varying the ratio of prosumers with storage from 0% to 100% with three different storage profiles. These profiles are capacities of 3, 5 and 10 kWh and charge/discharge powers of 3, 5 and 5 kW. Some parameters are fixed throughout the performed simulations (see Table 1).The fixed values provide reasonable freedom for agents to submit multiple offers given the price space between the chosen grid prices G b and G s is about 5 pence.

6. Results and Discussion

This section presents the results for the market simulations using the parameters discussed in Section 5.3 and the measures defined in Section 5.2. Section 6.1 presents the setting with prefect predictions, and Section 6.2 presents the setting with imperfect predictions.

6.1. Perfect Predictions

In the perfect predictions setting, agents are assumed to have absolute certainty or perfect foresight of their future supply and demand. This certainty is achieved by setting the look-back amount k to zero. Section 6.1.1 presents the simulations without storage, and Section 6.1.2 presents the simulations with storage.

6.1.1. Perfect Predictions without Storage

In each simulation, the average daily community net bill, B K C , where K M , is calculated for different prosumer ratios. Also, the averages daily S P K and D S K are calculated. A simulation with 20% prosumer ratio means a community with exactly 5 prosumers and 45 consumers. The simulations show that with perfect predictions, B K C is in a deficit state. This deficit exists because no energy is traded in the secondary market to create profit that compensates for the supply-demand overlap deficit. Figure 5 shows the daily average B K C with increasing prosumer ratio. With a prosumer ratio of zero, no deficit exists as there is no market. With a prosumer ratio of 20%, the deficit is insignificant because the energy traded is small as only 10 prosumers with 2 kW solar array can supply energy, and the demand is far greater. However, as energy traded becomes large enough, the deficit becomes significant at around £0.65 per day on average.
Figure 6 shows a comparison between the average daily S P K and D S K . Both are equal because the energy price in this setting is always at the mid-price between the grid prices. The mid-price is a result of all agents being inflexible and, therefore, not able to bid or ask different prices. Table 2 compares the results for this entire period M for each prosumer ratio. This setting with perfect predictions without storage indicates that the prosumer ratios between 40% and 60% produces the most benefit to the community, which is a similar result to other reviewed literate [10].

6.1.2. Perfect Predictions with Storage

When flexible agents are incorporated, the number of prosumers is fixed, and the storage ratio among the prosumers is varied. The prosumer ratio in this setting is selected at 40%, which means 20 agents are prosumers with an aggregate max PV power of 50 kW. Similar to the simulations in the previous setting without storage, the simulations with storage show that with perfect predictions, B K C is in a deficit state. This is expected as no energy is traded in the secondary market to compensate for the deficit. However, the deficit is reduced with the introduction of storage. Compared to the market with 40% prosumer ratio and without storage, where the average daily B K C is around £0.75 per day, introducing 20% storage ratio among the prosumers with 3 kWh storage devices reduces the average daily B K C to around £0.6 per day. Furthermore, increasing the storage ratio or the capacity also reduces the average daily B K C as seen in Figure 7. This reduction is due to the flexible agents’ ability to preserve energy and discharge it when it is needed by the market, rather than having the randomised supply control when energy is exported to the market.
The distribution of financial benefits in this setting shows that the average daily S P K is more significant than D S K . This shift is because flexible agents trade their energy at high prices to maximise their profit as seen in Figure 8. Moreover, Figure 8a shows that as more prosumers become flexible, D S K is reduced because less inflexible supply is offered at the low price of G s . Also, increasing the storage capacity has the same effect of lowering the inflexible energy. Figure 8b shows that having 10 kWh storage devices with all prosumers results in the most substantial average daily S P K and the least D S K at the same time.
Table 3 compares the results for this setting for the entire period M. It shows that introducing storage increases the sum of D S M and S P M , with S P M as the significant portion. Also, as the ratio of prosumers with storage increases, the share of S P M in the sum increases as well. In the same setting with 40% prosumers but without storage, the sum of both D S M and S P M is ~£203 with 50% for S P M . Equipping 20% of the prosumers with 3 kWh storage devices results in increasing the sum to £236, which is a 16% increase with S P M , making 60% of the sum. The market with 40% of the prosumers having 10 kWh capacity storage devices, has the most significant sum of £302, which is a 48% increase from the setting without storage, with S P M making 77% of the sum. This setting with storage shows that suppliers are benefiting more compared to without storage, which is anticipated, given their flexible ability and bidding strategy. To provide a further comparison, Table 3 also shows the aggregate demand savings from only using storage with no market. It refers to the savings from the energy that is stored then discharged to fulfil the agents’ demand. If no storage existed, this energy would have been exported to the grid and imported when needed. Therefore, the savings are the difference between G s and G b for every kWh. The storage only savings show that participating in the market is more profitable for prosumers with storage.

6.2. Imperfect Predictions

In the setting with imperfect predictions, uncertainty in demand and supply is introduced. A look-back time k of 60 minutes is chosen, which means agents predict their next round’s demand and supply as the amounts from the past hour. The capped and uncapped measures explained in Section 5.2 are compared for each simulation in this section, for the daily averages and the entire period. Section 6.2.1 presents the settings without storage, and Section 6.2.2 presents the setting with storage.

6.2.1. Imperfect Predictions without Storage

The results for this setting show the impact of the secondary market, which is evident compared to the setting with perfect predictions. The profit from the secondary market to the community overcomes any deficit and creates a surplus. However, when the bills are not capped, the shortage fees reduce D S M and S P M . Figure 9 shows a comparison between the average daily capped B K C ^ and uncapped B K C where both are negative bills, which indicate surplus states. However, this setting shows that the average daily B K C is larger than B K C ^ because the uncapped shortage fees result in higher demand costs and less supply income.
Figure 10 shows a comparison between the average daily D S K and S P K , and the average daily D S K ^ and S P K ^ . Increasing the prosumer ratio reduces the average daily D S K until it becomes negative with 100% prosumers as seen in Figure 10a. This behaviour is a sign that demand in a market with 100% prosumers under the uncapped approach, is slightly more expensive compared to no market. This is because demand shortage fees become more significant, as increasing the prosumer ratio means fewer consumers, which reduces the overall market demand. Another reason is the higher uncertainty in demand predictions compared to supply predictions when using the past hour approach. That is why the uncapped approach also reduces S P K , but not the same levels. Nevertheless, the average daily D S K ^ and S P K ^ in Figure 10b, indicate that the capped bill approach limits the shortage fees to a certain level, and results in higher combined benefit. Table 4 compares the results for this setting for the entire period M. In both capped and uncapped approaches, B M C ^ and B M C are negative, which indicates surplus states. However, the gain in the uncapped approach is a result of reducing D S M and S P M . This setting shows that the surplus from the secondary market is enough to overcome the deficit and adopted the capped bill approach.

6.2.2. Imperfect Predictions with Storage

By introducing flexible agents to the imperfect predictions settings, the results show the advantages of the proposed market to prosumers with storage and the effect of the secondary market. Note that flexible agents in this setting include the present state of charge in their predictions alongside the net profile from the past hour. Figure 11 shows that increasing the storage ratio reduces the surplus as more flexible agents take advantage of the secondary market, and less inflexible energy is traded there. The average daily B K C ^ and B K C are both in surplus states in all varying storage capacities and ratios. Figure 11b shows that the capped bill approach results in less surplus while still overcoming the deficit reaching close to complete balance of zero with 100% storage ratio.
As more prosumers become flexible, the trading price becomes higher, and the demand shortage fees become higher as well because of the gap between the clearing price and G s widens. On the other hand, the supply shortage fees become smaller as the gap between the clearing price and G b shrinks. This effect is shown in Figure 12a, where the average daily D S K decreases as the storage ratio increases. Also, increasing the storage ratio decreases the market demand as flexible agents become more able to fulfil themselves, which reduces D S K . The uncapped approach results in negative D S K with some storage ratios and capacities, while the capped approach maintains a positive D S K ^ in all combinations as seen in Figure 12b.
This setting shows that the average daily S P K and S P K ^ are larger with the addition of storage compared to the absence of storage. Also, increasing the capacity increases the average daily profit as well as increasing the flexible agents’ ability to offer supply in the market. Figure 13 shows both average daily S P K and S P K ^ . The differences between them are insignificant because of high trading prices, low supply shortage fees and less uncertainty as flexible agents predictions include the current state of charge. Table 5 compares the results for this setting for M. The surplus from the secondary market overcomes the deficit in all variations. The uncapped bills result in extra costs in demand because of the high shortage fees, which causes the demand to be more expensive. These cases are highlighted in red. Overall, the surplus from the secondary market is enough to support the capped bills approach, which results in a higher D S M ^ and S P M ^ . This setting also shows the ratio of S P M ^ in the sum of benefits S P M ^ + D S M ^ increases from 54% without storage to a range between 66 and 96% with different storage ratios and capacities.

7. Conclusions

This paper develops and evaluates a new community energy market. The proposed market model is a repeated discrete-time two-sided auction. The market selects prices and clears energy using market equilibrium methodology. The participating agents predict their energy offers using past consumption and production values. Only agents with storage can submit offers different from the grid prices. Agents that do not have storage always use the grid prices because they are inflexible. Agents with storage adopt a simple bidding strategy with an increasing price function for supply and a decreasing price function for demand. The bidding strategy maximises their profit under constrains on price increments and quantities. The market cleared energy is allocated using the envy-free division protocol. The model uses a minute-by-minute energy balancing approach that fulfils energy within the allocated amounts or a secondary exchange opportunity where agents with storage can capitalise, or lastly by the grid. The proposed billing method charges the grid prices for any excess energy and enforces the auction allocations using shortage fees to discourage agents from exaggerating their offers. The billing method also rewards agents with storage for any energy exchanged within the secondary market.
Considering the minute-by-minute energy balancing, this research shows that the imperfect overlap between supply and demand creates a deficit in the community net bill. This deficit is reduced through the proposed secondary market, capitalising on uncertainty in future energy predictions. The proposed billing method also reduces the deficit by collecting portions of the shortage fees from both demand and supply at the same time when less energy is exchanged with the grid. The disadvantage of this method is that it can result in overpriced demand when uncapped. However, the market evaluations show that capping the market bills with the bills if no market exists results in more financial benefits for both consumers and suppliers, while still maintaining enough surplus to overcome the deficit. In other words, the capped bill approach penalises the benefits from the market and does not create any financial disadvantages for the market participants. Therefore, the capped bills method is recommended with the proposed market. The model assumes accurate reporting of flexible and inflexible energy by agents and access to the storage devices, which may not always be feasible. Nevertheless, the results present a positive step towards promoting community energy markets.
Evaluation of the proposed market is performed using agent-based simulations for a community with 50 agents over 29 days. The market simulated is an-hour-ahead trading market. Simulated energy profiles based on CERT model [37] are used with average grid prices from OFGEM [38,39]. Several market settings are evaluated by varying the prosumer ratio in the community without storage, and then fixing this ratio and varying the ratio of storage among the prosumers. Furthermore, all the variations for the simulations with storage or without storage are performed for settings with perfect energy predictions and imperfect energy predictions. The results of the setting with perfect energy predictions without storage show that consumers and suppliers share the benefits equally. Additionally, the number of prosumers in the community influences the benefits. The highest combined benefit for consumers and suppliers achieved in the market simulations are for communities with prosumer ratios between 40 and 60%, which results in average aggregate daily demand savings and supply profit of £3.5 each. The same prosumer ratios also result in the highest average daily community net bill deficit of ~£0.75. However, the results of the setting with imperfect energy predictions also without storage show the effect of the secondary market and the billing method to overcome the deficit and create a surplus. Still, prosumer ratios between 40 and 60% result in the highest average daily community net bill surplus of £2 when bills are capped. The average aggregate daily demand savings drops to £1.9, and the average aggregate daily supply profit drops to £2.5 due to fees caused by uncertainties in supply and demand.
The results of introducing storage to the proposed market model are interesting. In the setting with perfect energy predictions with storage, flexible agents reduce the community net deficit through minimising the inflexibility of their supply and demand. With a community with 40% prosumers, the average daily community net bill deficit drops from £0.75 to £0.6 with 20% of prosumers having 3 kWh storage devices and down to £0.2 with all prosumers having 10 kWh storage devices. Furthermore, the market simulations with storage show more shares of the financial benefits go toward suppliers, which is desirable, given their investments in renewable generation or storage technology. Also, using a community with 40% prosumers with perfect predictions, the average aggregate daily supply profit increases from to £3.5 without storage, to £8.5 when all prosumers have 10 kWh storage devices. On the other hand, the average aggregate daily demand savings drops from £3.5 without storage, to £0.5 with all prosumers having 10 kWh storage devices. The setting with perfect predictions with storage show an increase in the total community benefits up to 48% compared to the same setting without storage. Moreover, the ratio of supply in the total community benefits increases from 50% to a range between 60 and 94% depending on the storage ratio and capacity.
In the setting with imperfect energy predictions with storage, the proposed secondary market and bill methods still overcome the deficit and create a surplus. However, flexible agents reduce the community net surplus because of lower uncertainty and benefits gained from the secondary market. Storage is a primary reason for reducing the uncertainty of energy predictions as the proposed model uses the current state of charge for the next round’s offers. The results show that storage reduces the average daily community net bill surplus from £2 without storage, to £0.4 when all prosumers have storage. Furthermore, the setting with imperfect predictions also shows that storage shifts the financial benefits towards suppliers. The average aggregate daily supply profit increases from £2.3 without storage, to £8 when all prosumers have 10 kWh storage devices. In contrast, the average aggregate daily demand savings decreases from £1.9 without storage, to £0.4 when all prosumers have 10 kWh storage devices. Moreover, the ratio of supply in the total community benefits increases from 54% to a range between 66 and 96% depending on the storage ratio and capacity. The proposed market model provides opportunities for flexible suppliers to benefit through the auction mechanism and the secondary market. However, the results show that having all suppliers as flexible with large storage capacities tend to make the demand savings insignificant in comparison. Therefore, a combination of flexible and inflexible suppliers is suggested to maintain motivation for consumers. Variations in the fixed parameters could modify the results obtained, but it not believed to change the overall trends. Additional simulations for the scenarios with storage were conducted with changed prosumer ratios, and similar results were achieved.
Finally, the proposed market model presents a design of a community energy market to incentivise supply and energy storage investments and account for uncertainty in supply and demand. In general, a mix of prosumers with storage, prosumers and consumers creates an ideal setting for the proposed market model where the benefits are shared in that order. Uncertainty in supply and demand is expected, but not at extreme levels where the market predictions become irrelevant, and most energy is exchanged in the secondary market. Although the net bill deficit/surplus is reduced by adding storage at the prosumers’ level, the net bill is not balanced completely. Further studies are therefore necessary to determine fair mechanisms of distributing the community net bill in both deficit and surplus states. Due to the complexity of the proposed market model, this research kept the agent strategy simple. However, future work will explore more sophisticated strategic behaviour and cooperative game-theoretical approaches. Moreover, the complexity of the model will be improved through incorporating electric vehicles, which not only influence the energy needs, but can also act as storage devices and means for transporting energy.

Author Contributions

Conceptualisation, A.M.A. and E.H.G.; methodology, A.M.A. and E.H.G.; software, A.M.A.; validation, A.M.A. and E.H.G.; formal analysis, A.M.A.; investigation, A.M.A.; data curation, A.M.A.; writing—original draft preparation, A.M.A. and A.P.-D.; writing—review and editing, A.M.A., E.H.G. and A.P.-D.; visualisation, A.M.A.; supervision, E.H.G. All authors have read and agreed to the published version of the manuscript.

Funding

A.P.-D. would like to acknowledge funding from an EPSRC Doctoral Training Centre grant (EP/L015382/1).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Eid, C.; Codani, P.; Perez, Y.; Reneses, J.; Hakvoort, R. Managing electric flexibility from Distributed Energy Resources: A review of incentives for market design. Renew. Sustain. Energy Rev. 2016, 64, 237–247. [Google Scholar] [CrossRef]
  2. Lesser, J.A.; Su, X. Design of an economically efficient feed-in tariff structure for renewable energy development. Energy Policy 2008, 36, 981–990. [Google Scholar] [CrossRef]
  3. Ilic, D.; Da Silva, P.G.; Karnouskos, S.; Griesemer, M. An energy market for trading electricity in smart grid neighbourhoods. In Proceedings of the 2012 6th IEEE International Conference on Digital Ecosystems and Technologies (DEST), Campione d’Italia, Italy, 18–20 June 2012; pp. 1–6. [Google Scholar] [CrossRef]
  4. Mengelkamp, E.; Gärttner, J.; Rock, K.; Kessler, S.; Orsini, L.; Weinhardt, C. Designing microgrid energy markets: A case study: The Brooklyn Microgrid. Appl. Energy 2018, 210, 870–880. [Google Scholar] [CrossRef]
  5. Xiao, Y.; Wang, X.; Pinson, P.; Wang, X. A Local Energy Market for Electricity and Hydrogen. IEEE Trans. Power Syst. 2018, 33, 3898–3908. [Google Scholar] [CrossRef] [Green Version]
  6. Wang, Y.; Saad, W.; Han, Z.; Poor, H.V.; Başar, T. A Game-Theoretic Approach to Energy Trading in the Smart Grid. IEEE Trans. Smart Grid 2014, 5, 1439–1450. [Google Scholar] [CrossRef] [Green Version]
  7. Majumder, B.P.; Faqiry, M.N.; Das, S.; Pahwa, A. An efficient iterative double auction for energy trading in microgrids. In Proceedings of the 2014 IEEE Symposium on Computational Intelligence Applications in Smart Grid (CIASG), Orlando, FL, USA, 9–12 December 2014; pp. 1–7. [Google Scholar] [CrossRef]
  8. Bigerna, S.; Bollino, C.A.; Micheli, S. Socio-economic acceptability for smart grid development—A comprehensive review. J. Clean. Prod. 2016, 131, 399–409. [Google Scholar] [CrossRef]
  9. Wiyono, D.S.; Stein, S.; Gerding, E.H. Novel Energy Exchange Models and a trading agent for community energy market. In Proceedings of the 2016 13th International Conference on the European Energy Market (EEM), Porto, Portugal, 6–9 June 2016; pp. 1–5. [Google Scholar] [CrossRef]
  10. Long, C.; Wu, J.; Zhang, C.; Thomas, L.; Cheng, M.; Jenkins, N. Peer-to-peer energy trading in a community microgrid. In Proceedings of the 2017 IEEE Power Energy Society General Meeting, Chicago, IL, USA, 16–20 July 2017; pp. 1–5. [Google Scholar] [CrossRef]
  11. Pilz, M.; Al-Fagih, L. Recent Advances in Local Energy Trading in the Smart Grid Based on Game-Theoretic Approaches. IEEE Trans. Smart Grid 2019, 10, 1363–1371. [Google Scholar] [CrossRef] [Green Version]
  12. Zhang, C.; Wu, J.; Zhou, Y.; Cheng, M.; Long, C. Peer-to-Peer energy trading in a Microgrid. Appl. Energy 2018, 220, 1–12. [Google Scholar] [CrossRef]
  13. Zhou, Y.; Wu, J.; Long, C. Evaluation of peer-to-peer energy sharing mechanisms based on a multiagent simulation framework. Appl. Energy 2018, 222, 993–1022. [Google Scholar] [CrossRef]
  14. Yaagoubi, N.; Mouftah, H.T. Energy Trading in the smart grid: A game theoretic approach. In Proceedings of the 2015 IEEE International Conference on Smart Energy Grid Engineering (SEGE), Oshawa, ON, Canada, 17–19 August 2015; pp. 1–6. [Google Scholar] [CrossRef]
  15. Mengelkamp, E.; Garttner, J.; Weinhardt, C. The role of energy storage in local energy markets. In Proceedings of the 2017 14th International Conference on the European Energy Market (EEM), Dresden, Germany, 6–9 June 2017. [Google Scholar] [CrossRef]
  16. Mengelkamp, E.; Staudt, P.; Garttner, J.; Weinhardt, C. Trading on local energy markets: A comparison of market designs and bidding strategies. In Proceedings of the 2017 14th International Conference on the European Energy Market (EEM), Dresden, Germany, 6–9 June 2017. [Google Scholar] [CrossRef]
  17. Park, C.; Yong, T. Comparative review and discussion on P2P electricity trading. Energy Procedia 2017, 128, 3–9. [Google Scholar] [CrossRef]
  18. Mihaylov, M.; Jurado, S.; Avellana, N.; Van Moffaert, K.; De Abril, I.M.; Nowé, A. NRGcoin: Virtual currency for trading of renewable energy in smart grids. In Proceedings of the 11th International Conference on the European Energy Market (EEM14), Krakow, Poland, 28–30 May 2014. [Google Scholar] [CrossRef]
  19. Vytelingum, P.; Ramchurn, S.D.; Voice, T.D.; Rogers, A.; Jennings, N.R. Trading agents for the smart electricity grid. In Proceedings of the International Joint Conference on Autonomous Agents and Multiagent Systems, AAMAS, Toronto, ON, Canada, 10–14 May 2010; Volume 2, pp. 897–904. [Google Scholar]
  20. Chen, K.; Lin, J.; Song, Y. Trading strategy optimization for a prosumer in continuous double auction-based peer-to-peer market: A prediction-integration model. Appl. Energy 2019, 242, 1121–1133. [Google Scholar] [CrossRef]
  21. Lüth, A.; Zepter, J.M.; Crespo del Granado, P.; Egging, R. Local electricity market designs for peer-to-peer trading: The role of battery flexibility. Appl. Energy 2018, 229, 1233–1243. [Google Scholar] [CrossRef] [Green Version]
  22. Zhang, C.; Wu, J.; Long, C.; Cheng, M. Review of Existing Peer-to-Peer Energy Trading Projects. Energy Procedia 2017, 105, 2563–2568. [Google Scholar] [CrossRef]
  23. Arghandeh, R.; Woyak, J.; Onen, A.; Jung, J.; Broadwater, R.P. Economic optimal operation of Community Energy Storage systems in competitive energy markets. Appl. Energy 2014, 135, 71–80. [Google Scholar] [CrossRef] [Green Version]
  24. Crespo Del Granado, P.; Wallace, S.W.; Pang, Z. The value of electricity storage in domestic homes: A smart grid perspective. Energy Syst. 2014, 5, 211–232. [Google Scholar] [CrossRef]
  25. Parra, D.; Gillott, M.; Norman, S.A.; Walker, G.S. Optimum community energy storage system for PV energy time-shift. Appl. Energy 2015, 137, 576–587. [Google Scholar] [CrossRef]
  26. Parra, D.; Norman, S.A.; Walker, G.S.; Gillott, M. Optimum community energy storage system for demand load shifting. Appl. Energy 2016, 174, 130–143. [Google Scholar] [CrossRef]
  27. Parra, D.; Norman, S.A.; Walker, G.S.; Gillott, M. Optimum community energy storage for renewable energy and demand load management. Appl. Energy 2017, 200, 358–369. [Google Scholar] [CrossRef]
  28. Sardi, J.; Mithulananthan, N.; Gallagher, M.; Hung, D.Q. Multiple community energy storage planning in distribution networks using a cost–benefit analysis. Appl. Energy 2017, 190, 453–463. [Google Scholar] [CrossRef]
  29. Zame, K.K.; Brehm, C.A.; Nitica, A.T.; Richard, C.L.; Schweitzer, G.D. Smart grid and energy storage: Policy recommendations. Renew. Sustain. Energy Rev. 2018, 82, 1646–1654. [Google Scholar] [CrossRef]
  30. Yan, X.; Lin, J.; Hu, Z.; Song, Y. P2P trading strategies in an industrial park distribution network market under regulated electricity tariff. In Proceedings of the 2017 IEEE Conference on Energy Internet and Energy System Integration, EI2 2017, Beijing, China, 26–28 November 2017; pp. 1–5. [Google Scholar] [CrossRef]
  31. Nicolaisen, J.; Petrov, V.; Tesfatsion, L. Market power and efficiency in a computational electricity market with discriminatory double-auction pricing. IEEE Trans. Evol. Comput. 2001, 5, 504–523. [Google Scholar] [CrossRef] [Green Version]
  32. Lamparter, S.; Becher, S.; Fischer, J.G. An Agent-based Market Platform for Smart Grids. In Proceedings of the 9th International Conference on Autonomous Agents and Multiagent Systems: Industry Track, Toronto, ON, Canada, 10–14 May 2010; pp. 1689–1696. [Google Scholar]
  33. Friedman, D. The double auction market institution: A survey. In The Double Auction Market: Institutions, Theories, and Evidence; Routledge: Abingdon-on-Thames, UK, 1993; Chapter 1; pp. 3–26. [Google Scholar]
  34. Niu, J.; Parsons, S. Maximizing matching in double-sided auctions. arXiv 2013, arXiv:1304.3135. [Google Scholar]
  35. Khorasany, M.; Mishra, Y.; Ledwich, G. Market framework for local energy trading: A review of potential designs and market clearing approaches. IET Gener. Transm. Distrib. 2018, 12, 5899–5908. [Google Scholar] [CrossRef] [Green Version]
  36. Brams, S.J.; Taylor, A.D. An Envy-Free Cake Division Protocol. Am. Math. Mon. 1995, 102, 9–18. [Google Scholar] [CrossRef]
  37. McKenna, E.; Thomson, M. High-resolution stochastic integrated thermal–electrical domestic demand model. Appl. Energy 2016, 165, 445–461. [Google Scholar] [CrossRef] [Green Version]
  38. OFGEM. Feed-In Tariff (FIT) Rates; OFGEM: London, UK, 2019.
  39. OFGEM. Retail Market Indicators; OFGEM: London, UK, 2019.
Figure 1. The market timeline shows when agents submit their bids and asks and when the facilitator announces the results. Exchanging energy based on the results occurs at the start of every hour. The hourly bills are calculated at the end of each hour.
Figure 1. The market timeline shows when agents submit their bids and asks and when the facilitator announces the results. Exchanging energy based on the results occurs at the start of every hour. The hourly bills are calculated at the end of each hour.
Energies 13 00972 g001
Figure 2. Example of computed clearing price and trading volume for a market round. The bids and asks prices are always within the grid prices. The clearing price is in the middle of the buy–sell gap. Demand/supply at any price is the aggregate bids/asks that could be fulfilled using this price. The shaded area corresponds to social welfare using the bids and asks as the traders private values.
Figure 2. Example of computed clearing price and trading volume for a market round. The bids and asks prices are always within the grid prices. The clearing price is in the middle of the buy–sell gap. Demand/supply at any price is the aggregate bids/asks that could be fulfilled using this price. The shaded area corresponds to social welfare using the bids and asks as the traders private values.
Energies 13 00972 g002
Figure 3. An example of the imperfect overlap between a consumer and a supplier each allocated 2 kWh. In the first half-hour, no supply is available, so there is a shortage of 1 kWh. The supplier’s entire 2 kWh is exported in the second half of the hour, which creates a surplus of 1 kWh. Assuming both agents do not have storage, the shortage and surplus have to be fulfilled by the grid. Thus, 1 kWh is imported at G b , and 1 kWh is exported at G s . This condition creates a net bill deficit because both agents demanded and supplied exactly their allocation, but some energy was exchanged with the grid to resolve the imperfect overlap.
Figure 3. An example of the imperfect overlap between a consumer and a supplier each allocated 2 kWh. In the first half-hour, no supply is available, so there is a shortage of 1 kWh. The supplier’s entire 2 kWh is exported in the second half of the hour, which creates a surplus of 1 kWh. Assuming both agents do not have storage, the shortage and surplus have to be fulfilled by the grid. Thus, 1 kWh is imported at G b , and 1 kWh is exported at G s . This condition creates a net bill deficit because both agents demanded and supplied exactly their allocation, but some energy was exchanged with the grid to resolve the imperfect overlap.
Energies 13 00972 g003
Figure 4. Asks and bids for 5 kWh of flexible energy in both supply and demand. The next round predicted price P ¯ T + 1 at this instance is halfway between G b and G s . The price gap Δ is set to 1 pence, the quantity u is set to 1 kWh, the price changing rate z is set to 0.5 pence and the price distance from the grid prices y is set to 0.25 pence. This agent submitted 5 bids and 5 asks for each with 1 kWh.
Figure 4. Asks and bids for 5 kWh of flexible energy in both supply and demand. The next round predicted price P ¯ T + 1 at this instance is halfway between G b and G s . The price gap Δ is set to 1 pence, the quantity u is set to 1 kWh, the price changing rate z is set to 0.5 pence and the price distance from the grid prices y is set to 0.25 pence. This agent submitted 5 bids and 5 asks for each with 1 kWh.
Energies 13 00972 g004
Figure 5. Daily average B K C for the simulations with perfect predictions without storage. A deficit exists a result of the imperfect overlap between supply and demand. The deficit is noticeable with a prosumer ratio of 40% and higher as more energy is traded within the market. The error bars represent 95% confidence intervals.
Figure 5. Daily average B K C for the simulations with perfect predictions without storage. A deficit exists a result of the imperfect overlap between supply and demand. The deficit is noticeable with a prosumer ratio of 40% and higher as more energy is traded within the market. The error bars represent 95% confidence intervals.
Energies 13 00972 g005
Figure 6. Average daily S P K and D S K for the setting with perfect predictions without storage. Both results are the same in this setting because P T is always in the middle of G b and G s as all agents are inflexible. The error bars represent 95% confidence intervals. (a) Average daily D S K . (b) Average daily S P K .
Figure 6. Average daily S P K and D S K for the setting with perfect predictions without storage. Both results are the same in this setting because P T is always in the middle of G b and G s as all agents are inflexible. The error bars represent 95% confidence intervals. (a) Average daily D S K . (b) Average daily S P K .
Energies 13 00972 g006
Figure 7. Average daily B K C for the simulations with perfect predictions with storage. The average daily B K C deficit was reduced by increasing the ratio of prosumers with storage or by increasing the storage capacity in the community.
Figure 7. Average daily B K C for the simulations with perfect predictions with storage. The average daily B K C deficit was reduced by increasing the ratio of prosumers with storage or by increasing the storage capacity in the community.
Energies 13 00972 g007
Figure 8. Average daily D S K and S P K for the setting with perfect predictions with storage. The average S P K is more than D S K because flexible agents raise the trading price to gain more profit. That is why as storage ratio increases, S P K increases as well, because prosumers have more flexible energy to offer at higher prices, which also decreases D S K . The error bars represent 95% confidence intervals. (a) Average daily D S K . (b) Average daily S P K .
Figure 8. Average daily D S K and S P K for the setting with perfect predictions with storage. The average S P K is more than D S K because flexible agents raise the trading price to gain more profit. That is why as storage ratio increases, S P K increases as well, because prosumers have more flexible energy to offer at higher prices, which also decreases D S K . The error bars represent 95% confidence intervals. (a) Average daily D S K . (b) Average daily S P K .
Energies 13 00972 g008
Figure 9. Average daily B K C ^ and B K C for the setting with imperfect predictions without storage. Both average daily B K C ^ and B K C are negative, which indicate surplus states. However, B K C is more with all prosumer ratios due to the uncapped approach. The error bars represent 95% confidence intervals.
Figure 9. Average daily B K C ^ and B K C for the setting with imperfect predictions without storage. Both average daily B K C ^ and B K C are negative, which indicate surplus states. However, B K C is more with all prosumer ratios due to the uncapped approach. The error bars represent 95% confidence intervals.
Energies 13 00972 g009
Figure 10. Comparison between the average daily D S K and S P K , and the average daily D S K ^ and S P K ^ for the setting with imperfect predictions without storage. The error bars represent 95% confidence intervals. (a) Average daily D S K and S P K . With 100% prosumer ratio, D S K is negative because of the uncapped bills approach. (b) Average daily D S K ^ and S P K ^ . The capped bills approach produces higher D S K ^ and S P K ^ compared to the uncapped D S K and S P K .
Figure 10. Comparison between the average daily D S K and S P K , and the average daily D S K ^ and S P K ^ for the setting with imperfect predictions without storage. The error bars represent 95% confidence intervals. (a) Average daily D S K and S P K . With 100% prosumer ratio, D S K is negative because of the uncapped bills approach. (b) Average daily D S K ^ and S P K ^ . The capped bills approach produces higher D S K ^ and S P K ^ compared to the uncapped D S K and S P K .
Energies 13 00972 g010
Figure 11. Comparison between the average daily B K C ^ and B K C for the setting with imperfect predictions with storage. The error bars represent 95% confidence intervals. (a) Average daily B K C . Under the uncapped approach, increasing the storage capacity or the ratio of prosumers with storage decreases the average daily surplus, but it is still significant with around £2 per day when all prosumers have storage. (b) Average daily B K C ^ . Under the capped approach, increasing the storage capacity or the ratio of prosumers with storage decreases the average daily surplus, but it reaches close to zero with 100% prosumers with storage. However, B K C ^ does not enter a deficit state.
Figure 11. Comparison between the average daily B K C ^ and B K C for the setting with imperfect predictions with storage. The error bars represent 95% confidence intervals. (a) Average daily B K C . Under the uncapped approach, increasing the storage capacity or the ratio of prosumers with storage decreases the average daily surplus, but it is still significant with around £2 per day when all prosumers have storage. (b) Average daily B K C ^ . Under the capped approach, increasing the storage capacity or the ratio of prosumers with storage decreases the average daily surplus, but it reaches close to zero with 100% prosumers with storage. However, B K C ^ does not enter a deficit state.
Energies 13 00972 g011
Figure 12. Comparison between average daily D S K and D S K ^ with storage variations. The error bars represent 95% confidence intervals. (a) Average daily D S K . Capacities 5 and 10 kWh with 60% or more prosumers with storage, decrease D S K to below zero, which is more significant with larger capacities. (b) Average daily D S K ^ . Increasing the storage capacity or the ratio of prosumers with storage decreases D S K ^ , but it never reaches negative levels.
Figure 12. Comparison between average daily D S K and D S K ^ with storage variations. The error bars represent 95% confidence intervals. (a) Average daily D S K . Capacities 5 and 10 kWh with 60% or more prosumers with storage, decrease D S K to below zero, which is more significant with larger capacities. (b) Average daily D S K ^ . Increasing the storage capacity or the ratio of prosumers with storage decreases D S K ^ , but it never reaches negative levels.
Energies 13 00972 g012
Figure 13. Comparison between average daily S P K and S P K ^ . Increasing the storage ratio and capacity increase both profits. The reduction from the uncapped bill approach is still present. However, it is insignificant due to high supply profit and low supply shortage fees as more prosumers become flexible. The error bars represent 95% confidence intervals. (a) Average daily S P K . (b) Average daily S P K ^ .
Figure 13. Comparison between average daily S P K and S P K ^ . Increasing the storage ratio and capacity increase both profits. The reduction from the uncapped bill approach is still present. However, it is insignificant due to high supply profit and low supply shortage fees as more prosumers become flexible. The error bars represent 95% confidence intervals. (a) Average daily S P K . (b) Average daily S P K ^ .
Energies 13 00972 g013
Table 1. Simulations fixed parameters.
Table 1. Simulations fixed parameters.
ParamterValueUnitDescription
M29daysLength of the simulation
Δ 1pennyStrategy price gap
u1kWhStrategy increment quantity
z0.5pennyStrategy price changing rate
y0.25pennyStrategy distance from the grid prices
G b 8.3penceBuy price from the grid
G s 3.41penceSell price to the grid
Table 2. The results for M in £ for the setting with perfect predictions without storage. At the end of the period, B M C is in a deficit state with all prosumer ratios. D S M and S P M are highest with prosumer ratios between 40 and 60%.
Table 2. The results for M in £ for the setting with perfect predictions without storage. At the end of the period, B M C is in a deficit state with all prosumer ratios. D S M and S P M are highest with prosumer ratios between 40 and 60%.
Prosumer RatioAggregate Max PV Power B M C DS M SP M
20%201.5150.0550.05
40%5021.51101.51101.51
60%8518.54102.82102.82
80%12518.3887.5487.54
100%18514.8061.7161.71
Table 3. The results for M in £ for the setting with perfect predictions with storage. At the end of the period, B M C is in a deficit state in all storage ratio variations. However, increasing the storage ratio decreases the deficit. Also, increasing the storage ratio increases S P M as more prosumers become flexible, but, it also reduces D S M . By aggregating D S M and S P M , the configuration of 40% of prosumers having 10 kWh capacity storage devices, results in the most substantial combined benefit with 77% for S P M .
Table 3. The results for M in £ for the setting with perfect predictions with storage. At the end of the period, B M C is in a deficit state in all storage ratio variations. However, increasing the storage ratio decreases the deficit. Also, increasing the storage ratio increases S P M as more prosumers become flexible, but, it also reduces D S M . By aggregating D S M and S P M , the configuration of 40% of prosumers having 10 kWh capacity storage devices, results in the most substantial combined benefit with 77% for S P M .
Ratio of
Prosumers
with Storage
Storage
Capacity
(kWh)
Storage
Power
(kW)
B M C DS M SP M DS M + SP M SP M SP M + DS M Aggregate
Demand Savings
From Storage Only
0%0021.51101.51101.51203.0250%
20%3317.7095.71141.10236.8160%18.66
40%3315.1382.65170.18252.8367%39.66
60%3313.6468.63190.65259.2874%61.32
80%3310.7748.64214.18262.8281%82.94
100%339.1039.00225.78264.7885%102.73
20%5518.32100.43149.25249.6860%22.43
40%5514.2478.55190.64269.1971%47.35
60%5511.1952.04221.85273.8981%74.48
80%5510.2727.30237.68264.9890%101.82
100%557.0723.00244.41267.4191%125.41
20%10513.04111.32174.30285.6261%25.17
40%1058.5469.53232.86302.3977%52.79
60%1058.7731.95252.88284.8389%84.96
80%10510.4015.89241.31257.2094%117.50
100%1055.5415.62251.00266.6294%144.44
Table 4. Comparison between capped and uncapped results for the setting with imperfect predictions without storage for M in £. At the end of the period, both B M C and B M C ^ are in surplus states. However, under the uncapped approach, increasing the prosumer ratio decreases D S M until it becomes negative with 100% prosumers, whereas the capped approach maintains community surplus, and results in higher D S M ^ and S P M ^ .
Table 4. Comparison between capped and uncapped results for the setting with imperfect predictions without storage for M in £. At the end of the period, both B M C and B M C ^ are in surplus states. However, under the uncapped approach, increasing the prosumer ratio decreases D S M until it becomes negative with 100% prosumers, whereas the capped approach maintains community surplus, and results in higher D S M ^ and S P M ^ .
Prosumer Ratio B M C B M C ^ DS M DS M ^ SP M SP M ^
20%−39.11−30.4738.3640.7021.1227.42
40%−88.60−58.8137.9455.7854.9766.92
60%−95.30−60.4227.8350.6963.9775.98
80%−86.25−49.5112.1738.3158.2968.88
100%−74.05−38.48−4.2621.9138.8348.23
Table 5. Comparison between capped and uncapped results for the setting with imperfect predictions with storage for M in £. Both B M C and B M C ^ are in a surplus states. However, increasing the storage ratio or the capacity decreases D S M until it becomes negative. The capped approach maintains a community surplus and results in higher D S M ^ and S P M ^ . The ratio of S P M ^ in the benefits sum increase from 54% without storage to 66–96% with storage.
Table 5. Comparison between capped and uncapped results for the setting with imperfect predictions with storage for M in £. Both B M C and B M C ^ are in a surplus states. However, increasing the storage ratio or the capacity decreases D S M until it becomes negative. The capped approach maintains a community surplus and results in higher D S M ^ and S P M ^ . The ratio of S P M ^ in the benefits sum increase from 54% without storage to 66–96% with storage.
Storage
Ratio
Capacity
(kWh)
Power
(kW)
B M C B M C ^ DS M DS M ^ SP M SP M ^ SP M ^ SP M ^ + DS M ^
0%00−88.60−58.8137.9455.7854.9766.9254%
20%33−98.55−62.0524.1752.9496.05103.7866%
40%33−94.90−60.0520.8950.85123.77128.6672%
60%33−84.77−48.5014.2247.15151.31154.6577%
80%33−66.78−26.85−1.4937.15187.65188.9484%
100%33−55.13−14.45−5.5934.68211.92212.3386%
20%55−102.72−63.2727.1057.8199.19107.9365%
40%55−101.75−59.5910.3847.13142.06147.4676%
60%55−90.71−45.83−4.6937.27178.73181.6583%
80%55−71.47−21.66−28.1021.31218.65219.0691%
100%55−59.52−8.42−31.5419.47241.28241.3893%
20%105−123.84−76.5433.6568.33108.44121.0764%
40%105−120.92−68.30−2.6543.67170.85177.1680%
60%105−101.32−47.18−30.8521.70213.13214.7391%
80%105−73.88−18.71−44.6110.39227.04227.2296%
100%105−63.52−8.30−44.0011.13249.15249.2496%

Share and Cite

MDPI and ACS Style

Alabdullatif, A.M.; Gerding, E.H.; Perez-Diaz, A. Market Design and Trading Strategies for Community Energy Markets with Storage and Renewable Supply. Energies 2020, 13, 972. https://doi.org/10.3390/en13040972

AMA Style

Alabdullatif AM, Gerding EH, Perez-Diaz A. Market Design and Trading Strategies for Community Energy Markets with Storage and Renewable Supply. Energies. 2020; 13(4):972. https://doi.org/10.3390/en13040972

Chicago/Turabian Style

Alabdullatif, Abdullah M., Enrico H. Gerding, and Alvaro Perez-Diaz. 2020. "Market Design and Trading Strategies for Community Energy Markets with Storage and Renewable Supply" Energies 13, no. 4: 972. https://doi.org/10.3390/en13040972

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop