**1. Introduction**

The implementation of renewable energy sources (RES) and the deployment of distributed energy resources (DER) have created a trend of evolution in the distribution network that requires the adaptation of the conventional practices to handle the behavior that is related to the RES [1]. These new procedures are compelled to have a more proactive role by the distribution system operator (DSO), controlling and/or contracting DER to deal with voltage and line/transformers congestions problems [2]. Incorporating forecast in the system operation of the DSO, as well as creating contract services with the DER, where the power flexibility is enabled to change the expected operating point, can contribute to resolve the network operational problems [3]. The power flexibility may be divided for active or reactive power, which can assist in the network problems at a certain cost. This will ensure that the DSO can maintain the ability of granting network access to consumers and producers, with power quality, safety, and stability.

The transmission system operator (TSO) and DSO coordination may be a path to explore as DSO finds here the opportunity to coordinate a reactive power service with the TSO. This coordination

intends to avoid voltage and/or congestion problems in the transmission system assuring that the distribution continues working without problems. Depending on the policies and agreements, this service can be remunerated given an extra advantage to the DERs. In fact, preventive reactive power management models are emerging as a potential solution for improving the coordination between the DSO and the TSO, while ensuring proper levels of voltage control in the system, as shown in [4].

There are many literature examples regarding approaches on reactive power management with fixed active power injection as in [5,6]. These, however, do not consider networks with strong RES penetration. A stochastic approach for ensuring voltage stability is proposed in [7]. The method considers a two-stage stochastic model with multi-objectives, such as minimization of power losses, operation, and management costs and wind power costs. Similarly, [8] proposes a stochastic model for corrective voltage control under severe contingencies, considering the uncertainty of wind power producer and consumer demand. A coordinated active and reactive optimization of an active distribution network considering energy storage systems and relaxed optimal power flow is proposed in [9]. It proposes a multi-objective function for minimizing power losses, operation costs and voltage deviation, however, the reactive power provision to assist in the TSO/DSO coordination is disregarded.

Most of these works disregard the full behavior of the distribution grid, introducing approximations and linearized versions of the full alternative current optimal power flow (AC-OPF). This can lead to sub-optimal solutions that may be infeasible. Thus, [10] proposes a voltage sensitivity analysis for adjusting the reactive power setpoint of DER in order to improve voltage stability and provide reactive power to upper levels of the network. Complementarily, [11] models an adaptive control of the reactive power setpoints of wind farms to assist the TSO/DSO coordination, minimizing the losses while ensuring proper level of reactive power provision. Still, none of these works can schedule in advance adequate reactive power setpoints for DER, considering the uncertain and variable behavior of RES.

In this scope, the main objective of this paper is to propose a stochastic reactive power management model to assist the DSO in the reactive power management ahead of the operating hour. The main contributions of this paper are threefold:


This paper is structured as follows: Section 2 describes the Portuguese reactive power policies and introduces the sequential AC-optimal power flow (SOPF) tool model; Section 3 presents the mathematical formulation of the stochastic approach for reactive power management; Section 4 validates the proposed model based on a 37-bus distribution network with real data; Section 5 presents the most important conclusions.

## **2. Reactive Power Policies**

#### *2.1. Portuguese Reactive Power Policy*

The Portuguese reactive power policy for the distribution network is based on the total inductive and capacitive reactive power that a generating unit produces in an hour [12]. The reactive power is dependent on the active power injected by the generating unit in the form of *tan* φ. The reactive power must have a deviation of less than +/−5% from the defined *tan* φ.

Each day is divided into four periods: peak, full hours, valley and super valley. Yet, reactive power has only two classifications: peak and off-peak. There are two different schemes referring to the generating units. The ordinary scheme encompasses conventional units, whereas the special scheme, RES, industrial and urban waste, cogeneration and micro-producers. The ordinary scheme is limited to *tan* φ = 0.4 for the peak period and *tan* φ = 0 for off-peak hours.

For the special scheme, Table 1 illustrates the relationship between active and reactive power.


**Table 1.** Reactive power policy for the special scheme [12].

Similarly, there is a contractual agreement between the TSO and the DSO whereby the upstream connection will have a profile of *tan* φ as regulated for the special scheme. This means that between seven–22 h the *tan* φ should be within −0.3 and 0.3 and in the remaining hours *tan* φ = *0*, with a deviation of less than +/−5% of the *tan* φ. Failure to do so results in a penalty applied to the entity responsible for the failure. This penalty is modelled in steps of *tan* φ infringement for peak hours. Equation (1) illustrates the current 3 steps violation of the limits penalties [13,14]:

$$\begin{cases} 0.3 \le \tan \phi < 0.4, \\ 0.4 \le \tan \phi < 0.5, \\ 0.5 \le \tan \phi \end{cases} \tag{1}$$

with penalty factor applied to the reference price of reactive power of 0.33, 1 and 3 for each respective step.
