A coordination mechanism for reducing price spikes in distribution grids

: Recently, given the increased integration of renewables and growing uncertainty in demand, the wholesale market price has become highly volatile. Energy communities connected to the main electricity grid may be exposed to this increasing price volatility. Additionally, they may also be exposed to local network congestions, resulting in price spikes. Motivated by this problem, in this paper, we present a coordination mechanism between entities at the distribution grid to reduce price volatility. The mechanism relies on the concept of duality theory in mathematical programming through which explicit constraints can be imposed on the local electricity price. Constraining the dual variable related to price enables the quantiﬁcation of the demand-side ﬂexibility required to guarantee a certain price limit. We illustrate our approach with a case study of a congested distribution grid and an energy storage system as the source of the required demand-side ﬂexibility. Through detailed simulations, we determine the optimal size and operation of the storage system required to constrain prices. An economic evaluation of the case study shows that the business case for providing the contracted ﬂexibility with the storage system depends strongly on the chosen price limit.


Introduction
Energy communities are a group of consumers that organize themselves to achieve certain objectives. Recently, the topic has received significant attention with the focus of the literature being on techno-economic analysis and institutional arrangements; see, e.g., [1,2]. These communities are characterized by the significant presence of distributed energy resources such as solar, wind, or storage, in addition to demand response, and they can scale from a few households to cities. The objectives that a community may strive for include the reduction of energy costs, the reduction of carbon emissions, or enhancing sustainability [3]. As these community based organizations provide a way for consumers to achieve goals that are important for them, they are also referred to as being "consumer-centric" [4]. Another important driver for a community is that of self-sufficiency. Complete self-sufficiency, however, is rarely achievable, and a connection to the main grid would be needed in many cases. This means that such a community would still be exposed to possibly volatile wholesale By providing flexibility services, the aggregator is able to support increased integration of intermittent renewables and reduce energy costs. In [28], while the coordination mechanism proposed centered on the aggregator as a facilitator of the local market, the market activities considered did not take into account system operator constraints, nor did they account for the reduction of price volatility in the market. An alternate coordination mechanism for demand-side flexibility provision was proposed in [29]. This flexibility market was operated by the DSO and was aimed at solving distribution grid congestions. In such a market, after the day-ahead market was cleared, the DSO could avail flexibility from the aggregator for addressing any possible grid violations that were detected. Additionally, the work in [30] built on [29] by accounting for demand uncertainty and enabled the DSO to reserve flexibility in real-time markets to deal with grid contingencies. Thus, previously reviewed coordination mechanisms either focused on business opportunities for the aggregator in local flexibility markets or for availing flexibility services by system operators for addressing grid issues, but not explicitly for the reduction of price volatility or mitigation of price spikes. This paper therefore addresses the aforementioned knowledge gap by proposing a mechanism that enables communities to set an upper price limit and to procure the necessary flexibility to achieve this, while considering grid limits.
In this paper, the process of taking actions in the current time instance to prevent consumers from paying higher than a certain price limit for electricity in the day ahead market is called hedging. Hedging in electricity markets has traditionally been done using forward contracts or financial transmission rights [31]. However, in decentralized electricity markets with a higher participation of variable distributed energy resources, there is an increased risk of high price volatility. To address this, there is a pressing need for more dynamic mechanisms to deal with price hedging. In relation to price hedging, the work in [32] investigated the possibility of using distribution grid hedging rights as a financial tool to reduce price volatility. Through the proposed hedging rights, market participants such as aggregators that are exposed to price spikes due to grid congestions can use this tool to mitigate the adverse effects of high prices, thereby maintaining their competitiveness in local electricity markets. Similarly, the work of [33] investigated the possibility for hedging in day-ahead markets using flexible resources and performed a comparative analysis between forward contracts, call options, and incentivizing consumers for flexibility provision. However, previous works did not consider the aspect of price constraints in the hedging formulation, thereby being unable to restrain directly the price in the market to specific levels.
The hedging approach that we present in this paper is based on optimization duality theory through which an explicit constraint can be imposed on price in the day-ahead market. This results in the ability of consumers to specify a maximum willingness to pay for electricity, which sets the foundation for the price limit. Constraining of price below a specific value is contingent on the availability of demand-side flexibility, and in our current work, this is provided from an energy storage system operated by an aggregator. Therefore, we propose a mechanism in which physical components (such as energy storage systems) have to be engaged in price hedging, leading to the concept of physical hedging as opposed to purely financial hedging. Thus, the main contribution of our work is that we reduce price volatility at the community level using optimization duality theory to constrain prices to a contractually agreed price limit. This price limit is the outcome of a contractual agreement between an energy community and an aggregator, and we illustrate the required information and monetary flow for facilitating this mechanism. Additionally, in this coordination mechanism, to constrain price successfully, the optimal size of the storage needs to be determined, for which our work generates insights.
Preliminary results about this hedging mechanism were reported in [34][35][36]. The work presented in these papers established the mathematical formulation of physical hedging and explored a few conditions for its implementation, such as probabilistic formulation in the presence of uncertain renewable generation sources and the impact of grid constraints on the effectiveness of the hedging strategy. In contrast, in this paper, we show a comprehensive study on the price hedging strategy of an energy storage system owner who seeks to operate its assets for both price constraining and energy arbitrage. We report on the economic viability of such a strategy, including investment analysis under different contractual price limit scenarios. It must be noted that this paper assumes completely deterministic information forecasts, and the aspect of uncertainty analysis is beyond the scope of this work. However, to account for probabilistic forecasts, the work presented can be adapted using the methods specified in [37,38].
The rest of this paper is organized in the following manner: Section 2 introduces the theoretical background for the work presented. The case study that we investigate is presented in Section 3. For the simulation of our case study, we consider a hypothetical medium voltage (MV) distribution grid, and the data used are comprised of wholesale market price, solar irradiation, and emulated residential demand data for the Netherlands for the year 2017. In Section 4, we analyze the results from our simulations. Finally, conclusions are drawn from our investigation, and recommendations are made for future research themes.

Theoretical Background
In this section, we present the theoretical basis of our proposed coordination mechanism. This mechanism is based on duality theory, which is a part of mathematical optimization that plays a fundamental role in electricity markets [39]. The dual variable corresponding to supply demand matching is the marginal price of electricity. In the presented formulation, duality theory is used for adding an explicit constraint on this price. The addition of this constraint enables the quantification of the required power for constraining price to a specified price limit. In this paper, we refer to the provision of this additional power as the flexibility required for constraining price, for the given time interval in a market setting.

Capping Electricity Prices with Flexible Resources
To illustrate our formulation, we first consider the example of economic dispatch with two generators. This problem can be written as: The generators P G 1 and P G 2 have to supply a load P L . These generators have marginal costs a 1 and a 2 , and their generation limits are P G 1 and P G 2 . Associated with the load balance and generator limit constraints are their respective Lagrange multipliers λ, µ 1 , and µ 2 , which are denoted after a (:) symbol. The value of λ at the optimal solution of Equation (1) is known as the system marginal price. In the case with multiple nodes and network constraints, the Lagrange multiplier corresponding to the respective nodal power balance is called the locational marginal price (LMP), and it represents the cost of supplying an additional unit of power to that location. With the objective of applying explicit constraints on price, we first derive the dual formulation of Equation (1), which reads as follows: In the dual formulation, the critical step is to introduce an additional constraint. This constraint constrains the electricity price to a desired value of λ * . Assuming that Slater's condition holds and because the primal problem expressed in Equation (1) is convex, strong duality will hold between primal and dual problems [40]. Hence, the addition of a constraint to the dual problem is associated with adding a new variable in the primal problem. This variable is labeled as P F , with the subscript F denoting flexibility. The new dual and corresponding primal are then: and: Inclusion of this new term P F in Equation (4) can be interpreted as the introduction of a new flexible generation resource operating with a marginal cost of λ * and having infinite capacity. The optimal value P * F represents the amount of power needed to cap the price of the system at λ * .

Capping the Electricity Price in a More General Case
The formulation presented in Section 2.1 can be readily extended to a more general case with multiple nodes, generators, and time-periods. To do so, we first consider the generalized economic dispatch optimal power flow formulation, which is expressed as: subject to: The formulation in Equation (5) seeks to minimize the difference between the cost of generation a i P G i and load utility b i P L i . Power balance at each node in this network is represented through Equation (5a). The set N represents the set of all nodes in the power system. Additionally, in Equation (5), sets Ω i and Ω ij represent the neighbors of node i and all the lines in the network, respectively. The bus reference angle at the slack bus is defined as specified in Equation (5b). Finally, constraints pertaining to line limits, generator bounds, and load limits are expressed through Equations (5c), (5d), and (5e), respectively. It must be noted that in our work, we use the linear dc-opf method for modeling the power flow at the distribution grid. This is because our work focuses on medium voltage networks that are much more conductive than resistive. Furthermore, the linear nature of the power flow formulation enables us to readily implement price constraining in these networks, as well as other networks such as the transmission grid. To extend our proposed approach to low voltage networks that are more resistive, linearized power flow approaches as that specified in [41] can be coupled with our formulation.
In a subset of the nodes specified in Equation (5), using flexible power, it is possible to cap the nodal price to a specified level of λ * i . To apply this price constraint, we first derive the generalized dual formulation, which is expressed as: subject to: The subsequent modified general primal formulation for price constraining is expressed in Equation (7). In Equation (7), for nodes where no price cap is applicable, the value of λ * i can be assumed to be infinity, thereby enabling the general formulation to hold. The formulation reads as follows: subject to: By solving Equation (7), a system operator can determine the amount of flexibility P * F i [t] needed to cap the price at node i to the desired value of λ * i . Note that this formulation is completely technology-neutral with respect to the flexible source P F . Only a time-varying production P * F i [t] is required, which can be provided by any source of generation. Alternatively, if power consumption at a given instance can be temporarily reduced by a magnitude of P * F i [t] with reference to a previously estimated demand profile, in the presence of variable price, then demand response can also be considered as a potential source of flexibility for constraining price.

Organizational Structure for Flexibility Provision
To provide the flexibility required for constraining price, we need to determine the information and money flow between the actors. A full specification of all roles and responsibilities that would define such an arrangement is beyond the scope of this paper. Hence, we highlight a few key aspects only. It should be noted that the formulation presented so far is general, and we introduce a new organizational structure that can also be implemented for an entire national system or a transmission system operator (TSO)/independent system operator (ISO) area. In this work, we make a deliberate choice to focus on smaller systems that are embedded at the distribution grid. The DSO in such markets is expected to assume additional responsibilities including being a regulated market operator [42]. Thus, the DSO would be the only entity having information about the grid structure and market bids for supply and demand that are needed to solve the market clearing problem formulated in Equation (7).
In the case study that we investigate in Section 3, we consider an aggregator as the owner and operator of an energy storage system through which flexibility required for constraining price is provided. The reason for choosing an aggregator is that they have technical expertise and professional communication technologies for operating community level storage. Furthermore, we make an assumption that the aggregator behaves perfectly competitively and does not abuse market power. This is a common assumption for neo-classical economics, and while being an optimistic assumption, it leads to a perfect market outcome.
Through Figure 1, we illustrate the information flow for facilitating the proposed coordination mechanism. The point of initiation of this coordination mechanism is the determination of the price limit λ * i , which is an essential parameter. This is determined in Step I as presented in Figure 1 and involves a negotiation between the energy community and aggregator. The contract details could include fixed or variable payments by the community to the aggregator. Once the price limit λ * i is established, it is shared with the DSO. In Step II, the DSO can include this contracted flexibility in the market clearing by solving Equation (7). This would result in an allocation of the generation and demand, but also the required P * F i [t]. The computed volume of required flexible power is then broadcast to the aggregator, who is then contractually obligated to deliver this in real-time. Determination of the optimal storage profile for satisfying the required flexibility is computed in Step III where the DSO and aggregator cooperate for dispatching the storage, thereby ensuring that grid contingencies are mitigated. Once the aggregator provides the required flexibility, it is remunerated for its services by the energy community. Additionally, at intervals when the aggregator is not required to deliver flexible power, it can partake in energy arbitrage to further increase its revenue. In the next section, we will elaborate further on the case study considered for the implementation of our proposed mechanism.

Case Study
Section 2 provided the mathematical foundation for constraining price to a certain price limit and for quantifying the flexible power required to achieve it. Additionally, we elaborated on an organizational structure that captured the information flow between actors for the coordination of this flexible power. In this section, we build on these fundamental blocks and apply the proposed mechanism to a case study that focuses on a community of residential consumers who have photovoltaic (PV) arrays integrated with their households and are exposed to high price volatility and price spikes during periods of grid congestion. It must be mentioned that the exact ownership structure and optimal sizing of the PV arrays is out of the scope of our current analysis and will be considered in future work. An energy storage system can be considered as the source of flexibility to reduce price volatility by constraining price to a certain limit. Hence, consumers in this community may decide to buy an energy storage unit collectively to use it during periods of high prices. In principle, these consumers can simply discharge the storage at times of high prices and recharge it when the prices are low. Alternatively, there could be another party that invests in and operates a storage system separately. For such a commercial party, it could be beneficial to discharge during times of congestion as long as it does not resolve the congestion completely (which would reduce the price it gets for its delivered energy). This can be seen as a form of exercising of market power, but it is rational for the storage operator in order to maximize their revenue. The community could make an agreement with the aggregator to pay a fixed yearly fee per unit of energy (e/MWh) to ensure that the price does not exceed a certain price limit λ * . Thus, in the day-ahead market, the aggregator would discharge the storage when the local price in the community would exceed the agreed on price limit.

Determining the Volume of Required Flexibility
Equation (7) describes the general case of determining the flexibility to cap prices in a multi-node system. For the purpose of our case study, we considered a single node system. In Figure 2, we present our case study that considered a system setup where an energy community was connected to a larger network. To model the price spikes as a result of congestion, we assumed that the load in our distribution network was elastic, with the following quadratic expression describing its utility B: In Equation (8), the utility function is described for an hourly period. The variable b is the marginal utility and is described as a linearly decreasing function of demand, as shown in Figure 3. Furthermore, this marginal utility is comprised of a relationship between the inelastic load L, elastic load P L , and a coefficient of demand elasticity β. Power can be supplied to the community from the main grid. Alternatively, power supply to the community can be provided through solar generation. Previously, the formulation presented in Equation (7) did not account for power flowing from the distribution grid to the main grid. In this network, we considered the excess of solar power generation to be sold back to the main grid. The flexibility required for capping the local price in the day-ahead market (operating at hourly intervals) experienced by the energy community can be computed as: (9) subject to: The variable a G represents the cost (in e/MWh) of supplying power from the main grid to the energy community and of supplying the excessive power from the community to the larger network. This value is obtained from the wholesale market price. At a given instance, power can either be imported to (P I ) or exported from (P E ) the energy community. To ensure that the variables P I and P E are not simultaneously active, a nominal difference is introduced in the cost terms associated with the two power variables. Equation (9a) presents the power balance equation where P S and P F represent the solar generation and flexibility required to constrain the price to the value of λ * , respectively. The solar power is provided at zero marginal cost. At intervals when the market prices are higher than the value of the contractual price limit λ * , the power provision from the energy community to the larger network is set to zero using the constraint (9b). The amount of power that can be supplied from the main grid and power that can be supplied to the main grid are limited by the line capacity and is expressed by P G . The DSO in its capacity as a regulated market facilitator [42] would have the information about generator and demand bids and the network structure, thereby enabling it to execute the formulation expressed in Equation (9) to determine the flexibility that the aggregator would need to supply.

Battery Storage as a Flexible Generation Source
The equations presented in Section 2 are general for any type of flexibility. In our case study, the focus is on energy storage as a demand-side flexible resource. To model the storage system, we will introduce additional essential constraints that enrich the formulation as expressed in Equation (7).

Optimal Storage Size
An energy storage system through charging and discharging can provide the flexibility required to constrain the marginal prices. By executing Equation (9), the time series of the required flexibility P F [t] is determined. An aggregator in order to make an investment decision about the storage capacity would need forecasts about the required flexibility. Then, in order to determine the minimum storage capacity needed by the aggregator to satisfy the time varying signal P F [t], the following optimization problem would need to be executed: subject to: By executing Equation (10), the optimal energy storage system (ESS) size is determined. In Equation (10), the variable d represents the annualized per unit cost of the storage expressed in e/MWh-year, and E SS is the size of storage. The reason for annualizing the costs of storage is to enable a business feasibility analysis on the basis of comparing investment costs against the yearly operational revenue. Equation (10a) expresses the inter-temporal constraint associated with the operation of the storage system. The variables E[t] represents the state of charge, while variables P dis [t] and P ch [t] are the respective variables associated with the discharging and charging of the storage. Equation (10b) is the constraint required for satisfying the required flexibility by discharging the storage. The operation of the storage is governed by its physical characteristics, and the amount of energy charged and discharged from the storage at any instance should not exceed the physical size of the inverter, which is defined as a function of the storage size and a charging/discharging time constant τ expressed in hours. Note that it is possible that if the storage is inadequately sized, simultaneous charging and discharging of the storage may occur. In order to account for this anomaly, a soft penalty can be introduced in the objective function by adding the expression ρ P dis [t].P ch [t] where ρ is a penalty factor expressed in terms of e/MWh 2 [43].

Providing Flexibility with an Energy Storage System
In the day-to-day operation of the storage, the storage capacity can be reserved to provide the flexible power required for capping the price to the contractual price limit (i.e., provide P F [t]). Thus, whenever the price exceeds the price limit, it would be capped, thereby enabling the price hedging functionality. The operation of the storage can be modeled using the following optimization problem: subject to: Equation (11) determines the optimal storage charging and discharging profile for satisfying the requested flexibility. Constraint (11b) enforces that the storage discharge provides the required flexibility. It should be noted that the optimization problem specified is in essence a centralized economic dispatch problem. It represents the most efficient outcome that would emerge in a perfectly functioning local market. The solution provides the cost-optimal schedule of charging the energy storage system that still meets the obligations to deliver the contracted flexibility P F [t].
As an artifact of our problem description, the price term a G (t), is updated to reflect the constrained price λ, obtained by executing Equation (9). These prices are such that whenever the cost of electricity in the market would exceed the contractual price limit (λ * ) specified by the community, the prices would be constrained. Equation (11a) reflects the power balancing performed at the community inclusive of the storage charging and discharging. Similar to Equation (9), the amount of power that can be provided to the community from the main grid or vice versa is restricted by the line capacities. Equations (11c)-(11f) represent the operation of the storage system as a flexible resource governed by its physical properties. The size of the storage E SS is computed from Equation (10). Simultaneity may arise in the presented formulation such that mutually exclusive variables of P dis and P ch may be non-zero. This can be accounted for by adding a soft constraint of the form ρ(P dis [t].P ch [t]) to the objective function. Finally, given the close interaction between the power flow and storage operation, this step is executed jointly by the DSO and aggregator, thereby mitigating additional grid contingencies.

Flexibility and Arbitrage With an Energy Storage System
The problem formulation in the previous subsection ensures that the energy storage system always delivers the contracted flexibility. However, it may be economically overly conservative, since there could be additional opportunities to perform energy arbitrage, i.e., to charge and discharge the storage based on price differences over time, while still meeting the obligations of P F [t] when needed. In order to account for this, we only have to change Constraint (11b) into the following: This means that the storage is left free to perform additional charging and discharging cycles as long as it delivers P F [t] when needed, i.e., when it is greater than zero.

Arbitrage Only with an Energy Storage System
As a useful comparison case, we also present results of a case where the storage is only used for arbitrage. This setup is exactly as described by Equation (11), but without Constraint (11b). In this case, the storage will be used to minimize the costs in the distribution grid, thereby flattening the price. However, as there is no notion of a price limit, the subsequent flexibility quantification will not be computed, thereby making the formulation incapable of guaranteeing that price does not exceed the community-specified limit.

Economic Evaluation
In this subsection, we shift our focus towards the economic analysis of our proposed formulation. The basis of this analysis is the contractual arrangement made between the energy community and the aggregator. By controlling the energy storage, the aggregator provides the required flexibility for constraining the price experienced by the consumers. For the provision of this flexibility, the energy community is contractually bound to provide remuneration to the aggregator. We make a distinction between the income, costs, and operating revenue for the purpose of our analysis. Income refers to the positive cash in-flow for the aggregator, while costs pertain to the cash out-flow that the aggregator incurs for charging the storage. Finally, operational revenue is the term used to denote the net value computed by taking the difference between the income earned and costs incurred by the aggregator.
Without the consideration of a premium, the aggregator income from hedging alone, i.e., the provision of flexibility to constrain price, is expressed through Equation (13) as: where T F denotes the time-steps in which P F [t] > 0, i.e., in which flexibility was provided (Since energy is priced in e/MWh, Equation (13) is dimensionally not correct, and we should multiply by the simulation time-step. Since we used a simulation time-step of one hour, we omit if for brevity).
The variable λ denotes the constrained marginal price.
For maintaining a sufficient state of charge and for satisfying the flexibility requests over multiple time periods, the aggregator would need to charge the storage, for which it would incur an operational expenditure (OPEX). The corresponding OPEX is thus: where T F denotes the time-steps in which the storage charges in order to be able to satisfy the flexibility requests during the periods defined by T F . Hence, the net revenue earned by the aggregator from hedging is represented as: Additionally, the aggregator can earn revenue from arbitrage. The net revenue from arbitrage is defined as: For computing the total operating revenue for the aggregator, we compute: To participate in the price constraining and arbitrage, a decision needs to be made regarding investing in assets, particularly the storage system. The annualized capital expenditure (CAPEX) for this is investment is given by: where D denotes the total capital cost per MWh and A f denotes the annuity factor: where T L is the lifetime of the storage andr is the interest rate.
In the case when R tot > C, a net positive business potential for the given contractual agreement can be realized by the aggregator.

Simulations and Results
Through quantitative analysis, we illustrate how the formulation presented in Section 3 facilitates the computation of the required flexibility for reducing the impacts of price volatility and price spikes. In this section, we first introduce the data used for the simulation followed by the analysis of the results.

Simulation Setup
We performed numerical simulations to illustrate the case study. To the extent possible, we used realistic data of demand, wholesale prices, solar generation, and storage costs. These data are elaborated later in this section. The value of the variable a G was based on the wholesale market data for the year 2017, which was obtained from the Amsterdam Power Exchange [44]. High price volatility was observed for this year with the prices varying as much as ±e60/MWh between two consecutive hours in the day-ahead market. The power output of the photovoltaic (PV) systems depends on the solar irradiance of the given region. These irradiance values are converted into solar generation values (in MW) through the following formulation: where P S [t] is then taken as the average for the entire hour. From Equation (20), it is clear that the solar power generation depends on the area that solar panels cover (A), the solar panel efficiency (r), and the performance ratio (P R ) that accounts for losses. For the purpose of our simulation, we set the value as (A = 25,000 m 2 ), r = 35%, and P R = 0.75. The hourly averaged irradiance values H[t] (converted to MW/m 2 ) were obtained from the Dutch meteorological institute Koninklijk Nederlands Meteorologisch Instituut (KNMI) [45].
In the case study, we focused on an energy storage system to provide the contracted flexibility. After reviewing the different storage options presented in [46], zinc bromide energy storage was selected due to its economic viability. The cost of this storage system was annualized to represent a yearly investment decision. Using a total capital cost (TCC) of e170/kWh, a lifetime of 20 years from [46], and a near-zero interest rate, the annualized cost of storage as given by Equation (19) amounted to d = e8500/MWh-year. This storage was assumed to have an efficiency η = 95%, and a time constant of τ = 2 h was used as an estimation of the converter size. Finally, to ensure that simultaneous charging and discharging of the storage did not occur, a penalty factor of ρ = e1000/MWh 2 was introduced.
The demand data used for our simulation were obtained from [47]. These data emulated the load profiles for 5000 residential consumers for the Netherlands and were characteristic of medium voltage (MV) distribution grids. It was assumed that the loads were tuned to maximize their utility as expressed in Equation (8). In Equation (8), the coefficient β = e1000/MW 2 h. As previously mentioned, power could be supplied to this energy community either from the main grid with the line capacity as 2 MW or from solar generation by the PV arrays. Essential to our proposed formulation was the presence of a contractually agreed price, and in the simulation of our case study, this value was set to λ * = e50/MWh. This value was assumed to be constant for the entire year. For simulating the case study, we used the IPOPT solver through the Pyomo package [48] provided in Python 3.7.

Simulation Results
Using the simulation setup described in Section 4.1, we executed the formulation presented in Section 3. The efficacy of the proposed coordination mechanism was illustrated by comparing a scenario in which there was no flexibility to a scenario in which flexibility was provided from an energy storage system. This section is concluded by performing an economic analysis that investigates the optimal storage size, the cost of storage investment, and the operational revenue earned by the aggregator assuming different contractual price limits. The aim of this analysis was to determine which price limits would result in feasible business cases.

Reference Case
In the reference situation, there was no flexibility in the distribution grid. Due to varying wholesale prices and local congestion, there was a certain level of price volatility. Figure 4a,b represents the price values and generation and load profiles for a typical week, respectively. Price in this scenario exceeded the indicated limit of e50/MWh either because the wholesale price exceeded this level or because of the grid capacity of 2 MW was reached. In Figure 4c, the price duration curve is presented, which illustrates the price experienced by the energy community, organized in descending order of magnitude. As can be observed, the price rise could be as high as e300/MWh, and this high price could be experienced for a considerable duration of time. Furthermore, prices in the price duration curve are higher than the example price limit of e50/MWh for approximately 1500 h. For a few hours during the year, the demand could be satisfied completely by solar power. This caused the marginal price of power to be e0/MWh.  Figure 4d presents the generation and demand profiles for the year and is illustrated through a load duration curve. A load duration curve depicts the relationship between demand and supply in a descending order of demand. In this figure, power can be supplied from solar power (yellow) or can be imported from the main grid (blue) to satisfy the demand (black). Alternatively, an excess of solar power generation can be exported (orange) to the main grid and is represented using a negative sign. As the generation of solar energy depends on the magnitude of solar irradiance, which is variable, the demand might not always be satisfied through solar alone. From the load duration curve, it was observed that solar generation was mostly available during the mid-load hours, i.e., between 1.0 MW and 1.5 MW. In the event that no solar power was available, the demand would need to be satisfied by importing power from the main grid, which in turn was constrained by the line limit. However, for majority of the hours, the power import from the main grid and solar power would combine to satisfy the demand, with rules of economic dispatch taking precedence.

Constraining Price Using Energy Storage
The coordination mechanism for reducing price volatility and price spikes is demonstrated using Figure 5. The results from the implementation of our proposed formulation over a week are presented through Figure 5a,d. From Figure 5a, it can be observed that the marginal price without flexibility provision (red) could exceed the desired price limit. This occurred for a few instances in the given week. At these instances, the DSO issued a request for flexibility to the aggregator on behalf of the energy community. This requested flexibility was satisfied by discharging of a storage system as described in Equation (11). Figure 5b depicts the storage operational profile in addition to generation and demand profiles. Once the storage had discharged to constrain the price, it needed to charge in order to constrain price over multiple periods. Additionally, the aggregator could also participate in arbitrage (not shown in this figure). For charging, the aggregator needed to determine the economically beneficial time periods. From Figure 5b, it is observed that charging mostly took place during the night when price was low. Furthermore, the aggregator dispatched the storage in coordination with the DSO, thereby avoiding additional grid contingencies. The combined load and charging used the entire grid capacity of 2 MW. Finally, charging of the storage resulted in a net increase in the local demand. This subsequently resulted in an increase in marginal price as compared to the case without flexibility and can be seen in Figure 5a, where the green line lies above the red line during the low price periods.
The price for the entire year considering the price hedging mechanism and the operation of energy storage as a flexible resource is presented in Figure 5c. It is observed that by discharging the storage, the price was capped at λ * for the entire year, which exhibited the effectiveness of our proposed mechanism. The net increase in relative price experienced by the energy community due to charging occurred for a period of approximately 1000 h when the price was most favorable. Additionally, the price increase in most cases was nominal.
The generation, demand, storage, and grid exchange for the whole year are summarized in Figure 5d. Storage discharge mostly took place during hours when the demand was roughly between 1.5 MW and 2 MW. Comparing Figure 4c and Figure 5c, it can be observed that these were actually the hours with the highest loads in the distribution grid. During the periods of storage charging, the storage would utilize all of the remaining (other than the consumer demand) available 2 MW capacity of the grid connection. For a small amount of hours, the combined load in the grid would exceed 2 MW. These were the hours when either the storage discharging or solar generation complemented the imports from the main grid.

Economic Analysis of Contractual Arrangements
The economic analysis of different contractual arrangements is performed in this subsection. Using the formulation presented in Equation (10), we computed the optimal size of the ESS required to constrain the price to the contractual limit of λ * . Figure 6 presents the relation between the values of λ * and the optimal size of the storage system. It can be observed that as the price limit was relaxed, the size of the storage required significantly decreased. The resulting size of the ESS depended on the number of consecutive hours that the marginal price exceeded the value of λ * , which in turn corresponded to the required depth of discharge and charge that the storage must sustain. For the purpose of our exploratory analysis, the step size in terms of the contractually agreed on price limit λ * was e10/MWh for the contractual price ranging between e50/MWh and e110/MWh. For higher values, the step size was then further granulated to reflect a value of e5/MWh. From the value of λ * =e50/MWh to λ * =e70/MWh, a steady drop in storage capacity from 21.3 MWh to 17.93 MWh was observed for constraining the marginal price. However, a nominal decrease in storage capacity was realized when the value of λ * was increased from e80/MWh to e90/MWh and then again from e100/MWh to e110/MWh. This was because for the year, the number of consecutive hours in which the price realized was between these pairs of values of λ * was scarce. Finally, as the value of λ * increased beyond the value of e115/MWh, the storage capacity required for constraining marginal price drastically decreased. Figure 7 presents a comparison between the capital and operational expenditure incurred by the aggregator to satisfy its contractual obligations. CAPEX values are related to the investment decision that the aggregator needs to make. The total annualized investment cost for the storage system is computed using Equation (18). In accordance with Figure 6, we can observe that as the value of λ * was relaxed, the annualized costs of the storage system significantly decreased. The OPEX of the aggregator is related to the charging of the ESS and is computed using Equation (14). Charging the ESS during periods of low electricity price ensured that it was able to discharge when the marginal price needed to be constrained. As expected, as the price limit for the community was increased, there would be a decrease in the cost of charging due to reduced instances of when flexibility requests were issued. For example, when the price limit for the energy community was aggressive, i.e., when the value of λ * = e50/MWh, then for that case, the annualized investment cost for the aggregator was e181,050/year. Correspondingly, given the frequency of the number of hours where the prices realized in the day-ahead market were higher than the value of λ * , the cost of charging was e48,490.33. Comparatively, when the value of λ * = e125/MWh, then the investment and charging costs were significantly lower with values of e31,705/year and e958.714, respectively. As part of the contractual agreement, the aggregator earns an income from the payments made by the energy community for constraining the price. The income from hedging is defined by Equation (13) and is shown in Figure 8. This income decreased sharply for higher price limits. Although the price at which the flexibility was sold increased, the number of hours in which the flexibility was provided fell more rapidly. As a result, the income from hedging (the product of the number of hours flexibility was provided, and the price limit (see Equation (13))) decreased. For example, with λ * = e50/MWh, the aggregator income was e65,760.55, while at λ * = e125/MWh, it was only e1444.75.
The aggregator could earn additional revenue by partaking in arbitrage during the periods when it was not required to satisfy flexibility requests. To perform arbitrage, the aggregator participated in the wholesale electricity market as a price-taker, charging the storage when the price was low and selling electricity by discharging when the price was high. However, instances may arise when the aggregator was required to forgo arbitrage opportunities in order to satisfy its contractual obligations. This in turn limited the revenue potential from performing arbitrage and could be observed clearly for when the price limits were aggressive. While increasing the price limit resulted in diminishing return from hedging, the upside was that the storage had more opportunities for arbitrage as the frequency with which Constraint (12) was to be executed decreased. Figure 9 shows the net operational revenue from combined arbitrage and hedging (blue), net hedging revenue only (green) with different price limits, as well as corresponding annualized storage investment costs (teal). As a reference, in Figure 9, we also consider the revenue potential if an aggregator were to perform only arbitrage (purple) given the same size of storage. Indeed, Figure 9 shows that in the combined hedging and arbitrage case, the arbitrage revenue increased when the price limits were relaxed. In fact, they approached the arbitrage revenue of the arbitrage-only case. This made sense, when realizing that the only difference between these two cases was that Constraint (12) forced the storage to provide flexibility P F [t]. At more relaxed price limits, this constraint became increasingly inactive, and the two cases became increasingly alike. The difference between the purple and the blue bars in Figure 9 could thus be considered as the cost of imposing a price limit. A key observations can be drawn from the analysis of Figure 9. The revenue potential from hedging and arbitrage was governed by the size of the storage system. The storage in turn was sized such that it was able to constrain the marginal price to the contractual limits throughout the year. Figure  9 also makes clear that with the data used for this case study, there was only a positive business case for values of the price limit of e120/MWh or higher. At the price limit of e120/MWh, the corresponding size of the ESS required was 4.17 MWh, and the annualized storage investment costs and combined hedging and arbitrage revenue were e35,431.4/year and e40,118.06/year, respectively. Thus, at higher price limits, the storage size and its corresponding costs decreased rapidly while the revenues from storage operation fell less sharply. In other words, a relatively small sized storage was able to provide flexibility and arbitrage for a small number of hours, but against very favorable prices.
For this case study, the net revenue from hedging alone was too low for a positive business case. However, we did not consider a premium or fixed fee that the provider of flexibility would receive. In principle, since local price was reduced for the entire grid, a risk-neutral consumer could be expected to pay the same amount of money compared to the situation without flexibility.

Comparative Analysis of Combined Hedging and Arbitrage and Arbitrage Alone
As previously mentioned, the aggregator can integrate with the energy community without entering into a flexibility contract. In this case, the aggregator would operate the storage purely to leverage from the price volatility by performing arbitrage. From Table 1, it can be observed that the main benefit of our proposed formulation was that it was able to constrain price to the community-specified limit. In contrast, the storage operating purely for arbitrage was unable to guarantee a price limit. For our comparative analysis, the size of storage for each comparison scenario was kept constant. From Table 1, it can be noticed that when there was an aggressive price limit λ = e50/MWh, then while the difference between the maximum price in the two cases compared was high, the maximum price in the arbitrage only case was the lowest compared to the other price limit scenarios. This was because the given price limit of e50/MWh required a larger storage size to constrain the price successfully. Table 1. Comparative analysis of maximum price and system benefit (negative of the objective function in Equation (11)), between combined hedging and arbitrage and arbitrage only. Furthermore, it could be observed that as the price limit was relaxed, the difference in the maximum price for the two cases being compared also decreased. However, the trade-off of our proposed formulation was that placing a price cap resulted in a reduced overall system benefit. Subsequently, the revenue for the aggregator reduced as compared to a situation in which the aggregator performed arbitrage alone. Additionally, we observed that total system benefits (utility minus costs) were only slightly (∼ 0.15%) higher in the arbitrage only case. This showed that imposing an extra constraint on the system indeed led to a lower optimum, but the costs in both cases were almost comparable.

Conclusions
In this paper, we presented a coordination mechanism that was used to reduce price volatility and price spikes in electricity systems. The novelty of this mechanism was that it applied an explicit constraint on price, which was generally an output of an optimal power flow and not known a priori. Our proposed approach used duality theory for quantifying the flexible power required to constrain price to the desired limit. An institutional arrangement for the required coordination mechanism was presented that illustrated the information and money flow between consumers, a market facilitator, and the operator of a flexible resource.
The concept presented was illustrated with a case study of an energy community located in the distribution grid that faced increasing price volatility and price spikes due to wholesale price and local congestion. An aggregator entered into a flexibility contract with the community, thereby operating an energy storage to satisfy flexibility requests and constrain price. Additionally, at instances when there were no flexibility requests, the aggregator could participate in energy arbitrage. A techno-economic analysis from the aggregator's perspective was considered in this paper, where the aggregator's revenue from the combination of arbitrage and hedging, under different price limits, was compared against the storage investment cost. Results indicated that strict price limits restricted the level of volatility in the local electricity market, and hence, a trade-off was observed in the aggregator's revenue when comparing the combined arbitrage and hedging case with the arbitrage only case. Furthermore, from the techno-economic analysis, it was observed that the business case for the storage system depended strongly on the price limit in the grid. For the case study investigated, a business case was realized as the value of λ * increased over e120/MWh. Finally, a comparison with the arbitrage-only case showed that the reduction in overall system benefit of imposing an additional constraint on the system was modest.
In conclusion, this paper serves as a preliminary proposal for physical hedging in distribution grids, and future research could provide insights on several aspects that were not addressed here. Firstly, we considered the flexibility contract to have a constant price limit for the entire year. The shortcoming of such a contract is that when the price of electricity in the market is low, the aggregator is not able to generate revenue through hedging. Alternatively, periods may exist when the price of electricity is consecutively high for long periods. Since the storage capacity sizing is directly related to the number of consecutive hours for which the market price is higher than the contractual price limit, it will result in a requirement for large storage units, which are expensive. Assigning a time-varying value for the price limit can aid in alleviating this issue. Secondly, we only considered an energy storage system as a potential source of flexibility in our case study, but it would be interesting to investigate demand response technologies like electric vehicles or flexible heating/cooling systems. This is because the electrification of transport and heating and could contribute to grid congestion, thereby resulting in additional price spikes. Thirdly, we treated everything in a deterministic framework, where full knowledge of future price and demand was assumed. Uncertainty should be considered to get a more realistic estimate of the operation and economics of the system. Finally, our presented formulation is readily extendable to larger systems with multiple nodes and possibly higher voltage levels such as the transmission grid. Thus, additional insights from our approach could be generated including the analysis of the computational feasibility of the approach.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: