Local Market for TSO and DSO Reactive Power Provision Using DSO Grid Resources

: This paper proposes a near to real-time local market to provide reactive power to the transmission system operator (TSO), using the resources connected to a distribution grid managed by a distribution system operator (DSO). The TSO publishes a requested reactive power proﬁle at the TSO-DSO interface for each time-interval of the next delivery period, so that market agents (managing resources of the distribution grid) can prepare and send their bids accordingly. DSO resources are the ﬁrst to be mobilized, and the remaining residual reactive power is supplied by the reactive power ﬂexibility o ﬀ ered in the local reactive market. Complex bids (with non-curtailability conditions) are supported to provide ﬂexible ways of bidding fewer ﬂexible assets (such as capacitor banks). An alternating current (AC) optimal power ﬂow (OPF) is used to clear the bids by maximizing the social welfare to supply the TSO required reactive power proﬁle, subject to the DSO grid constraints. A rolling window mechanism allows a continuous dispatching of reactive power, and the possibility of adapting assigned schedules to real time constraints. A simpliﬁed TSO-DSO cost assignment of the ﬂexible reactive power used is proposed to share for settlement purposes.


Introduction
In traditional power systems, voltage support and reactive power regulation have typically been provided by conventional generators. These generators can be already paid back or still recovering costs mainly through energy markets, and, to a lesser extent, through ancillary services markets. However, under the expected renewable energy sources (RES) integration scenarios, conventional generation units could dramatically decrease in number, due to strict environmental regulations and a lower economic viability (lower prices and lower capacity factors). Under this new framework, new sources of system services must be investigated.

Related Works
Many approaches can be found for the provision and the corresponding remuneration of reactive power services, grouped under two main alternatives, regulated and market based approaches [1][2][3][4]. Under regulated approaches, reactive power is provided on a mandatory basis: (1) without compensation, at least up to certain limits; (2) compensating a guaranteed reactive power regulation reserve with fixed long-term premiums; (3) compensating the amount effectively dispatched with regulated tariffs; or (4) combining long and short-term regulated compensations to account for investment and operation cost of the resources used. Market based approaches may focus on problem is formulated to minimize the total payments for the reactive power and energy losses, and to maximize system voltage security and reactive power reserves. Finally, [16] proposes a local reactive power market for low level voltage control, where the main providers are electric vehicles.
In [17], reactive power, losses costs and voltages deviations, are all together minimized in a multi-objective minimization problem. A Pareto frontier is proposed, using a non-dominated sorting genetic algorithm II. Reactive power costs come from the reactive power bids offered from the distributed power producers and from the cost of using capacitor banks (being unclear if they are private or DSO resources). Uniform pricing is proposed and computed as the marginal cost of the formulated problem. The problem of recovering investments cost for providing reactive power is not addressed. However, several remarks can be made. First, remunerating the provision of reactive power under a market mechanism can be seen as an improvement, with respect to regulated remuneration mechanisms, so market agents can decide to invest or not for this purpose according to the market prices. Second, the capacity of providing reactive power could need some additional capacity mechanism, as suggested, for example, in [18], but this is not in contradiction with a real time market based on uniform pricing, as occurs with other commodities. In fact, under marginal theory, pricing is not compatible with including fixed costs, since, ideally, price should be equal to the marginal cost of providing the service [19]. For that cases, if the system has evolved in an optimal way, marginal price should allow all units to recover all costs except the marginal unit. If non-supplied service prices are allowed, even the marginal unit could recover all costs in an adapted system. Finally, note that this is not a case of those approaches based on total cost minimization, where variable and fixed costs can be taken into account together in the optimization problem for the medium to long term, as in [20].
Reference [6] proposes a day-ahead distribution grid market, where DG supplies the reactive power. The costs of supplying reactive power are estimated as in the previous references, based on [14]. Clearing is performed based on the cost minimization of providing the service, so the marginal cost is set to the market price. In fact, as in other works, four different market prices are set for the four bids components (availability, two types of operation and opportunity cost). Finally, to cope with DG variability, Monte Carlo scenarios are fed to a multi-objective problem (payments, active power curtailments, line losses and voltage profile index). The problem is solved with a Strength Pareto Evolutionary Strength Pareto Evolutionary Algorithm 2 (ISPEA2). The procurer is the DSO and the coordination TSO-DSO, if any, remains unclear.
Another local reactive power day-ahead market with uniform pricing is proposed in [21] for distribution grids, run by the DSO which is the only procurer. An OPF minimizes the total costs of supplying the service, subject to the grid constraints. The distributed resources are hierarchically organized in microgrids and managed by a central management autonomous controller, which, in turn, controls the lower level microgrids central controllers.
The participation of another type of assets (apart from the conventional generators) is also considered in other works. For example, in [5], losses and reactive provision costs are minimized with special attention to SVC and STATCOM devices. Reference [20] focuses on DG and static compensator costs to provide reactive power in a local combined active and reactive power dispatch based on an OPF. In [6], multiple scenarios are used to reduce the uncertainty of renewable generators. Most approaches are USA markets oriented, where no explicit reactive power bids are made, and clearing is made with an OPF, with the declared technical features and costs of the assets as inputs. In addition, a complex cost description is very often used to represent them in detail (including availability, operation and lost opportunity costs), often considering investments costs for some of the participant assets. Reviews of real approaches to voltage control and reactive power provision and remuneration can be found in [4,22,23].

Assumptions and Contributions
The present work is part of the Flexibility Hub platform of the Portuguese demonstration of the on-going research project H2020 EU-SysFlex (see funding section). This research focuses on how Energies 2020, 13, 3442 4 of 19 to ensure an efficient and sufficient level of system services to facilitate very large penetration of renewable energy sources [24]. In this paper, a local reactive power market is proposed to supply, close to real-time, reactive power to the TSO at the TSO-DSO interface by using the resources connected at the distribution grid of the DSO.
The objective is not to address a global reactive power market, whose complexity and power market issues may overcome the benefits. The objective is to propose a local market to allow distributed resources to contribute to the reactive power service, guaranteeing the DSO reactive power responsibility at the TSO-DSO interface, and also provide the additional TSO reactive power needs, guaranteeing that the constraints of the DSO grid are not violated. DSO resources (paid by the users through regulated tariffs) are used first, and the remaining reactive power needed by the TSO is matched with the market bids send by market agents. Some of the main assumptions for the proposed local reactive power market are:

•
There is an increasing penetration of distributed energy resources able to provide system services (including DG), and a decrease of conventional plants.

•
Market clearing is based on maximizing the social welfare, with uniform pricing to incentivize real marginal costs bidding.

•
The agents are responsible from offering their reactive power availability according to their active power program that results from their energy compromises scheduled in energy markets. Note that, as occurs with other interrelated commodities, strategic behavior may lead to modifying other commodity schedules to maximize benefits, but in a technical feasible way (as, for example, occurs in several European markets when units need to make adjustments to their day ahead energy schedule in intraday markets, when secondary reserve capacity is cleared in the secondary reserve market).

•
There exists a unique connection point between DSO and TSO grids. However, a methodology has also been developed in the EU-SysFlex to model the impact of multiple connection points, that will be published soon in the Deliverable 6.5 [25].
The main contributions of this paper are: • A market mechanism to allow distributed market agents to provide reactive power to the DSO and to the TSO, incentivizing the provision of these services from DSO grid resources.

•
While most proposals are based on using declared costs as bids, as is usual in USA electricity markets, the current proposal is based on a technical clearing to guarantee grid secure operation, but with a flexible bid format, more aligned with EU markets, leaving more bidding responsibility to the market agents, but also providing them more flexibility. • A close to real time market for a better reactive power regulation. This allows TSO and market agents to better adapt to variability and uncertainty by continuously adjusting, if needed, their reactive power schedules with buying or selling bids in the overlapping market sessions.

•
Complex bids to allow a more flexible operation of the assets, according to their physical constraints (discrete regulation, switching costs, etc.). Clearing is performed by iteratively running a fast multi-period OPF, discarding complex bids when their conditions do not hold, and clearing again with the remaining bids until all the complex conditions of the bids matched hold.

•
Both DSO and TSO can use the distributed reactive power resources. Implicit priority is given to the DSO, since bids activation always respects DSO grid constraints. A settlement mechanism to share costs between TSO and DSO is also proposed.
The rest of the paper is structured as follows. Section 2 describes the local reactive market proposed, Section 3 focus on the market clearing, Section 4 describe the main assumptions for the simulated scenarios, Section 5 presents and discusses the results, and Section 6 concludes.  Figure 1 shows the main agents and system components involved, and the sequence of the main actions that take place during a market session. As can be seen, the TSO publishes the reactive power profile needed (TSO needs) for the next time delivery horizon, so that market agents (flexibility providers) can elaborate and send their bids for each delivery period to supply the TSO needs, or to balance their own position to modify previously assigned schedules. TSO needs are also shared with the DSO, since in a transition phase to a more liberalized system, the DSO can still have its own resources that should be mobilized first to balance the reactive power. The DSO updates the grid topology and the active and reactive power forecasts needed to compute the OPF, and the market is cleared. profile needed (TSO needs) for the next time delivery horizon, so that market agents (flexibility providers) can elaborate and send their bids for each delivery period to supply the TSO needs, or to balance their own position to modify previously assigned schedules. TSO needs are also shared with the DSO, since in a transition phase to a more liberalized system, the DSO can still have its own resources that should be mobilized first to balance the reactive power. The DSO updates the grid topology and the active and reactive power forecasts needed to compute the OPF, and the market is cleared. To clear the market, the DSO needs the active and reactive power forecasts for all the non-flexible resources of the grid. For the flexible resources participating in the markets, the DSO needs their active power forecasts, their reactive power positions committed in previous market sessions and the bids sent for the current session. For the TSO connection point, the active power is a result of the balance of the DSO grid, and again, the previously reactive power position committed in previous market sessions and the new needs sent for the current session are also needed. It is also notable that, although the current proposal is not considering uncertainty, some more complex clearing could be designed, for example to deal with worst cases. In addition, non-market based real time mechanism, as for other power commodities, could also be available for emergency situations, which should be used to set-up the penalties prices for those not complying with their obligations in the proposed market.

Market Description
The market is cleared by maximizing the social welfare with network constraints (see Figure 2 and Equations (1) to (10)). When cleared bids have complex conditions not holding, they are iteratively discarded until all complex conditions of the cleared bids hold.  To clear the market, the DSO needs the active and reactive power forecasts for all the non-flexible resources of the grid. For the flexible resources participating in the markets, the DSO needs their active power forecasts, their reactive power positions committed in previous market sessions and the bids sent for the current session. For the TSO connection point, the active power is a result of the balance of the DSO grid, and again, the previously reactive power position committed in previous market sessions and the new needs sent for the current session are also needed. It is also notable that, although the current proposal is not considering uncertainty, some more complex clearing could be designed, for example to deal with worst cases. In addition, non-market based real time mechanism, as for other power commodities, could also be available for emergency situations, which should be used to set-up the penalties prices for those not complying with their obligations in the proposed market.
The market is cleared by maximizing the social welfare with network constraints (see Figure 2 and Equations (1) to (10)). When cleared bids have complex conditions not holding, they are iteratively discarded until all complex conditions of the cleared bids hold.
The duration-time of the product delivery is 15 min, and the market is cleared 10 min prior to each delivery. The delivery horizon is set to 7 h (28 time intervals, see Figure 3), so that flexibility providers can use complex bids conditions to, for example, avoiding excessive switching of particular assets (for example for capacitor banks). Indeed, the non-curtailable condition of the bids makes it possible to significantly limit number of switching of assets, and other complex conditions, such as the convexity of the cleared schedule, could also be implemented. The duration-time of the product delivery is 15 min, and the market is cleared 10 min prior to each delivery. The delivery horizon is set to 7 h (28 time intervals, see Figure 3), so that flexibility providers can use complex bids conditions to, for example, avoiding excessive switching of particular assets (for example for capacitor banks). Indeed, the non-curtailable condition of the bids makes it possible to significantly limit number of switching of assets, and other complex conditions, such as the convexity of the cleared schedule, could also be implemented. The submission of reactive power bids can take place from the moment the agent is able to estimate its reactive power availability (after a new energy schedule), and until the market session gate closure, ten minutes before the beginning of the delivery horizon ( Figure 4).   The duration-time of the product delivery is 15 min, and the market is cleared 10 min prior to each delivery. The delivery horizon is set to 7 h (28 time intervals, see Figure 3), so that flexibility providers can use complex bids conditions to, for example, avoiding excessive switching of particular assets (for example for capacitor banks). Indeed, the non-curtailable condition of the bids makes it possible to significantly limit number of switching of assets, and other complex conditions, such as the convexity of the cleared schedule, could also be implemented. The submission of reactive power bids can take place from the moment the agent is able to estimate its reactive power availability (after a new energy schedule), and until the market session gate closure, ten minutes before the beginning of the delivery horizon ( Figure 4).  The submission of reactive power bids can take place from the moment the agent is able to estimate its reactive power availability (after a new energy schedule), and until the market session gate closure, ten minutes before the beginning of the delivery horizon ( Figure 4). The duration-time of the product delivery is 15 min, and the market is cleared 10 min prior to each delivery. The delivery horizon is set to 7 h (28 time intervals, see Figure 3), so that flexibility providers can use complex bids conditions to, for example, avoiding excessive switching of particular assets (for example for capacitor banks). Indeed, the non-curtailable condition of the bids makes it possible to significantly limit number of switching of assets, and other complex conditions, such as the convexity of the cleared schedule, could also be implemented. The submission of reactive power bids can take place from the moment the agent is able to estimate its reactive power availability (after a new energy schedule), and until the market session gate closure, ten minutes before the beginning of the delivery horizon ( Figure 4).  Bids specify the reactive power offered for each time-period and its price (see for example [20] or [6] for the cost assessment of providing reactive power, as well as Section 4). As referenced, complex conditions can be used to avoid curtailing individual time-periods (for example for discrete steps assets), or to avoid curtailing the whole delivery horizon. Since market sessions are continuously held, after a market session is cleared, only the first time period must be actually delivered ( Figure 3). The scheduled reactive power for the following time periods can be adjusted in the following overlapping market sessions, if market liquidity is enough. In this sense, bids and reactive power assignments must be understood as incremental with respect to the current reactive power schedule resulting from all overlapping previous market sessions.

Market Clearing
Each market session is cleared by maximizing the social welfare (maximizing the utility of the cleared buying bids and minimizing the cost of the cleared selling bids) for the whole amount T of time periods t of the delivery horizon and for total number F of flexibility resources f (generators or capacitor banks), according to Equation (1): where "cap" stands for capacitive and "ind" for inductive, pb i, f ,t and ps i, f ,t are the buying and selling prices of the corresponding bid i of a flexible resource f for time period t, and ∆Q are the decision variables corresponding to the cleared buying and selling quantities, respectively. NB Cap f ,t , NB ind f , and NS cap f , , NS ind f , are, respectively, the total number of offers to buy (capacitive and inductive) and to sell (capacitive and inductive) of a flexible resource f at time period t. It is also notable that, after clearing the market, ∆Q are incremental assignments, with respect to the current reactive power position of the flexible resource f for the time period t (as a result of previous overlapping market sessions). In addition, the cleared quantities are limited by the maximum quantities offered and by the typical optimal power flow constraints [26] described below. The optimization algorithm used is based on the primal-dual interior point method as explained in [27]. This method was chosen because of its robustness when applied to non-convex problems, such as OPF [28]. Note that other optimization algorithms, such as a convex relaxation of OPF [29] or hybrid PSO [30] could also have been used.
where for time each time period t: Energies 2020, 13, 3442 Equation (2) is the active power balance where P G n,t , P D n,t and P n,t are the sum of active power from all generators, loads and lines at node n for time period t. N is the total number of nodes.
Equation (3) is the reactive power balance at node n. It is computed from the initial reactive power operation point (by summing the reactive power of the generators at node n, Q G n,t , the reactive power of the capacitor banks at node n, Q cond n,t , the reactive power of the loads at node n, Q D n,t , and the total lines' reactive contribution at node n, Q n,t ) by adding ∆Q cap n, f ,t and ∆Q ind n, f ,t , the total cleared capacitive and inductive reactive power flexibilities, as well as ∆Q cond n, f ,t , the total cleared reactive power flexibility provided by the capacitor banks.
Equation (4) limits the voltage magnitude V n,t to its maximum and minimum values, V n,t(max) and V n,t(min) , respectively, and Equation (5) sets the voltage angle at the reference bus.
Equations (6) and (7) model the discrete steps positions of the capacitor banks, Q cond n,t , and of the on-load tap changers (OLTC), tap l,j,t , respectively (N cb and N OLTC being the number of capacitor banks and OLTCs, respectively).
Equation (8) limits the direct and inverse branch flows S b,t to their thermal limit S max b , Br being the set of all grid branches.
Finally, Equations (9) and (10) are the active and reactive power, P n,t and Q n,t , respectively, provided at node n by the branches k connected to node n (set Br n ) for each time period t. In these equations, V k,t is the voltage at the other node the branch k is connected to, G k and B k are the real and imaginary parts of the admittance of line k, and θ k,t is the difference in voltage angle (at time t), between the two nodes the line is connected to.
Note that complex condition checking is not reflected in Equations (1) to (10), since this is based on checking, after the clearing process of Equations (1) to (10), if the complex conditions of the bids cleared hold. Otherwise, these bids are discarded, and the market is cleared again with the remaining bids. This is therefore reflected only Figure 2, in the loop used to check the complex conditions of the bids.
It is also notable that, since, with this approach, two different products are in fact being traded, two different market prices must be considered, one for the capacitive reactive power, corresponding to the most expensive cleared selling bid of capacitive reactive power, and one for the inductive reactive power, corresponding to the most expensive cleared selling bid of inductive reactive power. Finally, DSO resources, if any, are cleared first by considering them with null price to sell, and maximum price to buy, so that only the remaining reactive power demand needs to be supplied by the market players.

Study Cases
According to [20], Figure 5 shows the costs incurred by solar photovoltaic (PV) and wind farms to provide both inductive and capacitive reactive power, both related to the losses caused by the extra current to provide reactive power.
As can be seen, total costs for PV farms depend on the active power operating point (basically due to the inverters maximum current limitation), unlike wind farms [20]. Since, under marginal theory markets, bid prices are based on variable (marginal) costs, for simplicity reference costs have been selected for both types of assets, set to 5 EUR/MVArh for the PV assets and to 3.5 EUR/MVArh for the wind generation assets. Price bids have then been obtained with small deviations from this reference costs, as shown in Figure 6, using σ = 0.2. As can be seen, total costs for PV farms depend on the active power operating point (basically due to the inverters maximum current limitation), unlike wind farms [20]. Since, under marginal theory markets, bid prices are based on variable (marginal) costs, for simplicity reference costs have been selected for both types of assets, set to 5 EUR/MVArh for the PV assets and to 3.5 EUR/MVArh for the wind generation assets. Price bids have then been obtained with small deviations from this reference costs, as shown in Figure 6, using σ = 0.2. Indeed, according to standard marginal theory, market players may be willing to provide (sell) inductive or capacitive power if price is larger than the marginal costs of providing it (selling bid price larger than the reference cost in this simplified case example), but could also be willing to reduce the reactive power scheduled in a previous market session (buy), if the price is lower than the marginal costs of providing the service (buying bid price lower than the reference cost). It is also notable that, for simplicity, all the available reactive power is being offered in a unique block in this example. However, market agents could, in general, break down this block into smaller ones to offer a stepwise quantity-price curve, to better represent non-constant marginal costs, as happens in many other power markets in Europe. Figure 7 represents the grid used for the simulated case examples, based on a simplification of the one proposed in [31], and Table 1 shows the consumers (left side) and generators (right side) connected to the grid, and their operation point in terms of active and reactive power. The numbers in the acronyms refer to the node in Figure 7 to which they are connected. For the generation assets, their installed capacity, and their reactive power flexibility and reference cost used are also in the table. For simplicity, only four resources have been selected to offer reactive power flexibility. Their first reactive power operating point can be considered as the result of using their reactive power bids to compensate the consumers reactive power when the TSO is not demanding, whose cost could be recovered by the DSO through distributions tariffs. Note, however, that there could also be a scenario  As can be seen, total costs for PV farms depend on the active power operating point (basically due to the inverters maximum current limitation), unlike wind farms [20]. Since, under marginal theory markets, bid prices are based on variable (marginal) costs, for simplicity reference costs have been selected for both types of assets, set to 5 EUR/MVArh for the PV assets and to 3.5 EUR/MVArh for the wind generation assets. Price bids have then been obtained with small deviations from this reference costs, as shown in Figure 6, using σ = 0.2. Indeed, according to standard marginal theory, market players may be willing to provide (sell) inductive or capacitive power if price is larger than the marginal costs of providing it (selling bid price larger than the reference cost in this simplified case example), but could also be willing to reduce the reactive power scheduled in a previous market session (buy), if the price is lower than the marginal costs of providing the service (buying bid price lower than the reference cost). It is also notable that, for simplicity, all the available reactive power is being offered in a unique block in this example. However, market agents could, in general, break down this block into smaller ones to offer a stepwise quantity-price curve, to better represent non-constant marginal costs, as happens in many other power markets in Europe. Figure 7 represents the grid used for the simulated case examples, based on a simplification of the one proposed in [31], and Table 1 shows the consumers (left side) and generators (right side) connected to the grid, and their operation point in terms of active and reactive power. The numbers in the acronyms refer to the node in Figure 7 to which they are connected. For the generation assets, their installed capacity, and their reactive power flexibility and reference cost used are also in the table. For simplicity, only four resources have been selected to offer reactive power flexibility. Their first reactive power operating point can be considered as the result of using their reactive power bids to compensate the consumers reactive power when the TSO is not demanding, whose cost could be recovered by the DSO through distributions tariffs. Note, however, that there could also be a scenario Indeed, according to standard marginal theory, market players may be willing to provide (sell) inductive or capacitive power if price is larger than the marginal costs of providing it (selling bid price larger than the reference cost in this simplified case example), but could also be willing to reduce the reactive power scheduled in a previous market session (buy), if the price is lower than the marginal costs of providing the service (buying bid price lower than the reference cost). It is also notable that, for simplicity, all the available reactive power is being offered in a unique block in this example. However, market agents could, in general, break down this block into smaller ones to offer a stepwise quantity-price curve, to better represent non-constant marginal costs, as happens in many other power markets in Europe. Figure 7 represents the grid used for the simulated case examples, based on a simplification of the one proposed in [31], and Table 1 shows the consumers (left side) and generators (right side) connected to the grid, and their operation point in terms of active and reactive power. The numbers in the acronyms refer to the node in Figure 7 to which they are connected. For the generation assets, their installed capacity, and their reactive power flexibility and reference cost used are also in the table. For simplicity, only four resources have been selected to offer reactive power flexibility. Their first reactive power operating point can be considered as the result of using their reactive power bids to compensate the consumers reactive power when the TSO is not demanding, whose cost could be recovered by the DSO through distributions tariffs. Note, however, that there could also be a scenario where consumers could also participate in the local reactive power market in the same way as the generators do. where consumers could also participate in the local reactive power market in the same way as the generators do.

Results
Two scenarios have been tested, considering, for simplicity, a sequence of market sessions with only one time period and no complex bids. The first scenario corresponds to the TSO demanding increasing inductive reactive power (modelled with a capacitive reactive power injection to the DSO grid that must be compensated with inductive reactive power from the flexible resources). The second scenario corresponds to increasing TSO capacitive reactive power needs (modeled with an

Results
Two scenarios have been tested, considering, for simplicity, a sequence of market sessions with only one time period and no complex bids. The first scenario corresponds to the TSO demanding increasing inductive reactive power (modelled with a capacitive reactive power injection to the DSO grid that must be compensated with inductive reactive power from the flexible resources). The second scenario corresponds to increasing TSO capacitive reactive power needs (modeled with an inductive reactive power injection to the DSO grid). For illustrative purposes, starting from 0 TSO needs in both cases (which clears the reactive power needed by the DSO to compensate its grid reactive power), TSO needs are incremented with −1 MVAr steps until −5 MVAr in the first scenario, and incremented with 0.1 MVAr steps until 0.4 MVAr in the second scenario. Figure 8 shows the reactive power provided by each of the flexible providers after clearing the market, for increasing TSO inductive needs (blue circles correspond to capacitive reactive power, green circles to inductive, and a black border indicates those resources that are setting the market price).
Energies 2020, 13, x FOR PEER REVIEW 11 of 19 inductive reactive power injection to the DSO grid). For illustrative purposes, starting from 0 TSO needs in both cases (which clears the reactive power needed by the DSO to compensate its grid reactive power), TSO needs are incremented with −1 MVAr steps until −5 MVAr in the first scenario, and incremented with 0.1 MVAr steps until 0.4 MVAr in the second scenario. Figure 8 shows the reactive power provided by each of the flexible providers after clearing the market, for increasing TSO inductive needs (blue circles correspond to capacitive reactive power, green circles to inductive, and a black border indicates those resources that are setting the market price). Initially, when the TSO is not demanding reactive power, the cheapest resources (WIND7 and WIND8 with same price) provide the capacitive reactive power needed by the DSO to compensate the loads inductive reactive power of its grid, setting the market price to 3.7 EUR/MVAr. Note that, since WIND7 and WIND8 are located at different buses, their contribution is not symmetric, with WIND7 being the resource that provides more capacitive reactive power, since its contribution is subject to less reactive power losses (and has therefore a larger positive impact on the social welfare).
When the TSO increases its inductive needs, the same providers can buy the amount of reactive power already cleared and now partially provided by the TSO. Since sells have a price larger than the reference cost, and purchases lower, all operations entail benefits for the providers. When the TSO needs reach an inductive reactive power between −1 and −2 MVAr, all the reactive power of the loads is compensated, and additional inductive reactive power is needed and provided from the same cheaper providers, with same market price. When a TSO value between 4 and 5 MVAr is reached, more inductive reactive power is needed, and more expensive providers are then cleared (PV4 and PV12), increasing the market price to 5.2 EUR/MVAr. Figure 9 shows the buses' voltage in the grid for each TSO reactive inductive needs. Initially, when the TSO is not demanding reactive power, the cheapest resources (WIND7 and WIND8 with same price) provide the capacitive reactive power needed by the DSO to compensate the loads inductive reactive power of its grid, setting the market price to 3.7 EUR/MVAr. Note that, since WIND7 and WIND8 are located at different buses, their contribution is not symmetric, with WIND7 being the resource that provides more capacitive reactive power, since its contribution is subject to less reactive power losses (and has therefore a larger positive impact on the social welfare).
When the TSO increases its inductive needs, the same providers can buy the amount of reactive power already cleared and now partially provided by the TSO. Since sells have a price larger than the reference cost, and purchases lower, all operations entail benefits for the providers. When the TSO needs reach an inductive reactive power between −1 and −2 MVAr, all the reactive power of the loads is compensated, and additional inductive reactive power is needed and provided from the same cheaper providers, with same market price. When a TSO value between 4 and 5 MVAr is reached, more inductive reactive power is needed, and more expensive providers are then cleared (PV4 and PV12), increasing the market price to 5.2 EUR/MVAr. Figure 9 shows the buses' voltage in the grid for each TSO reactive inductive needs.
The capacitive reactive power injection decreases bus voltages with bus 10 reaching its minimum limit near TSO needs of −5 MVAr (note that bus 1 voltage is modeled as constant and equal to 1). This is consistent with Figure 10  The capacitive reactive power injection decreases bus voltages with bus 10 reaching its minimum limit near TSO needs of −5 MVAr (note that bus 1 voltage is modeled as constant and equal to 1). This is consistent with Figure 10, which shows how lines flows increase (increasing voltage drops) when the TSO demands more inductive reactive power. In fact, when bus 10 reaches the 0.95 pu voltage, the reactive power provided to the TSO is limited by this voltage constraint, and TSO does not reach all the demanded value (by around −0.21 MVAr), although there is still reactive power flexibility unused.    The capacitive reactive power injection decreases bus voltages with bus 10 reaching its minimum limit near TSO needs of −5 MVAr (note that bus 1 voltage is modeled as constant and equal to 1). This is consistent with Figure 10, which shows how lines flows increase (increasing voltage drops) when the TSO demands more inductive reactive power. In fact, when bus 10 reaches the 0.95 pu voltage, the reactive power provided to the TSO is limited by this voltage constraint, and TSO does not reach all the demanded value (by around −0.21 MVAr), although there is still reactive power flexibility unused.    Figure 11 shows the total reactive power injection of the TSO, non-flexible resources, flexible resources and lines contribution, as described in Equation (3). As the TSO inductive needs increase, so does the inductive flexibility provided by the flexible resources, and it can also be seen how the lines' reactive power contribution switches from capacitive to inductive injection.
Energies 2020, 13, x FOR PEER REVIEW 13 of 19 Figure 11 shows the total reactive power injection of the TSO, non-flexible resources, flexible resources and lines contribution, as described in Equation (3). As the TSO inductive needs increase, so does the inductive flexibility provided by the flexible resources, and it can also be seen how the lines' reactive power contribution switches from capacitive to inductive injection. . of a particular delivery time of a market session is explained by Equation (11), where is the increment of the reactive power consumed by the TSO at the DSO-TSO boundary and is the increment of the reactive power the DSO needs to equilibrate its reactive power grid (note that inductive TSO needs correspond to a capacitive consumption, which with the consumer criteria of Equation (11) becomes negative). This DSO reactive power, , see Equation (12), consists of _ , the reactive power needed to compensate the non-flexible resources forecast variation (that could be updated at each market session), and , needed to compensate the variation of the lines' reactive power (which may change with and ).
. Table 2 presents the reactive power contribution of each the concepts involved in Equations (11) and (12) for the first scenario analyzed. At the initial null reactive power of the TSO, the reactive power flexibility is only used to compensate the DSO grid, providing capacitive reactive power. As the TSO inductive needs increase (see also Figure 8), assuming that the non-flexible reactive power remains constant, so does the inductive flexibility provided by the flexible resources. It is interesting to note how the reactive power of the lines can, depending on their loading [32], reduce or increase the net DSO reactive power needs. For the scenario in Table 2 QTSO QN_flex Qflex_activ. QLines Figure 11. Reactive power components for increasing TSO Q inductive needs.
The use of the activated flexibility ∆Q f lex.activ. of a particular delivery time of a market session is explained by Equation (11), where ∆Q tso is the increment of the reactive power consumed by the TSO at the DSO-TSO boundary and ∆Q dso is the increment of the reactive power the DSO needs to equilibrate its reactive power grid (note that inductive TSO needs correspond to a capacitive consumption, which with the consumer criteria of Equation (11) becomes negative). This DSO reactive power, ∆Q dso , see Equation (12), consists of ∆Q N_ f lex , the reactive power needed to compensate the non-flexible resources forecast variation (that could be updated at each market session), and ∆Q lines , needed to compensate the variation of the lines' reactive power (which may change with ∆Q tso and ∆Q dso ).
∆Q f lex.activ. = ∆Q tso + ∆Q dso (11) ∆Q dso = ∆Q N_ f lex + ∆Q lines (12) Table 2 presents the reactive power contribution of each the concepts involved in Equations (11) and (12) for the first scenario analyzed. At the initial null reactive power of the TSO, the reactive power flexibility is only used to compensate the DSO grid, providing capacitive reactive power. As the TSO inductive needs increase (see also Figure 8), assuming that the non-flexible reactive power remains constant, so does the inductive flexibility provided by the flexible resources. It is interesting to note how the reactive power of the lines can, depending on their loading [32], reduce or increase the net DSO reactive power needs. For the scenario in Table 2, lines reactive power decreases the total amount of flexible reactive power needed by the DSO to equilibrate its grid, therefore reducing its costs.
For a particular delivery time of a market session, settlement is obtained by computing the net collection rights of the flexibility providers, ER Q Flex , Equation (13), and the net obligations to pay of the flexibility users, that is EO Q TSO for the TSO, Equation (14), and EO Q DSO for the DSO, by isolating in Equation (15). Note that, even if the TSO is an inelastic player (that buys at maximum price and sells at minimum price), its net payment obligation is the opposite of the collection right of a flexibility provider (due to the buyer criteria selected for the TSO). Table 3 shows the capacitive and inductive reactive power market prices, and the corresponding settlements for the different TSO needs, according to Equations (13)-(15). When the TSO is not demanding reactive power, the reactive power provided by the flexible resources is for the DSO to guarantee a null reactive power at the TSO-DSO connection point (whose cost could be recovered from distribution tariffs or reactive power connection penalties). For a TSO need of −1 MVAr, WIND7 and WIND8 are buying, at a null market price (since the selected TSO inflexible behavior translates into buying at maximum price and selling at minimum or null price), the previously sold reactive power, no more needed by the TSO. According to Table 3, it is interesting to note that part of TSO payments (computed according to the market price and its satisfied needs) could sometimes go to the DSO when the grid is contributing to the reactive power balance, decreasing the activated commercial flexibility. In the same way, DSO could also have to complement TSO payments for the extra flexibility activation to compensate its grid reactive power behavior (as can be verified in second scenario's last table). Figure 12 shows the reactive power cleared in the second scenario, when the TSO increases its capacitive needs. Energies 2020, 13, x FOR PEER REVIEW 15 of 19 Both TSO and loads demand capacitive reactive power, which is provided by the cheaper providers, WIND7 and WIND8, with no additional PV resources needed. Figure 13 shows the bus voltages and Figure 14 the lines usage when the TSO capacitive needs increase. As can be seen, voltages decrease very slightly, due to the capacitive reactive power voltage generated by the flexible resources, which is coherent with the fact that lines saturation increases also very slightly. Between 0.2 MVAr and 0.3 MVAr, some bus voltages reach their maximum limit and WIND8 reaches the maximum capacitive reactive power it can supply, due to voltages constraints, so the TSO is not able to fulfill all its needs (with a 0.071 MVAr deficit for 0.3 MVAr demanded).   Both TSO and loads demand capacitive reactive power, which is provided by the cheaper providers, WIND7 and WIND8, with no additional PV resources needed. Figure 13 shows the bus voltages and Figure 14 the lines usage when the TSO capacitive needs increase. As can be seen, voltages decrease very slightly, due to the capacitive reactive power voltage generated by the flexible resources, which is coherent with the fact that lines saturation increases also very slightly. Between 0.2 MVAr and 0.3 MVAr, some bus voltages reach their maximum limit and WIND8 reaches the maximum capacitive reactive power it can supply, due to voltages constraints, so the TSO is not able to fulfill all its needs (with a 0.071 MVAr deficit for 0.3 MVAr demanded). Both TSO and loads demand capacitive reactive power, which is provided by the cheaper providers, WIND7 and WIND8, with no additional PV resources needed. Figure 13 shows the bus voltages and Figure 14 the lines usage when the TSO capacitive needs increase. As can be seen, voltages decrease very slightly, due to the capacitive reactive power voltage generated by the flexible resources, which is coherent with the fact that lines saturation increases also very slightly. Between 0.2 MVAr and 0.3 MVAr, some bus voltages reach their maximum limit and WIND8 reaches the maximum capacitive reactive power it can supply, due to voltages constraints, so the TSO is not able to fulfill all its needs (with a 0.071 MVAr deficit for 0.3 MVAr demanded).    Figure 15 shows the total reactive power injection of the TSO, non-flexible resources, flexible resources and lines contribution, as described in Equation (3) for increasing TSO capacitive needs. In this case, the lines' reactive power contribution is always a capacitive injection.  Table 4 shows the reactive power contribution of each player, according to Equations (11) and (12). Table 5 shows the TSO capacitive reactive power needs, the capacitive and inductive market prices, the settlement of each payer according to Equations (13)-(15).   Figure 15 shows the total reactive power injection of the TSO, non-flexible resources, flexible resources and lines contribution, as described in Equation (3) for increasing TSO capacitive needs. In this case, the lines' reactive power contribution is always a capacitive injection.  Figure 15 shows the total reactive power injection of the TSO, non-flexible resources, flexible resources and lines contribution, as described in Equation (3) for increasing TSO capacitive needs. In this case, the lines' reactive power contribution is always a capacitive injection.  Table 4 shows the reactive power contribution of each player, according to Equations (11) and (12). Table 5 shows the TSO capacitive reactive power needs, the capacitive and inductive market prices, the settlement of each payer according to Equations (13)-(15).   Table 4 shows the reactive power contribution of each player, according to Equations (11) and (12). Table 5 shows the TSO capacitive reactive power needs, the capacitive and inductive market prices, the settlement of each payer according to Equations (13)-(15).

Conclusions
This paper proposes a reactive power local market to provide reactive power to the TSO transmission grid from the resources located at the distribution grid of a DSO, where market players can sell and buy capacitive and inductive reactive power, to profit from the market mechanisms. Its main contribution is a new close to real time market design, which allows flexibility providers to supply the reactive power needed by DSO and TSO. The market is based on flexible bids, and clearing guarantees that the DSO grid constraints are respected. The iterative clearing process can include complex bids that provide additional bidding flexibility for more complex assets. This market is a step forward towards TSO-DSO coordination mechanisms in the usage of local distributed flexibility for local and system services.
Indeed, this market is one of the business use cases proposed in the TSO-DSO coordination Flexibility Hub platform of the Portuguese demonstration of the ongoing H2020 EU-SysFlex project, which is a platform to provide TSO-DSO coordination mechanisms. Although liquidity is always a concern in this type of market, it has been designed for a context where most of the resources are located at the distribution grid, the number of traditional reactive power providers has decreased significantly, and generators but also consumers have an increasing active role in the markets, providing all kind of flexibility services, and contributing to the overall grid secure operation.
Since, in the proposed market, the incomes of the market players' result from netting the sales and purchases of reactive power valuated at the market marginal (uniform) price, it is the responsibility of the market agents to determine the bidding prices that would allow them to recover operation and investments fixed costs. Note, however, that when systems evolve toward optimality, long and short-term costs tend to coincide, and pricing at the variable cost should allow for the recovery of most investments costs (except for the marginal unit, which is the one that sets the market price). However, capacity mechanisms could also be put in place to help recovering assets investment costs. Further analysis should be made, depending on different scenarios of market players, liquidity and needs, to assess the need of additional remuneration mechanisms. Additionally, as in any other market, grid topology, constraints and resources location could lead to market power situations, which should be supervised by the correspondent regulator authority.
The current work is focusing on the analysis of the impact of the grid constraints on the reactive power flexibility that the resources can provide and market power issues, the impact of complex conditions, and the reactive power TSO-DSO coordination mechanism, as well as on the potential need for additional capacity remuneration mechanisms.