Next Article in Journal
Exergetic Evaluation of an Ethylene Refrigeration Cycle
Next Article in Special Issue
Frequency Analysis of Solar PV Power to Enable Optimal Building Load Control
Previous Article in Journal
Automated Data Filtering Approach for ANN Modeling of Distributed Energy Systems: Exploring the Application of Machine Learning
Previous Article in Special Issue
Economic Management Based on Hybrid MPC for Microgrids: A Brazilian Energy Market Solution
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Stochastic MPC Based Energy Management System for Simultaneous Participation in Continuous and Discrete Prosumer-to-Prosumer Energy Markets

by
Pablo Baez-Gonzalez
1,
Felix Garcia-Torres
2,
Miguel A. Ridao
1 and
Carlos Bordons
1,*
1
Department of Systems Engineering and Automatic Control, Universidad de Sevilla, 41092 Sevilla, Spain
2
Applications Unit, Centro Nacional del Hidrógeno, 13500 Puertollano, Spain
*
Author to whom correspondence should be addressed.
Energies 2020, 13(14), 3751; https://doi.org/10.3390/en13143751
Submission received: 15 June 2020 / Revised: 15 July 2020 / Accepted: 15 July 2020 / Published: 21 July 2020
(This article belongs to the Special Issue Model Predictive Control for Energy Management in Microgrids)

Abstract

:
This article studies the exchange of self-produced renewable energy between prosumers (and with pure end consumers), through the discrete trading of energy packages and proposes a framework for optimizing this exchange. In order to mitigate the imbalances derived from discrepancies between production and consumption and their respective forecasts, the simultaneous continuous trading of instantaneous power quotas is proposed, giving rise to a time-ahead market running in parallel with a real-time one. An energy management system (EMS) based on stochastic model predictive control (SMPC) simultaneously determines the optimal bidding strategies for both markets, as well as the optimal utilisation of any energy storage system (ESS). Simulations carried out for a heterogeneous group of agents show that those with SMPC-EMS achieve savings of between 3% and 15% in their energy operation economic result. The proposed structures allows the peer-to-peer (P2P) energy trading between end users without ESS and constitute a viable alternative to avoid deviation penalties in secondary regulation markets.

1. Introduction

The growing presence of distributed energy resources (DER) makes more and more necessary a change in the classical conception of energy markets. By giving end users the possibility of producing their own energy, the figure of the prosumer appears as an additional role to the traditional ones of pure producer and consumer. According to the latest annual forecast report [1] of the International Energy Agency (IEA), energy from renewable sources will increase its penetration in the coming years, from 26% share of global generation in 2019 to 30% in 2024. To do so, the agency estimates that the renewable power installed worldwide will increase by 50% in that period. Moreover, it is expected that almost 30% of this increase will be covered by distributed solar photovoltaic (PV) generation, which implies the installation of between 300 and 400 GW (+250%) of additional power in the aforementioned five-year period. PV installations owned by individuals, communities or industries will represent an increasing percentage of the total installed distributed PV power. The availability of ownership data varies greatly between countries, but taking the example of Germany, which has one of the most developed renewable sectors in the world, it can be seen how in 2016 more than 42.5% of PV generation capacity was owned by private individuals or farmers, while only 15.7% was owned by standard power providers (the remaining being owned by industries, project planners or the business sector) [2].
While the primary objective of end users when installing DER is self-consumption, energy surpluses might become common as the efficiency of the consumption equipment and the productivity of the generators improve. This surplus energy can be stored in different types of energy storage systems (ESS) such as pumped hydro storage, hydrogen or batteries, etc., to be consumed later during periods when production is lower than consumption. However, if the excess production exceeds the storage capacity, a generation curtailment should be carried out in those instants when it does not exist instantaneous consumption, which translates into energy waste. Currently, many states have implemented legislative mechanisms to encourage renewable sources to account for an ever-increasing proportion of the national annual electricity generation, and compel traditional distribution system operators (DSO) to absorb excess renewable production and to compensate the end user for this surplus. To have DSO as the only alternative to which to sell the excess production poses a problem for DER owners, since it leaves to its total discretion (possibly forced also by public administrations) the determination of the main parameters of the trade, namely: amount of power/energy, price per unit and form of economic compensation. Furthermore, in a global context, the emergence of the shared economy concept [3] has revolutionised other sectors such as passenger transport or tourist accommodation. It seems therefore logical to envisage a future in which heterogeneous end users (households, factories, work-centres, electric vehicles, etc.) pertaining to the same microgrid can exchange energy peer-to-peer (eP2P) according to their production and consumption profiles [4].
Peer-to-peer energy trading has raised considerable interest within the scientific community in recent years. Different approaches and techniques has been proposed to incorporate P2P trade into the energy system [5], including game theory [6], distributed trading algorithms [7] (including consensus [8]), evolutionary algorithms (including Particle Swarm Optimization [9] and Genetic algorithms [10]) and market-driven trading [11,12], which is the one used in this study. The interested reader is referred also to [13] for a comprehensive survey on architectures, power routing and security and privacy issues. A large body of literature is devoted to applications in which a series of peers under the same point of common coupling (PCC), or alternatively within the same microgrid, aggregate their generation and their consumption so that they interface the grid to import/export only the net of what they need/exceed as a community. The costs and incentives are then shared out by prorating the contribution of each peer to the total consumption and total supply (energy produced that does not need to be imported from the network) [14,15,16].
Regarding explicitly market-driven P2P energy trading, the traditional approach is to negotiate energy packages (EP) of fixed or arbitrary size, ahead of time. In other words, the agreement between buyer and seller occurs in a time period prior to that of the actual consumption of the transacted energy [17]. Depending on whether buyer and/or seller have the corresponding ESS to store the energy before its consumption, the physical transfer of the energy between them can occur immediately after the trade or at a later instant, exactly when the consumption is supposed be done. When no one has an ESS, the seller negotiates the transfer of an energy package that has not yet been physically generated, and the buyer negotiates the purchase of an energy package that is expected to be consumed. In either case, any divergence between the forecasts and the actual values (of generation and/or consumption) would cause a breach of the agreed transaction, with the corresponding power imbalance for the grid.
Only a few works have addressed the inherent uncertainty in residential eP2P trading due to the stochastic nature of renewable generation and electricity consumption. Liu et al. [18] propose an intraday hour-ahead P2P market (as an additional alternative to demand side management) to trade the imbalances of the day-ahead peer-to-grid market. Another solution, proposed by Zhang et al. [19], consists on trading energy and uncertainty jointly, so that PV owners sell electricity to consumers and consumers with flexible loads sell regulating capacity to PV owners. Both previous approaches mitigate but do not eliminate the effect of uncertainties, as they might still affect the smaller EP traded in intraday markets, or the flexibility used as adjustable capacity. An alternative form, presented by the authors of this paper in [20], is to commercialise power quotas (PQ) either for supply or demand, that are negotiated (and adapted) in real time. In this way, only real surpluses and deficits are traded at any given time, and uncertainties do not affect market operations. However, real-time markets are often characterized by greater price volatility than time-ahead markets, precisely because of their uncertainty. Furthermore, the existence of ESS on the seller’s and buyer’s side allows the transfer of energy ahead of consumption, extending market time, monetisation possibilities and the rate of renewable energy used.
Therefore, this paper proposes the coexistence of two parallel markets for residential eP2P trading. In the first one, already stored energy packages are matched with available storage capacity ahead of time, so that transfer breaches can not occur. In the second one, power quotas are negotiated in real time, tackling uncertainty through real time adaptation of transferred power. Those agents who do not have an ESS can still benefit from the time-ahead market and use the real-time market as a regulation mechanism in case of imbalances.
The remaining of the paper is organised as follows. The structures of the two markets are introduced in (Section 2). An energy management system (EMS) allowing simultaneous participation in both markets is presented in (Section 3 and Section 5). Section 4 derives two control formulations that simultaneously optimize participation in each market, one being stochastic and the other deterministic. The two control structures are simulated on an example case (Section 6) to analyze their different effect on the operating result of the peers, which are discussed in Section 7.

2. Integrated Energy Packages and Power Quotas Markets

A double auction (DA) based market [21] is a trading institution in which both buyers and sellers can raise and modify their respective offers to buy (bids) and offers to sell (asks). In a discrete-time double auction (DDA), the change in allocation of goods or market clearing occurs at one or more fixed time instants between the start of the auction and the end of the trading period. Traders must place their bids and asks before each clearing instant, and both set of offers are used to determine the supply and demand staircases for commodities. The equilibrium point sets the (uniform) trading price, and thus the surpluses, for all the trades within that trading period.
In a continuous double auction (CDA), in contrast, buyers and sellers can individually choose to accept a bid or ask at any particular price (discriminatory price) at any point in time, and then update their allocation immediately.
In general, various forms of energy trading can coexist, associated with both continuous and discrete double auction structures. In our specific case, we propose the coexistence of a market for the trading of energy packages, based on a DDA, with another market for the trading of power quotas, based on a CDA.
The discrete market acts as a futures market. According to the Investopedia, a futures market is an auction market in which participants buy and sell commodity and futures contracts for delivery on a specified future date. Futures are exchange-traded derivatives contracts that lock in future delivery of a commodity or security at a price set at present time. Those agents who expect to have more consumption than generation, try to balance this expected deficit through the purchase of energy packages of adequate size in advance. Those agents who have a certain amount of stored energy, and who expect to have more generation than consumption, try to make the surplus profitable through the sale of energy packages. The EMS uses the power quota market as an alternative for continuous time compensation for possible errors in operational predictions. Even if energy packages have been purchased in advance to compensate for an expected deficit, an agent may find itself in an energy deficit situation if predictions fail (i.e., if its actual consumption is higher than expected, or if actual generation is lower than expected). Alternatively, those agents who did not expect to have a surplus can effectively experience it if their consumption is lower than expected or their production is higher than expected. In these cases, they can choose to store the surplus in their ESS, or sell it on the continuous market. In any case, it is assumed that all agents are individually rational (IR): deficit agents only buy in the P2P continuous market if the purchase price is lower than that offered by the energy retailer company; surplus agents only sell in the P2P continuous market if the sale price is higher than the utility they expect to obtain for the consumption of that energy in the future.

3. An EMS for Simultaneous Participation in Both Markets

The architecture of the proposed EMS is depicted in Figure 1. To enable simultaneous participation in both markets, while performing optimal power dispatch, the EMS needs to track the state of the entity. At any given time t, the entity’s state, x ( t ) = { S O C ( t ) , B C ( t ) , S C ( t ) } , is defined by the state of charge of its ESS, S O C ( t ) , and the buy commitment, B C ( t ) , and sell commitment S C ( t ) , previously acquired and not yet completely satisfied. An agent’s state implicitly determines the amount of energy it can bid or ask for in the market.
The EMS might or not include an Strategy Advisor (SA), explained in Section 4, that performs optimisation at each t o p t = τ k = k · Δ T D D A immediately prior to each discrete market session. Before such session opens for offers submission, the agent’s EMS is assumed to have the following information:
  • The following N opening instants of the discrete market, { τ k + 1 , , τ k + N } , which are assumed to be evenly spaced over time according to a certain period of time, Δ T D D A = τ i + 1 τ i , i Z + , where N is the length of the prediction horizon, measured in number of intervals of the discrete market. In the case of agents whose permanence in the market is dynamic this implies that they know therefore the number of remaining sessions they have to negotiate, and the corresponding time period they would have to effectively inject/absorb the energy they manage to trade.
  • The market history up to a certain past horizon N h . This includes, for each past trading period k i , i Z + , 1 i N h , the set of all individual bids and asks, Ω ( τ k i ) = { φ ( τ k i ) , ϑ ( τ k i } (each offer Ω is defined by a bid/asked quantity φ at a price ϑ ) and their market result, M ( τ k i ) = { q ( τ k i ) , p ( τ k i ) } (being q the quantity actually traded and p the price actually paid/received).
  • Forecasts of consumption profile ( P ˜ l o a d ( t ) ) and generation profile ( P ˜ g e n ( t ) ) along certain forecasting horizon ( t Z : τ k t τ k + N f ). Generally, N f N h , i.e., the EMS uses a wider time range for calculating the foreseeable energy balance than the time range it uses to optimize its future actions in the markets.
  • The time profile of the price offered by the utility company ( ϑ u t i l ( t ) ) along the prediction horizon ( t Z : τ k t τ k + N · Δ T D D A ).

3.1. Energy Balance Forecasting

Since the time resolution of the consumption and generation forecasts is generally greater than the length of the interval between sessions, the EMS is in charge of carrying out the time aggregation to calculate the interval-wise energy gross result vector G R = { g r [ i ] } , where (please note that parentheses are used to refer to continuous time variables, while brackets denote discrete variables):
g r [ i | τ k ] = t = τ k + ( i 1 ) Δ T D D A τ k + i Δ T D D A P ˜ g e n ( τ ) P ˜ l o a d ( τ ) d τ , for 1 i N
Obviously, it must hold that N f N · Δ T D D A . The cumulative gross result, G R c , vector shows the same dimensions as G R , its elements being given by:
g r c [ i | τ k ] = j = k i g r [ j | τ k ] , for 1 i N
Three additional forecast variables can be calculated using the cumulative gross result:
P D [ τ k ] = B C ( τ k ) + i = 1 N g r [ i | τ k ]
        P S [ τ k ] = ( B r ( τ k ) B m i n ) + i = 1 N g r [ i | τ k ] S C ( τ k ) +
E S [ τ k ] = P S [ τ k ] ( B m a x B m i n ) + P S [ τ k ]
where · + denotes m a x { 0 , · } and · denotes m i n { 0 , · } . P D [ τ k ] ( , 0 ] is the predicted deficit, which equals zero unless the sum of the buy commitments not yet received, ( B C ( τ k ) ), plus the aggregation of the gross result over the prediction horizon is negative. P S [ τ k ] [ 0 , ) is the predicted surplus, which equals zero unless the sum of the current level of energy stock, ( B r ( τ k ) B m i n ) , plus the aggregation of the gross result over the prediction horizon, minus the sell commitments not yet satisfied, ( S C ( τ k ) ), is positive. Finally, E S [ τ k ] [ 0 , 1 ) is the excess surplus which represents the portion of the expected surplus that exceeds the maximum energy stock storage capacity, ( B m a x B m i n ) , and which therefore cannot be stored and would be unused if not sold.

Private Valuation

The trading agents of all entities have the same way of valuing power in the PQ-Market and energy in the EP-Market. However, the valuation is different for each of the two possible roles (buyer or seller). For the PQ-Market, the private valuation of the buyers is equivalent to the instantaneous price at which the distributor is pricing the energy at each moment, i.e., λ p b ( t ) = ϑ ( t ) . This implies that (rational) buyers never buy P2P power above the distributor’s price. On the other hand, sellers value power at 35% of the value offered by the distributor (this is an arbitrarily chosen percentage and can be replaced by any other. Different percentages could even be selected for each of the traders). This implies that the unit price of the sellers is, at most, 65% lower than the instantaneous price offered by the distributor.
For the EP-Market, each trader values the energy as the average cost of its future energy needs, predicted over a future horizon of duration N p .
λ e i ( t ) = k = 0 N p 1 q ^ i ( t + k ) · p ^ i ( t + k ) k = 0 N p 1 q ^ i ( t + k )
where q ^ i ( t + k ) is the forecast electrical consumption of the i-th prosumer during the k-th future instant, and  p ^ i ( t + k ) is the utility electricity price for i-th prosumer during the same k-th future instant. However, valuation here also varies depending on the role adopted by the trader. Traders which forecast deficit (buyers) directly use the aforementioned value, which implies that a buyer will try to buy energy packages with unitary price below its average energy unit cost within the prediction horizon. Sellers, for their part, adjust their valuation depending on the excess surplus (5) they forecast, considering that rather than discarding the excess of generation over consumption that exceeds the storage capacity of the battery, it is better to lower its value to sell it albeit at a lower price:
λ e s ( t ) = λ e ( t ) · ( 1 E S ( t ) ) + ϱ · λ e ( t ) · E S ( t )
where ϱ ( 0 , 1 ) is an arbitrary ratio indicating at what percentage of the average energy cost the surplus portion is valued.
Table 1 summarises the private valuation for both markets and both roles.

3.2. Markets Forecasting

Knowing the historical of submitted offers and their corresponding market results, the EMS can compute the following statistical terms that constitute the model (see Figure 2) for the discrete double auction-based energy packages market:
  • The sequence of average buying and selling prices (or the average price for uniform pricing) for each past markets session, p ¯ m k t = { p ¯ m k t [ k i ] } , i Z : 1 i N h . As each session corresponds to a specific time instant t = ( k i ) Δ T D D A , this is equivalent to calculating the time evolution of the average market spot price during the period covered by the previous N h sessions.
  • Liquidity vectors, for both demand, L b = { b [ k i ] } , and supply, L a = { a [ k i ] } , with  i Z : 1 i N h .
    b [ k i ] = q b [ k i ] φ b [ k i ]      a [ k i ] = q a [ k i ] φ a [ k i ]

4. A Strategy Advisor Based on Model Predictive Control

The main objective of the Strategy Advisor is to meet the projected energy demand along the prediction horizon and to do so at the lowest possible cost. To this end, taking into account the existence and availability of the two markets, it generates an optimal dispatch plan that controls the energy flows for each of the sources that the entity has available. The vector of controllable variables is u = { E u t i l [ i ] , E c h [ i ] , E d i s [ i ] , φ b [ i ] , φ a [ i ] } , i { τ k , τ k + N 1 } . Its components correspond to the following energy quantities: E u t i l [ i ] is the amount of energy to be consumed from the utility during the i-th period; E c h [ i ] and E d i s [ i ] respectively correspond to the amount of energy to be charged or discharged from the ESS during i-th period; φ b [ i ] is the amount of energy that the entity intends to buy at the i-th period, which will be bid in the market session held in t = τ i ; finally, φ a [ i ] is the amount of energy that the entity attempts to sell in the i-th period, which will be asked in the market session held in t = τ i . Therefore, the function corresponding to the cost of energy operation of the entity along a certain prediction horizon, N is:
J ( x [ k ] ) , u ) = i = k k + N 1 E u t i l [ i ] · ϑ u t i l [ i ] + φ b [ i ] · p ˜ E P [ i ] · ( 1 ˜ b [ i ] ) φ a [ i ] · p ˜ E P [ i ] · ˜ a [ i ] ( g r [ i ] + E c h [ i ] ) · p ˜ P Q [ i ]
where the tilde (˜) over a variable indicates it is a random variable. By multiplying the price p ˜ E P by the buying liquidity complement ( 1 ˜ b ) , the expected purchase prices of those market instants with low liquidity are artificially increased. Thus, during optimisation, agents acting as buyers will be more reluctant to plan their purchases at such market sessions. Alternatively, by multiplying the price p ˜ E P by the selling liquidity ˜ a , the expected selling prices of those market instants with low liquidity are artificially lowered. Thus, during optimisation, agents acting as sellers will be more reluctant to plan their sales at such market sessions.

4.1. The Expected Value Problem

The economic objective function in (8) extends over a prediction horizon. Therefore, its elements refer to the future values of its inputs, which are the controllable variables, and to the future values of the state of the system and its outputs, which would result from the application of those inputs. Optimisation also depends on the forecast profiles of consumption, generation and prices for the two existing markets. These values, as already mentioned, are stochastic and therefore subject to uncertainty. A possible simplification consists in disregarding information on the uncertainty, taking a nominal scenario, and optimizing actions on the nominal scenario. As the common practice for defining a nominal scenario is to replace random variables by their expectation, the resulting problem is called the expected value problem, the solution of which constitutes a nominal plan [22]. At the next decision stage, the Strategy Advisor will recompute the plan by solving an updated expected value problem on a new nominal scenario that incorporates the observations of the current stage.
In this sense, the following formulation is deterministic, as it is based on nominal consumption, production and price profiles, without taking into account the aforementioned uncertainties. Specifically, within the optimisation, the market-related random variables p ˜ E P [ i ] , ˜ b [ i ] , ˜ a [ i ] , p ˜ P Q [ i ] are replaced by their respective expectations, p ¯ E P [ i ] , ¯ b [ i ] , ¯ a [ i ] , p ¯ P Q [ i ] . Since there is no a priori statistical information available on market uncertainty, the expectation of variables in future instants is replaced by the average value of those variables in past isotemporal sessions (market sessions held at the same time period of the day but in previous days).
Thus, the optimisation problem to be solved in each t = τ k is the cost minimisation of the energy operation of the entity, which is defined by the formulation (9)–(23):
u * [ i | k ] = arg   min E u t i l [ i ] , E c h [ i ] , E d i s [ i ] φ b [ i ] , φ a [ i ] i = k k + N 1 E u t i l [ i ] · ϑ u t i l [ i ] + φ b [ i ] · p ¯ E P b [ i ] · ( 1 ¯ b [ i ] ) φ a [ i ] · p ¯ E P a [ i ] · ¯ a [ i ] ( g r [ i ] + E c h [ i ] ) · p ¯ P Q [ i ]
S O C [ i + 1 ] = S O C [ i ] E d i s [ i ] φ a [ i ] + E c h [ i ] + min { κ e , B C [ i ] + φ b [ i ] }
S C [ i + 1 ] = S C [ i ] + φ a [ i ] min { κ e , S C [ i ] + φ a [ i ] }
B C [ i + 1 ] = B C [ i ] + φ b [ i ] min { κ e , B C [ i ] + φ b [ i ] }
E ˜ l o a d = E s c [ i ] + E d i s [ i ] + E u t i l [ i ]
D O D m a x S O C [ i ] 1
0 E d i s [ i ] min { κ e , S O C [ i ] D O D m a x }
0 φ a [ i ] S O C [ i ] D O D m a x
0 φ b [ i ] 1 S O C [ i ]
0 E u t i l [ i ] E ˜ l o a d [ i ]
0 E c h [ i ] g r [ i ] E s c [ i ] +
φ a [ i ] · φ b [ i ] = 0
S C [ i ] · φ b [ i ] = 0
B C [ i ] · φ a [ i ] = 0
0.4 S O C [ k + N 1 ] 0.6
where κ e is the energy transfer capacity of the entity’s converters (i.e., the maximum amount of energy that can be injected into/drained from the grid during a single period, and  D O D m a x is the maximum allowable depth of discharge of the ESS. Please note that all variables are normalised with respect to the maximum storage capacity of the entity’s ESS, so that both states and control inputs are expressed in units of batteries.
Constraints (10) and (12) determine how the system evolves over time, while constraint (13) imposes that the expected load must be always meet, no matter which sources are used. The following assumptions has been considered in the controller as design criteria, which affect several constraints:
A.1. 
Following the prudence concept, quantities sold on the market are immediately deducted from the SOC, even though the physical transfer has not even begun. This avoids the possibility of selling already committed energy. On the contrary, the acquired energy is not assumed as immediately incorporated, but is added over time. This prevents the optimiser from allocating energy that is expected to be acquired in a future instant but will not be available until a later future instant (constraint (10)).
A.2. 
Once a purchase or sale agreement has been reached, the physical transfer of the energy associated with that transaction begins immediately and continues uninterruptedly until it is completed (constraints (11) and (12). In other words, transfers cannot be postponed.
A.3. 
Own production is dedicated primarily to self-consumption. Therefore, E s c [ i ] = min { E ˜ g e n [ i ] , E ˜ l o a d [ i ] } is not a controllable variable but a parameter computed on the basis of the forecast generation and consumption.
A.4. 
Purchasing energy from the utility for later consumption is forbidden (constraint (18)). In other words, during periods of low tariff prices, the entity cannot acquire more energy than it needs from the utility in order to store it and consume it during periods of high tariffs.
A.5. 
In the same market session, each entity can only play one role, either buyer or seller (constraint (20)). Given that transfers must be started immediately after they are settled, an entity with unsatisfied sales commitments cannot go to the market as a buyer (constraint (21)); conversely, as long as it has unsatisfied buy commitments, an entity cannot go to the market as a seller (constraint (22)).
A.6. 
In the optimisation process, the strategic advisor assumes that future offers will be fully matched in the market (i.e., the optimiser assumes that q a [ i ] = φ a [ i ] and q b [ i ] = φ b [ i ] ). Immediately after the clearing of the k-th market session, the advisor already knows the real result of the offers shouted in that period. If the offers have not been matched, the available energy differs from that assumed in the optimal strategy profile, so it may be necessary to re-run the optimiser to adjust the values of E u t i l [ k ] , E c h [ k ] and E d i s [ k ] . In any case, given that the optimiser is run before the next market session (for which the results of the immediately previous session are already available), the quantities actually offered, φ a * [ k ] and φ b * [ k ] , are always the optimal ones based on the actual state at any given time.

4.2. Multiple Scenarios SMPC Approach (MS-SMPC)

From the point of view of each agent, both P2P markets are considered stochastic systems, since the outputs ( m = ( q , p ) ) for each one of the agent’s offers might be different for the same inputs ( ω = φ , ϑ ) ), depending on the offers made by the other participant agents, which are considered an unknown disturbance. Scenario-based optimisation provides an intuitive way to approach the solution to the problem of stochastic optimisation. The idea behind this approach is to compute an optimal finite-horizon input sequence that is feasible under N s sampled ‘scenarios’ of the uncertainty, thus obtaining a certain level of robustness [23]. One of the advantages of this approach is that it does not assume a prior knowledge of the statistical properties that characterise uncertainty (e.g., a certain probability distribution function) as is generally required in stochastic optimisation. Each scenario consists of values for some or all of the stochastic processes that affect the system. Furthermore, it has been widely used for performing optimal power dispatch (e.g., [24]) and for optimal participation in energy markets [25]. In our case, only the stochasticity of the P2P markets’ prices is proposed to be addressed. Therefore, each scenario is a full horizon sample of the prices for the two markets,
ξ ( j ) [ k ] = def { p E P ( j ) [ k ] , , p E P ( j ) [ k + N 1 ] , ( j ) b [ k ] , , ( j ) b [ k + N 1 ] , ( j ) a [ k ] , , ( j ) a [ k ] , p P Q ( j ) [ k ] , , p P Q ( j ) [ k + N 1 ] }
Specifically, within the optimisation, the market-related random variables p ˜ E P [ i ] , ˜ b [ i ] , ˜ a [ i ] and p ˜ P Q [ i ] are replaced by their corresponding values for each scenario, p E P ( j ) [ i ] , ( j ) b [ i ] , ( j ) a [ i ] and p P Q ( j ) [ i ] .
The offers that determine actual market parameters depend directly on the energy result expected by the different agents, which is given in turn by their consumption and generation forecasts. These predictions depend fundamentally on the climatology, and therefore present a significant level of correlation between consecutive days, as well as between identical days of previous years, provided that the typology of day (workable or weekend) is the same. Therefore, the approach proposed here to build the set of scenarios is to use the set of time series representing market realisations in past days (i.e., the evolution of the average prices and liquidities over similar periods of previous days). The Multiple Scenarios Stochastic MPC (MS-SMPC) problem then reads as follows:
u * [ i | k ] = arg   min E u t i l [ i ] , E c h [ i ] , E d i s [ i ] φ b [ i ] , φ a [ i ] j = 1 N s i = k k + N 1 E u t i l [ i ] · ϑ u t i l [ i ] + φ b [ i ] · p E P ( j ) b [ i ] · ( 1 ( j ) b [ i ] ) φ a [ i ] · p E P ( j ) a [ i ] · ( j ) a [ i ] ( g r [ i ] + E c h [ i ] ) · p ¯ P Q [ i ]
S O C [ i + 1 ] = S O C [ i ] E d i s [ i ] φ a [ i ] + E c h [ i ] + min { κ e , B C [ i ] + φ b [ i ] }
S C [ i + 1 ] = S C [ i ] + φ a [ i ] min { κ e , S C [ i ] + φ a [ i ] }
B C [ i + 1 ] = B C [ i ] + φ b [ i ] min { κ e , B C [ i ] + φ b [ i ] }
E ˜ l o a d = E s c [ i ] + E d i s [ i ] + E u t i l [ i ]
D O D m a x S O C [ i ] 1
0 E d i s [ i ] min { κ e , S O C [ i ] D O D m a x }
0 φ a [ i ] S O C [ i ] D O D m a x
0 φ b [ i ] 1 S O C [ i ]
0 E u t i l [ i ] E ˜ l o a d [ i ]
0 E c h [ i ] g r [ i ] E s c [ i ] +
φ a [ i ] · φ b [ i ] = 0
S C [ i ] · φ b [ i ] = 0
B C [ i ] · φ a [ i ] = 0
0.4 S O C [ k + N 1 ] 0.6

5. The Power Dispatcher

After solving the MS-SMPC formulated by Equations (25)–(39), since a receding-horizon strategy is used, only the first member of the optimal finite-horizon policy is kept and applied to the system, i.e., the SMPC control law is
κ M S S M P C ( x [ k ] , ξ [ k ] ) = def u * [ 1 | k ]

5.1. Role Selection

Role Selection for the PQ-Market is performed based on the balance between generated power (if available) and consumed power. Peers with surplus go to the PQ-Market as sellers trying to trade that surplus whenever the SOC of their storage system is greater than a certain level S O C M k t m i n . If the SOC is lower than this level, the surplus is used to charge that storage. Deficit peers go to the market as buyers trying to wipe out that deficit. As for the EP-Market, two possibilities arise, depending on whether the trading agent of the entity’s EMS implements an SA or not:
  • A trading agent that does not have an SA, decides its role based only in its energy balance forecast. If  P D [ τ k ] < 0 the entity will play buyer, even if it has surplus for the immediate time slot. If  P D [ τ k ] = 0 P D [ τ k ] > 0 the entity will play seller, even if it has deficit for the immediate time slot (please remind that both P D [ k ] and P S [ k ] are variables that aggregate forecast over a prediction horizon).
  • Role selection in trading agents who have a strategic advisor is an inherent result of the strategic optimisation itself. If  φ b * [ 1 | τ k ] > 0 the entity will play buyer in the immediate market session. Conversely, if  φ a * [ 1 | τ k ] > 0 the entity will play seller in the immediate market session. If  φ b [ 1 | τ k ] = 0 φ a [ 1 | τ k ] = 0 the entity remains idle, reserving itself for future and more potentially beneficial sessions. The possibility of φ b [ 1 | τ k ] > 0 φ a [ 1 | τ k ] > 0 is avoided by the very definition of the optimiser’s constraints (20) and (36).
As mentioned before, the amounts φ a * [ k ] or φ b * [ k ] implicitly determine the role that the entity will adopt in the imminent market session (remember that only one of them can be non-zero). If the offers are matched, the optimal plan is still valid; otherwise, the optimiser must be run again to resolve the MS-SMPC replacing φ a * [ k ] by q a * [ k ] and φ b * [ k ] by q b * [ k ] .

5.2. Demand Satisfaction

In either case, the optimal control variables { E u t i l * [ k + ] , E c h * [ k + ] , E d i s * [ k + ] } are sent as inputs to the power dispatcher (see Figure 1). The functions performed by this block are threefold: (i) to control the power flows to ensure that demand is met at all times, (ii) to maintain the state of charge of the Energy Storage System(s) within predefined safety levels, and (iii) to maximise, as far as possible, the profits obtained through the participation in the P2P market. Furthermore, those entities with Strategy Advisor use the continuous eP2P power quota market as a disturbance absorption mechanism, i.e., they go to this market only when the difference between the forecast consumption and generation profiles and the actual ones makes it impossible to operate following the optimal plan defined by the strategic advisor. Meanwhile, those entities whose EMS does not have the Strategy Advisor go to both the EP and the PQ Markets at any given time. In any case, the power demand satisfaction is driven at all times by Algorithm 1.
Algorithm 1 Demand Satisfaction Algorithm with Integrated Markets for peer k
1: Inputs
2:  { E u t i l * [ k + ] , E c h * [ k + ] , E d i s * [ k + ] } Optimal Plan
3:  x ( t )  Current State
4:  ϑ u t i l ( t )  Energy Price offered by the utility
5: Data
6:  S O C m a x  Maximum allowed ESS Level
7:  S O C m i n  Minimum allowed ESS Level
8:  κ s t g  Maximum ESS charge/discharge power
9: Auxiliary
10:  Φ ( t )  Gross Power Balance: Φ ( t ) = def P g e n ( t ) P l o a d ( t )
11:  Υ ( t )  Result After Rearrangement: Υ ( t ) = def P g e n ( t ) P l o a d ( t ) + P P 2 P ( t )
12:  Ψ ( t )  Net Power Balance: Ψ ( t ) = def P g e n ( t ) P l o a d ( t ) + P P 2 P ( t ) + P s t o ( t )
13:  E u t i l c ( t )  Accumulator of energy acquired from the utility during the k period
14:  E c h c ( t )  Accumulator of energy injected into the ESS during the k period
15:  E d i s c ( t )  Accumulator of energy drained from the ESS during the k period
16: Result
17:  P s t o ( t + )
18:  P u t i l ( t + )
19:  S O C ( t + )
20: while 1 do
21: if Υ ( t ) > 0 S O C ( t ) < S O C m a x then
22:  ▹ P s c ( t ) = P l o a d ( t )
23:  if E c h * [ k + ] E c h c ( t ) then
24:   ▹ The optimal value of energy injected into the ESS has not yet been reached. Charge.
25:    P c h ( t + ) min { Υ ( t ) , κ s t g }
26:  else if E c h * [ k + ] < E c h c ( t ) then
27:   ▹ The optimal value of energy injected into the ESS has already been exceeded. Try to sell the surplus.
28:    P c h ( t + ) 0
29:    φ P Q a ( t ) min { Υ ( t ) , κ s t g }
30:  end if
31: else if Υ ( t ) < 0 then
32:  ▹ P s c ( t ) = P g e n ( t )
33:  if E d i s * [ k + ] E d i s c ( t ) then
34:   ▹ There is still room for discharge in this period. Drain the battery.
35:    P d i s ( t + ) max { Υ ( t ) , κ s t g }
36:  else if E d i s * [ k + ] < E d i s c ( t ) then
37:   ▹ The ESS has already supplied all the energy planned for this period. Try to buy the deficit.
38:    P d i s ( t + ) 0
39:    φ P Q b ( t ) min { Υ ( t ) , κ s t g }
40:  end if
41: end if
42: Go to P2P PQ Market. q P Q b ( t ) and q P Q a ( t ) affect P P 2 P ( t )
43: Recompute Ψ ( t ) with the updated value P P 2 P ( t ) .
44: if Ψ ( t ) > 0 then                    ▹ Could not sell all the excess.
45:  if S O C ( t ) < 1 then                 ▹ Store the remaining surplus
46:    P c h ( t + ) min { Ψ ( t ) , κ s t g }
47:  else if S O C ( t ) = 1 then            ▹ Sell remaining surplus to the utility
48:    P u t i l ( t + ) Ψ ( t )
49:  end if
50: else if Ψ ( t ) < 0 then                ▹ Could not purchase all the defitit.
51:   P u t i l ( t + ) Ψ ( t )
52: else
53:  ▹ Ψ ( t ) = 0 Perfect Balance
54:   P u t i l ( t + ) 0
55: end if
56:  E c h ( t ) min ( Δ t 0 P c h ( τ ) d τ , S O C m a x S O C ( t ) ) )
57:  E d i s ( t ) max ( Δ t 0 P d i s ( τ ) d τ , S O C ( t ) S O C m i n ) )
58:  E c h c ( t + ) E c h c ( t ) + E c h ( t )
59:  E d i s c ( t + ) E d i s c ( t ) + E d i s ( t )
60:  E u t i l c ( t + ) E u t i l c ( t ) + Δ t 0 max { 0 , P u t i l ( τ ) d τ }
61:  S O C ( t + ) = S O C ( t ) + E c h ( t ) + E d i s ( t )
62: end while

6. Case Study

6.1. Description

In this case example the entities are a group H of 100 houses within the same neighbourhood in the city of Córdoba (Spain). Some of these houses ( P V p e n = 45 % ) are supposed to have photovoltaic (PV) generation systems. There are three possible installed PV powers, P p h v { 1 , 3 , 5 } kWp, and each of them has an associated ESS of adequate capacity, B m a x { 2.5 , 5 , 7 } kWh respectively. Houses with no PV-installation still have an ESS of B m a x = 10 kWh to be able to participate in the EP-Market. Among the 100 houses, S A p e n = 10 % (10 Houses) are randomly selected which form the control set, H c . These houses are replicated twice, giving rise to three sets:
  • Set NoStrat, ( H c ): Houses without Strategy Advisor.
  • Set Strat-NonSto, ( H n s ): Houses with Strategy Advisor based on expected value scenario according to optimisation problem (9).
  • Set Strat-Sto, ( H s ): Houses with MS-SMPC-based Strategy Advisor according to optimisation problem (25).
The H n s and H s resulting sets (20 houses) are simulated together with the remaining H houses of the original population, which already include H c , giving rise to a total population of n H = 120 houses. All houses simultaneously participate in the two different markets. The first one is a PQ-Market similar to the one introduced in [20]. The second one is an hourly EP-Market. The main parameters of both markets are displayed in Table 2. The EMS of all houses incorporates two trading agents, one per each market.

6.1.1. Scenario Generation

To generate the scenarios (price evolution and market liquidity profiles), a full month (30 days) of operation of 100 houses (all without Strategy Advisor) was simulated. These simulations assumed that each agent perfectly knows its generation and consumption profiles, obtained from [26], so that offers (and thus prices) reflect the real energy needs/excess of the traders within the simulated days. The results are shown in Figure 3. In a real application case, the equivalent of these scenarios obtained by simulation would be the historical data profiles obtained either from similar days in previous years or from the days immediately preceding the current operation day, or from a combination of both.

6.1.2. Operation Costs and Final Stock Valuation

In this case study, the net cost of energy for the i-th house over a certain period of time ( T = [ t i , t f ] ) can be calculated as:
Φ i ( T ) = Φ u t i l i ( T ) + Φ c i ( T ) + Φ E P i ( T ) + Φ P Q i ( T )
where
Φ u t i l i ( T ) = t T E u t i l i ( t ) · ϑ ( t )
Φ c i ( T ) = E c i ( T ) · ϑ ¯
Φ E P i ( T ) = ω e Ω i e p A ω e i ( T )
Φ P Q i ( T ) = ω p Ω i p q A ω p i ( T )
being A ω e i ( T ) the amount of money corresponding to each energy package transaction ω e in the set Ω i e p of all eP2P transactions dealt by house i at the EP-Market within T, and A ω p i ( T ) the amount of money corresponding to each power quota transaction ω p in the set Ω i p q of all eP2P transactions dealt by house i at the PQ-Market within T:
A ω = q ω · p ω
where q ω is the traded quantity and p ω is the unit price of the agreed transaction.
Equation (41) is the sum of the cost of energy purchased from the utility (42), plus the revenue of energy compensated by the utility at a price equal to the Voluntary Price for the Small Consumer (VPSC), ϑ ¯ c , (43), plus the result of trading in the EP-Market (44), plus the result of trading in the PQ-Market (45). A Net Purchase and Sell Scheme (NPSS) is followed here to calculate the amount of compensated energy. Under this arrangement, two uni-directional meters are installed: one records electricity drawn from the grid, and the other records excess electricity generated and fed back into the grid. Prosumers pay retail rate for the electricity they use, and the DSO purchases their excess generation at its avoided cost (wholesale rate), up to the amount of consumed energy, so that prosumers may have zero energy cost with respect to the utility, but no positive balance. By convention, costs have a negative sign, while revenues have a positive sign. In addition, and although it is not directly part of the operating result, a way of computing the value of the energy stored at the end of the operating period in the ESS of each house is necessary:
Φ B f i = B r i ( t f ) · λ i ( t f )
where t f is the final instant of the period of comparison and λ i ( t f ) is the private valuation of energy for house i in t = t f according to (6).

6.1.3. Comparative Indicators

The comparison is then made between the energy operation results of H c and those of H n s and H s . The following indicators can be computed to compare the operation performance of two sets of houses ( H a and H b ) (Energy Result Comparator, EP-Market Result Comparator, PQ-Market Result Comparator, Renewable Energy Use Comparator and Battery Usage Comparator) and are defined below:
Δ Φ ( T ) = Φ B f a Φ B f b + + h H a Φ h ( T ) Φ B f b Φ B f a + + h H b Φ h ( T ) 1
Δ R W u s e ( T ) = h H a R W h ( T ) h H R W h ( T ) 1
Δ B u s e ( T ) = h H a B h ( T ) h H b B h ( T ) 1

6.2. Tests and Results

Testing the effects of the MS-SMPC-based Strategy Advisor is a complicated task. First, because the number of optimisation variables grows very fast as the length of the prediction horizon is increased. In turn, the more optimisation variables the problem has, the number N S of different scenarios needed to reach a certain level of confidence also increases [27].
Additionally, since the experiments are basically agent-based simulations, it is difficult to guarantee common conditions for entities with/without (non-)stochastic Strategy Advisor. For each element h c H c , two identical reproductions are created, h n s H n s and h s H s . These three elements have exactly the same consumption and generation profiles, and in addition, the parameters of their respective agents are also identical, including those that drive price adaptation and private valuation determination. Therefore, the price evolution of bids and asks is the same for the three entities. What changes between them, and in fact is the origin of the performance variability, is the sequence of roles adopted in the market. Entities in H c adopt one or another role in an obtuse manner, without considering the plausible evolution of the market. In contrast, the objective of the Strategy Advisor is to steer the role selection and the temporal allocation of offered energy quantities so that the entity takes advantage of those hourly sessions with the highest expected revenue.
Each simulation covers a whole week of energy operation during the month of September. To check whether in the presence of uncertainty the stochastic strategy advisor is capable of obtaining better results than the one based on the nominal scenario, it is necessary to simulate prediction errors. For this, the agents are simulated using the real generation profile, while their forecast profile is randomly picked among the pool of daily generation profiles corresponding to the 30 days of September. Figure 4 shows the forecast and actual PhV power generation profiles for each week, in which it can be seen how both accurate and imprecise forecasting are artificially simulated.
Table 3, Table 4, Table 5, Table 6, Table 7, Table 8 and Table 9 show the results of the simulations for each of the addends that allow to compute the economic result derived from the energy operation (Equations (41) and (47)) of the three replicated sets.
Figure 5, Figure 6, Figure 7 and Figure 8 are the radar plots [28] of Weeks 1–4, where the different components of the economic result are displayed along with the total results, Φ ( T = 1 week ) , themselves.
Finally, Table 10 shows the comparative indicators with respect to the performance of the set of houses without SA ( H c )) for the set of houses with Nominal MPC-based SA ( H n s ) and for the set of houses with MS-SMPC-based SA ( H s ).

7. Discussion

This article proposes the simultaneous participation of energy traders in two energy markets which run in parallel while being executed simultaneously. The discrete EP-Market acts as a futures market, allowing traders to purchase/sell energy packages in advance of the occurrence of a forecast deficit. The continuous PQ-Market acts as a spot market, in which power quotas are negotiated to balance deficits and excesses instantly. To allow this simultaneous participation, a specifically designed EMS is required to allow the automation of the procedures for determining private valuation, price adaptation and role selection for each of the two markets. Entities with an excess of energy generation act as sellers, and have the option of either selling as much as they can as soon as possible (in the immediately following market moments) or offering the aforementioned excess at certain future market moments where the price obtained is historically more advantageous. They must also decide on the quantities to be offered in the discrete market, taking into account that the stock sold in the time-ahead market is no longer available for sale in the real-time market. On the other hand, entities that foresee having an energy deficit (those whose expected consumption is greater than their foreseen generation) have to decide whether to try to anticipating it by obtaining energy packages in the discrete market, which is generally more expensive but less volatile, or to risk trying to cancel their deficit in the continuous market of power quotas, which is generally cheaper but less liquid. In this sense, the proposed EMS can incorporate the strategy advice functionality, consisting on the determination of the optimal energy operation profile and encompasses the storage utilisation, the energy acquisition from the power grid and the interactions foreseen in the two eP2P markets. This article proposes a possible implementation of this Strategy Advisor, based on MPC, including two variants, one based on a single nominal scenario, and the other based on SMPC, which optimises contemplating multiple scenarios. Simulations carried out on the case study show that both variants offer an improvement in economic performance of between 10% and 30% compared to the case of not using a SA. Furthermore, the MS-SMPC-based variant generally performs slightly better than the nominal variant, as it contemplates more possible market price evolution profiles (derived from different PV generation scenarios), although to state this conclusively it would be necessary to make a deeper statistical analysis which is beyond the scope of this article. These savings are mainly achieved by buying less energy from the grid and replacing it with cheaper energy, either previously bought and stored or bought instantaneously; and by selling a greater portion of the surplus energy in market sessions where the price is higher. But it’s not all advantages. This improvement is also achieved through an intensification of the use of storage systems, which could lead to a reduction in their lifespan. The translation of depreciation costs into the calculation of energy operating costs is an open issue, both in terms of the selection of the usage level indicator and in terms of the monetisation of such usage.

Author Contributions

Conceptualization, P.B.-G., M.A.R. and C.B.; methodology, P.B.-G., M.A.R. and C.B.; software, P.B.-G. and F.G.-T.; validation, P.B.-G.; investigation, P.B.-G.; resources, P.B.-G.; data curation, P.B.-G.; writing–original draft preparation, P.B.-G.; writing–review and editing, F.G.-T., M.A.R. and C.B.; visualization, P.B.-G. and F.G.-T.; supervision, M.A.R. and C.B.; project administration, M.A.R. and C.B.; funding acquisition, M.A.R. and C.B. All authors have read and agreed to the published version of the manuscript.

Funding

The research leading to these results has received funding from the Spanish Ministry of Economy’s ‘Retos Investigación 2016’ Programme under the CONFIGURA Project (DPI2016-78338-R).

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
CDAContinuous Double Auction
DDADiscrete Double Auction
DERDistributed Energy Resources
DODDepth Of Discharge
DSODistribution System Operator
EMSEnergy Management System
EPEnergy Packages
ESSEnergy Storage System
P2PPeer-To-Peer (alt. Prosumer-To-Prosumer)
PCCPoint of Common Coupling
PQPower-Quotas
PVPhotovoltaic
SAStrategy Advisor
SMPCStochastic Model Predictive Controller

References

  1. Internacional Energy Agency. Renewables 2019; Yearly Forecast; Internacional Energy Agency: Paris, France, 2019. [Google Scholar]
  2. Trend:Research. Eigentümerstruktur: Erneuerbare Energien; Short Study 20-01174; Trend:Research: Bremen, Germany, 2017. [Google Scholar]
  3. Codagnone, C.; Martens, B. Scoping the Sharing Economy: Origins, Definitions, Impact and Regulatory Issues; SSRN Scholarly Paper ID 2783662; Social Science Research Network: Rochester, NY, USA, 2016. [Google Scholar]
  4. Baez-Gonzalez, P.; Rodriguez-Diaz, E.; Vasquez, J.C.; Guerrero, J.M. Peer-to-Peer Energy Market for Community Microgrids [Technology Leaders]. IEEE Electrif. Mag. 2018, 6, 102–107. [Google Scholar] [CrossRef]
  5. Shrestha, A.; Bishwokarma, R.; Chapagain, A.; Banjara, S.; Aryal, S.; Mali, B.; Thapa, R.; Bista, D.; Hayes, B.P.; Papadakis, A.; et al. Peer-to-Peer Energy Trading in Micro/Mini-Grids for Local Energy Communities: A Review and Case Study of Nepal. IEEE Access 2019, 7, 131911–131928. [Google Scholar] [CrossRef]
  6. Tushar, W.; Yuen, C.; Mohsenian-Rad, H.; Saha, T.; Poor, H.V.; Wood, K.L. Transforming Energy Networks via Peer-to-Peer Energy Trading: The Potential of Game-Theoretic Approaches. IEEE Signal Process. Mag. 2018, 35, 90–111. [Google Scholar] [CrossRef] [Green Version]
  7. Liu, T.; Tan, X.; Sun, B.; Wu, Y.; Tsang, D.H. Energy management of cooperative microgrids: A distributed optimization approach. Int. J. Electr. Power Energy Syst. 2018, 96, 335–346. [Google Scholar] [CrossRef]
  8. Sorin, E.; Bobo, L.; Pinson, P. Consensus-based approach to peer-to-peer electricity markets with product differentiation. arXiv 2018, arXiv:1804.03521. [Google Scholar] [CrossRef] [Green Version]
  9. Wang, F.; Yu, P.L.H.; Cheung, D.W. Combining technical trading rules using particle swarm optimization. Expert Syst. Appl. 2014, 41, 3016–3026. [Google Scholar] [CrossRef]
  10. Choi, J.H.; Ahn, H.; Han, I. Utility-based double auction mechanism using genetic algorithms. Expert Syst. Appl. 2008, 34, 150–158. [Google Scholar] [CrossRef]
  11. Azar, A.G.; Afsharchi, M.; Davoodi, M.; Bigham, B.S. A multi-objective market-driven framework for power matching in the smart grid. Eng. Appl. Artif. Intell. 2018, 70, 199–215. [Google Scholar] [CrossRef]
  12. Yue, J.; Hu, Z.; Anvari-Moghaddam, A.; Guerrero, J.M. A Multi-Market-Driven Approach to Energy Scheduling of Smart Microgrids in Distribution Networks. Sustainability 2019, 11, 301. [Google Scholar] [CrossRef] [Green Version]
  13. Abdella, J.; Shuaib, K. Peer to Peer Distributed Energy Trading in Smart Grids: A Survey. Energies 2018, 11, 1560. [Google Scholar] [CrossRef] [Green Version]
  14. Kuruseelan, S.; Vaithilingam, C. Peer-to-Peer Energy Trading of a Community Connected with an AC and DC Microgrid. Energies 2019, 12, 3709. [Google Scholar] [CrossRef] [Green Version]
  15. Pires Klein, L.; Krivoglazova, A.; Matos, L.; Landeck, J.; de Azevedo, M. A Novel Peer-To-Peer Energy Sharing Business Model for the Portuguese Energy Market. Energies 2019, 13, 125. [Google Scholar] [CrossRef] [Green Version]
  16. Paudel, A.; Beng, G.H. A Hierarchical Peer-to-Peer Energy Trading in Community Microgrid Distribution Systems. In Proceedings of the 2018 IEEE Power Energy Society General Meeting (PESGM), Portland, OR, USA, 5–9 August 2018; pp. 1–5. [Google Scholar]
  17. 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), Beijing, China, 26–28 November 2017; pp. 1–5. [Google Scholar] [CrossRef]
  18. Liu, W.; Qi, D.; Wen, F. Intraday Residential Demand Response Scheme Based on Peer-to-Peer Energy Trading. IEEE Trans. Ind. Inform. 2020, 16, 1823–1835. [Google Scholar] [CrossRef]
  19. Zhang, Z.; Li, R.; Li, F. A Novel Peer-to-Peer Local Electricity Market for Joint Trading of Energy and Uncertainty. IEEE Trans. Smart Grid 2020, 11, 1205–1215. [Google Scholar] [CrossRef]
  20. Baez-Gonzalez, P.; Rodriguez-Diaz, E.; Ridao Carlini, M.A.; Bordons, C. A Power P2P Market Framework to Boost Renewable Energy Exchanges in Local Microgrids. In Proceedings of the 2019 International Conference on Smart Energy Systems and Technologies (SEST), Porto, Portugal, 9–11 September 2019; pp. 1–6. [Google Scholar] [CrossRef]
  21. Friedman, D. The Double Auction Market: Institutions, Theories, And Evidence; Google-Books-ID: SUdaDwAAQBAJ; Routledge: Abingdon-on-Thames, UK, 2018. [Google Scholar]
  22. Defourny, B.; Ernst, D.; Wehenkel, L. Multistage Stochastic Programming: A Scenario Tree Based Approach to Planning under Uncertainty. In Decision Theory Models for Applications in Artificial Intelligence: Concepts and Solutions; IGI Global: Hershey, PA, USA, 2012; p. 51. [Google Scholar]
  23. Velarde Rueda, P.A. Stochastic Model Predictive Control for Robust Operation of Distribution Systems. Ph.D. Thesis, Universidad de Sevilla, Sevilla, Spain, 2017. [Google Scholar]
  24. Patrinos, P.; Trimboli, S.; Bemporad, A. Stochastic MPC for real-time market-based optimal power dispatch. In Proceedings of the 2011 50th IEEE Conference on Decision and Control and European Control Conference, Orlando, FL, USA, 12–15 December 2011; pp. 7111–7116. [Google Scholar] [CrossRef]
  25. Puglia, L.; Bernardini, D.; Bemporad, A. A multi-stage stochastic optimization approach to optimal bidding on energy markets. In Proceedings of the 2011 50th IEEE Conference on Decision and Control and European Control Conference, Orlando, FL, USA, 12–15 December 2011; pp. 1509–1514. [Google Scholar] [CrossRef]
  26. Palacios-Garcia, E.; Moreno-Munoz, A.; Santiago, I.; Flores-Arias, J.; Bellido-Outeirino, F.; Moreno-Garcia, I. A stochastic modelling and simulation approach to heating and cooling electricity consumption in the residential sector. Energy 2018, 144, 1080–1091. [Google Scholar] [CrossRef]
  27. Giulioni, L. Stochastic Model Predictive Control with Application to Distributed Control Systems. Ph.D. Thesis, Politecnico di Milano, Milano, Italy, 2015. [Google Scholar]
  28. Martinez-Cagigal, V. Polygonal Plot. MATLAB Central File Exchange. 2020. Available online: https://www.mathworks.com/company/aboutus/contact_us.html?s_tid=hp_ff_a_contact (accessed on 19 February 2020).
Sample Availability: The code of the MATLAB classes and scripts, along with comprehensive simulation results, are available from the authors.
Figure 1. Structure of the proposed EMS, allowing the energy entity to participate simultaneously in two eP2P markets, one discrete in which packages are exchanged and another continuous in which power quotas are negotiated.
Figure 1. Structure of the proposed EMS, allowing the energy entity to participate simultaneously in two eP2P markets, one discrete in which packages are exchanged and another continuous in which power quotas are negotiated.
Energies 13 03751 g001
Figure 2. Building the probabilistic model for the discrete time energy packages market, based on the history of offers made and their respective results in the market.
Figure 2. Building the probabilistic model for the discrete time energy packages market, based on the history of offers made and their respective results in the market.
Energies 13 03751 g002
Figure 3. Scenarios for the MS-SMPC are the prices and liquidity profiles for 30 simulated days of the same month under comparison (September in this case).
Figure 3. Scenarios for the MS-SMPC are the prices and liquidity profiles for 30 simulated days of the same month under comparison (September in this case).
Energies 13 03751 g003
Figure 4. Forecast vs. actual PhV power generation profiles for each week.
Figure 4. Forecast vs. actual PhV power generation profiles for each week.
Energies 13 03751 g004
Figure 5. Energy operation economic result for Week 1. The radar plot shows the aggregate economic result ( Φ ) and its components, namely, the monetary amounts corresponding to expenses for energy imported from the utility ( Φ u t i l ), revenue obtained from compensation for energy fed into the grid ( Φ c ), result from trading in the EP market ( Φ E P ) and in the PQ market ( Φ P Q ) and the valuation of the final battery energy content ( Φ B f ) .
Figure 5. Energy operation economic result for Week 1. The radar plot shows the aggregate economic result ( Φ ) and its components, namely, the monetary amounts corresponding to expenses for energy imported from the utility ( Φ u t i l ), revenue obtained from compensation for energy fed into the grid ( Φ c ), result from trading in the EP market ( Φ E P ) and in the PQ market ( Φ P Q ) and the valuation of the final battery energy content ( Φ B f ) .
Energies 13 03751 g005
Figure 6. Energy operation economic result for Week 2.
Figure 6. Energy operation economic result for Week 2.
Energies 13 03751 g006
Figure 7. Energy operation economic result for Week 3.
Figure 7. Energy operation economic result for Week 3.
Energies 13 03751 g007
Figure 8. Energy operation economic result for Week 4.
Figure 8. Energy operation economic result for Week 4.
Energies 13 03751 g008
Table 1. Summary of private valuation of power (energy).
Table 1. Summary of private valuation of power (energy).
PQ-MarketEP-Market
Buyer λ p b ( t ) = ϑ ( t ) λ p b ( t ) = λ e ( t )
Seller λ p s ( t ) = 0.35 · ϑ ( t ) λ e s ( t ) = λ e ( t ) · ( 1 E S ( t ) ) + ϱ · λ e ( t ) · E S ( t )
Table 2. Main parameters of integrated markets.
Table 2. Main parameters of integrated markets.
PQ-MarketEP-Market
TypeCDADDA
Δ T 1 min a60 min
q min 0.1 (kWmin)0.25 (kWh)
q max 3.3 (kWmin)1 (kWh)
a Equal to the temporal resolution of the energy operation simulation, thus mimicking a continuous market.
Table 3. Summary of energy interactions with the utility (purchased energy).
Table 3. Summary of energy interactions with the utility (purchased energy).
Utility Import Interactions
September E util (kWh) Φ util (€) ϑ ¯ util (c€/kWh)
H c H ns H s H c H ns H s H c H ns H s
Week 1329.42296.49286.05−38.9−35.59−34.54−11.81−12−12.07
Week 2372.57342.33321.58−42.75−39.78−37.29−11.47−11.62−11.6
Week 3320.12256.58253.01−36.16−28.86−28.23−11.29−11.25−11.15
Week 4355.48325.24322.88−41.1−38.18−38.04−11.56−11.74−11.78
Table 4. Summary of energy interactions with the utility (compensated energy).
Table 4. Summary of energy interactions with the utility (compensated energy).
Utility Export Interactions
September E c (kWh) Φ c (€)
H c H ns H s H c H ns H s
Week 121.9745.7950.171.102.292.51
Week 213.5639.7642.260.691.992.11
Week 322.1534.4230.211.111.721.51
Week 433.2549.4450.281.662.472.51
Table 5. P2P energy-package market buying interactions.
Table 5. P2P energy-package market buying interactions.
P2P EP-Market Buying Interactions
September E ep b (kWh) Φ ep b (€) ϑ ¯ ep b (c€/kWh)
H c H ns H s H c H ns H s H c H ns H s
Week 179.4590.2599.59−9.07−10.22−11.27−11.42−11.33−11.32
Week 278.5573.0581.47−9−8.33−9.3−11.46−11.4−11.42
Week 378.6578.789.56−9.13−9.05−10.35−11.61−11.5−11.56
Week 473.182.0884.57−8.05−8.35−8.67−11.01−10.18−10.25
Table 6. P2P energy-package market selling interactions.
Table 6. P2P energy-package market selling interactions.
P2P EP-Market Selling Interactions
September E ep s (kWh) Φ ep s (€) ϑ ¯ ep s (c€/kWh)
H c H ns H s H c H ns H s H c H ns H s
Week 1150.27176.28176.3517.1620.4520.4711.4111.6011.61
Week 2127.79152.77148.4914.7217.8917.4111.5111.7111.72
Week 3157.37173.89172.5618.1918.1920.2211.5611.7111.72
Week 4118.34135.33141.5913.0515.0115.6911.0311.0911.08
Table 7. P2P power quota market interactions.
Table 7. P2P power quota market interactions.
P2P PQ-Market Buying Interactions
September E pq b (kWh) Φ pq b (€) ϑ ¯ pq b (c€/kWh)
H c H ns H s H c H ns H s H c H ns H s
Week 1146.6189.4792.9−7.26−4.24−4.21−4.95−4.74−4.54
Week 2135.2487.4998.88−7.36−4.10−4.74−5.44−4.69−4.79
Week 3129.7899.3890.35−6.33−4.50−4.03−4.88−4.53−4.46
Week 4123.7475.1476.72−6.18−3.49−3.46−4.99−4.65−4.52
Table 8. P2P power-quota market selling interactions.
Table 8. P2P power-quota market selling interactions.
P2P PQ-Market Interactions
September E pq s (kWh) Φ pq s (€) ϑ ¯ pq s (c€/kWh)
H c H ns H s H c H ns H s H c H ns H s
Week 1301.58153.05152.4914.137.617.794.694.975.11
Week 2264.98114.24112.7112.826.456.064.845.655.38
Week 3283.68139.70140.3113.107.226.944.625.174.95
Week 4235.54115.71115.5910.495.575.914.454.815.11
Table 9. Valuation of final stock of stored energy.
Table 9. Valuation of final stock of stored energy.
Valuation of Final Storage
September B f (kWh) Φ B f (€)
H c H ns H s H c H ns H s
Week 122.6622.1221.652.732.652.59
Week 231.0325.5526.723.763.083.24
Week 324.8527.4526.612.873.193.10
Week 426.7725.3725.153.102.962.94
Table 10. Comparative indicators.
Table 10. Comparative indicators.
September Δ Φ cost (%) Δ RW use (%) Δ B use (%) Γ RW (%)
H ns H s H ns H s H ns H s H ns H s
Week 1−13.46−15.19−3.05−2.89+59.89+61.4696.9597.11
Week 2−14.33−15.22−3.47−3.66+66.53+69.3696.5396.34
Week 3−33.46−28.62−2.76−3.37+64.87+68.5297.2496.63
Week 4−10.04−12.99−2.72−1.71+55.74+57.9797.2898.29

Share and Cite

MDPI and ACS Style

Baez-Gonzalez, P.; Garcia-Torres, F.; Ridao, M.A.; Bordons, C. A Stochastic MPC Based Energy Management System for Simultaneous Participation in Continuous and Discrete Prosumer-to-Prosumer Energy Markets. Energies 2020, 13, 3751. https://doi.org/10.3390/en13143751

AMA Style

Baez-Gonzalez P, Garcia-Torres F, Ridao MA, Bordons C. A Stochastic MPC Based Energy Management System for Simultaneous Participation in Continuous and Discrete Prosumer-to-Prosumer Energy Markets. Energies. 2020; 13(14):3751. https://doi.org/10.3390/en13143751

Chicago/Turabian Style

Baez-Gonzalez, Pablo, Felix Garcia-Torres, Miguel A. Ridao, and Carlos Bordons. 2020. "A Stochastic MPC Based Energy Management System for Simultaneous Participation in Continuous and Discrete Prosumer-to-Prosumer Energy Markets" Energies 13, no. 14: 3751. https://doi.org/10.3390/en13143751

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