*4.2. Results*

The tool will attempt, by using capacitor banks, transformers with OLTC and DER, to contract optimal reactive power flexibility and with this, meet the desired reactive power profile defined by the DSO.

It is important to note that active power production in the DERs is fixed according to the previous forecast of the energy dispatched for each hour. Wind power plants have a forecast point determined for the next 24 h along with 10 possible hourly scenarios, as in Figure 3.

**Figure 3.** Point forecast and scenarios of the wind power plant 1 throughout 24 h.

Using wind active power as an input and considering the flexibility limits, the expected reactive power production operation is determined by the tool for each operation hour point. The *tan* φ of both wind power plants is kept within the +/−5% range in every scenario. Figure 4 shows the evolution of *tan* φ overtime for the wind power plant 1.

**Figure 4.** Forecasted and realized tan φ of the wind power plant 1 throughout 24 h.

Figure 5 depicts the tan φ profile at the substation. As was predicted, the *tan* φ values are as close as possible to 0.3 between 7–22 h and a value of 0 for *tan* φ for the other hours, for every scenario, to guaranty that no penalties to be applied to the DSO. DERs reactive power generation, the capacitor banks and the transformers with OLTC ability have an important role in securing this result.

**Figure 5.** Forecasted and realized *tan* φ at the main substation throughout 24 h.

Figure 6 shows the reactive power production of capacitor bank 1. The level of reactive power varies according to the DSO needs. For periods between 22:00 and 07:00, the level of reactive power production is high, reaching the maximum production in some periods. During the day, the reactive power production of the capacitor bank comes to zero, since the TSO is injecting a significant amount of reactive power which is sufficient to support the system. It is also worth mentioning that the step position does not change more than four times per day, which reduces equipment degradation over time.

**Figure 6.** Reactive power production of capacitor bank 1 throughout 24 h.

Capacitor bank 2 follows the same behavior as capacitor bank 1, as can been seen in Figure 7. In fact, as capacitor bank 2 is much smaller than capacitor bank 1, the capacitor bank 2 is often used to complement the reactive power between steps of the capacitor bank 1.

**Figure 7.** Reactive power production of capacitor bank 2 throughout 24 h.

As with the capacitor banks, OLTC tap changes are reduced, even maintaining the same position throughout the 24 h. It is noteworthy that as the optimization considers the day-ahead forecast point, it leads to the modification of the OLTC tap hourly positions (Figure 8). Note that both transformers present the same behavior as presented in Figure 8.

**Figure 8.** Transformer 1 with OLTC ability throughout 24 h.

#### **5. Conclusions**

This work proposes a new tool to be used by the DSO in reactive power management, exploiting DER flexibility. It explores the use of a two-stage stochastic model that manages the uncertainty of wind power producers. With this tool, TSO reactive power requirements can be provided by contracting the service to the DSO, which may be an alternative to investments in reactive power control equipment in the transmission network. Simulations were done for a 37-bus distribution network, whose results demonstrate the feasibility of the proposed tool. The selection of the DER that could provide reactive power flexibility, under the different operation conditions introduced, was proven and the service was provided to the TSO.

**Author Contributions:** Conceptualization, T.S. (Tiago Soares), L.C., H.M., T.S. (Tiago Simão) andM.L;Methodology, T.S. (Tiago Soares), L.C. and H.M.; Software, T.A. and T.S. (Tiago Soares); Validation, T.A., T.S. (Tiago Soares), L.C. H.M., T.S. (Tiago Simão) and M.L; Visualization, T.A. and T.S. (Tiago Soares); Writing—original draft, T.A., T.S. (Tiago Soares), L.C. and H.M., Writing—review & editing, T.A., T.S. (Tiago Soares), L.C., H.M, T.S. (Tiago Simão) and M.L.

**Funding:** This work was financed by the European Union's Horizon 2020 through the EU framework Program for Research and Innovation 2014–2020, within the EU-TDX-ASSIST project under the agreement No. 774500. This work was also supported by national funds through Fundação para a Ciência e Tecnologia with reference UID/CEC/50021/2019.

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