Optimal D-STATCOM Placement Tool for Low Voltage Grids

: In low-voltage grids with a wide spread of domestic and/or small commercial consumers, mostly single-phase, problems can appear due to unbalanced power consumption between the different phases. These problems are mainly caused due to voltage unbalances between phases and the increase in distribution losses. This phenomenon occurs more frequently at the end of highly radial grids and can be stressed by the installation of renewable generators next to the consumers. Amongst the various techniques that have been proposed to solve this problem, this article explores the use of a D-STATCOM, presenting and testing a new method for the optimal location of this type of D-FACT. The developed method starts from a detailed analysis of the existing voltage unbalances in a distribution network and identiﬁes the optimal location of the D-STATCOM (i.e., the one that reduces these unbalances while reducing energy losses). The developed method has been successfully tested for one year at four real European locations with different characteristics and different kinds of users.


Introduction
Classical electric power generation technologies based on thermal cycles use gas, oil, or coal as the main source of energy. For years, it has been proven that the use of these fossil fuels is one of the main causes of climate change, which has resulted, among other consequences, into global warming, which is expected to reach a 1.5 degrees Celsius temperature rise by 2030 [1]. An increasing social awareness on climate change [2] and new regulations [3,4], coupled with a great technology progress and price reductions, have placed renewable energy as one of the main solutions to environmental problems.
Despite their advantages, high penetrations of renewable energies can generate problems due to their intermittent, seasonal, and uncontrollable nature. Transmission system operators (TSOs) have been facing these problems for years and distribution system operators (DSOs) are beginning to observe this due to the high diffusion of distributed generation. These new problems are forcing DSOs and TSOs around the world to develop new operation and maintenance techniques and structures in their systems [5].
Distributed energy resources (DERs) consist of small/medium-scale resources that are connected to the distribution grid at low voltage (LV) levels, near the end users [6,7], and will play a key role in the energy sector in the near future. These increased penetration levels of DER transform distribution grids into active systems. The new network structure

•
Grid reinforcing is an alternative to the congestion problems generated by the high penetration of DERs. This reinforcement is linked to technical and economic regulations [21,22]. • To solve grid congestion problems, active power limits for demand or generation (depending on the origin of the congestion) can be set. Other congestion management methods are discussed in [23].

•
To avoid introducing harmonics into the network, a good solution is the installation of conventional active power line conditioners (APLCs) and/or active power filters (APFs) to have a high harmonic filtering capability [24].

•
The connection of PV generators as three-phase systems is a good proposal to reduce losses and unbalances. Conversely, this would not be feasible because most prosumers have single-phase connection to the network [25]. • Storing energy near prosumers is another extensively studied option, which can adapt generation to consumption patterns, reducing reverse power flows and voltage increases. The cost of storage technologies should be reduced to make this solution economically viable [26]. • Support from prosumers to solve these issues is currently increasing. This is done through demand management, from which both prosumers and DSOs benefit [27]. • Reactive power control of PV inverters and wind generators dependent on the grid voltage or generated active power are solutions for the efficient use of wind and PV and enable high penetration revivals systems in distribution grids [28,29].
A recent study [30] described the methodology applied in a low voltage network in southern Spain to calculate the optimal photovoltaic hosting capacity that minimizes system losses. This paper is more influential compared to other similar studies, since it uses real data from smart meters and other data provided by the electrical distributor. The report also evaluated management techniques for solar PV inverters and their effect on the hosting capacity. As a result, as distributed PV generation increases, more voltage deviation problems occur in the network. Constant power reactive control or power factor (PF) setpoints had the best results when solving these problems.
Aside from the previous points, the use of static VAR compensator (SVC) or set voltage regulators (SVRs) is proposed to solve voltage deviations [31] and unbalances [32][33][34][35][36]. In keeping with the use of flexible AC transmission systems (FACTS), the use of a distribution static synchronous compensator (D-STATCOM) is proposed and addressed in the present document. The use of D-STATCOM systems in the distribution networks in low voltage levels can solve the problems caused by the high penetration of DER due to its ability to control frequency, amplitude, and phase of the output voltage. Compared to the passive compensators, power electronics-based active compensators exhibit better and more reliable results in the neutral current compensation process [16].
As already mentioned, voltage unbalances are local in nature and can vary in value geographically and temporally. In addition, they are strongly influenced by the characteristics of the consumption and generation points in the area, being normally higher in areas with a wide proportion of single-phase customers and at points far from the secondary transformer substation. These characteristics mean that finding the best location for the D-STATCOM is fundamental, which is the reason why there is so much literature on the subject. In fact, an incorrect placement and management of a D-STATCOM would not only limit its benefits, but may even worsen or jeopardize the proper operation of the network [37].
The most common objective functions found in the related literature are [38]: There are several classifications for the optimal D-STATCOMs' placement and sizing methods. The authors in [38] describe the following:

•
Analytical methods that propose optimal solutions without considering nonlinearities and complexities in the problems to reduce computational effort.
• Artificial neural network methods that can deal with non-linear systems and more complex problems. • Metaheuristic methods (the most spread ones). These algorithms are stochastic methodologies and population-based ones, which are generally efficient, but can propose local minimums (or maximums) as the optimal solution. • Sensitivity approaches that allocate the D-STATCOM according to the value of an index. The most common ones are voltage sensitivity index (VSI) and power loss index (PLI), calculated for the possible locations of the evaluated grid. In these methods, the D-STATCOM is not emulated and only the index is calculated, and the location with the optimal index is chosen to fit the D-STATCOM.

•
Combination of sensitivity approaches and metaheuristic methods.
For example, [39] proposed an analytical method to search along all the nodes of the grid to find the location, and the D-STATCOM power that jointly minimizes energy losses and voltage variations.
A number of authors have proposed the use of nature-inspired metaheuristic techniques to find the optimal location and dimensioning of one or more D-STATCOMs. For example, [40,41] proposed the use of particle swarm optimization (PSO) methodology to find the terminal in which the D-STATCOM would result in minimum losses in the network. The PSO is a numerical optimization method used to solve many tasks in the field of energy engineering, combining a very simple implementation and a very good convergence. The method simulates a multi-agent system, where particle agents move toward optimal solutions while exchanging information with neighbors. In the swarm method, each potential solution is represented by a point in the spatial search called the particle [42]. The algorithm of the PSO represents an iterative method that continues until the stop criterion is met.
Other metaheuristic approaches proposed for the optimal placement of a D-STATCOM are the harmony search method (HSM) [37] or ant colony optimization (ACO). In [43], the ACO algorithm was used to calculate the optimal placement, size, and amount of D-STATCOMs and incorporated the cost of the devices within the optimization process.
As an example, [44][45][46] proposed the use of a sensitivity approach by calculating the VSI for all nodes of a grid and choosing the location of the D-STATCOM as the one with the highest voltage sensitivity index value. Other works delve into the index approach: [47] proposed variations on the VSI calculation to optimally locate and size D-STATCOMs. Reference [48] used the sensitivity approach through the VSI to increase reactive loading capability and to improve voltage profiles; in [49], they presented a probabilistic technique for optimal allocation of the D-STATCOM, considering the correlation between uncertain variables and improving the expected voltage deviation index (VDI) and decreasing the expected installation cost for D-STATCOM in radial/mesh distribution networks.
The authors in [50] proposed a combination of sensitivity approaches and metaheuristic methods such as VSI and the grey wolf optimizer (GWO) metaheuristic algorithm for optimal placement and sizing of a solar PV facility and a D-STATCOM. The study in [51] presented a new lightning search algorithm (LSA) combined with the VSI index. The studies in [52,53] proposed a genetic algorithm (GA) and PSI and VSI indexes to optimally locate a D-STATCOM.
In this context, the contribution of the present paper can be summarized as: • The proposal of a novel methodology to find the optimal location of a single fixed power D-STATCOM for distribution loss reduction through voltage unbalance compensation. None of the reviewed documents deal with this issue of voltage unbalance.

•
The proposed methodology was tested using the data obtained from four real grids during a whole year. These were located in four different European countries and have different characteristics and topologies: urban, rural, residential, etc.
The proposed method works in two steps: first, to identify the locations most likely to host the device, and a second in which the effect of a single D-STACOM of a predefined power is emulated at these points and their neighbourhood. The initial search field was determined by locating the nodes of the network with the most voltage unbalances. The search process in neighboring nodes to those initially proposed has been proven to be simple and effective. The proposed method can be considered as a combination of sensitivity approaches and metaheuristics methods: the voltage unbalance would be the sensitivity index that provides the initial search space, and the proposed neighborhood search is a variation of the "variable neighborhood search" method [54]. Other documents that propose combinations of sensitivity approaches and metaheuristics methods focus on voltage sensitivity and power loss indices. As far as the authors are aware, this is the first paper focusing on reducing voltage unbalances and the energy losses associated with this phenomenon.
In Section 2, the proposed methodology is described. In Section 3, the results of applying this tool to four real networks are presented. In the Discussion and Conclusions sections, the results obtained by the proposed methodology are commented and finally, the main conclusions obtained through this work are highlighted and future lines of development are proposed.

Materials and Methods
The objective of this optimal D-STATCOM placement tool was to find-in low voltage distribution grids-the node where a D-STATCOM with predefined characteristic minimizes distribution energy losses by balancing phases and compensating reactive power consumption.
To develop, test, and debug this tool, real data from different distributors have been used. The selected demonstrators are listed below (complete descriptions of these networks can be seen in Appendix A):  The methodology to detect unbalances in the network and to correct them by using a D-STATCOM installed in the optimal location is explained in detail in the next sections.

Energy Loss Minimization
The objective of this optimization process is minimizing distribution energy losses by minimizing the sum of the losses generated in all sections of the network analyzed and over the period studied. The objective function is Equation (1): where n is the number of lines in which losses are generated and t is the number of time steps in which the period under analysis is divided. The constraints are those of a power flow: • Line currents and nodes voltages. A second group of constraints were the ones that describe the node characteristics: the nodes able to host the D-STATCOM must be underground and three-phase.

Algorithm Description
The proposed methodology operates in two steps or stages (see Figure 1):

1.
Unbalance detection stage: it detects nodes in which unbalances are higher than the established limit. 2.
D-STATCOM location stage: it uses the points of major unbalance provided by the previous step to emulate the D-STATCOM behavior and to find its optimal location. In this stage, the proposed methodology analyzes, in an iterative process, the list of 10 nodes with higher voltage unbalance and the neighborhood points.

Unbalance Detection Stage
The "unbalance detection phase" detects the unbalances that occur in the network due to: • Three-phase consumers not consuming in a balanced way.
In the first step, the conditions to be satisfied by the connection points ("pre-processing lines") for the possible installation of D-STATCOM are determined. Several conditions have been set:

•
The line must be three-phase. This refers to the fact that D-STATCOM compensates the three phases so the line should be three-phase.

•
The lines should be in service.
Quasi-dynamic analysis is used to calculate the hourly load flow, and then the unbalances between phases are extracted from it. The quasi-dynamic analysis granularity and duration depend on the available data. In the four scenarios tested in this paper, the work was performed in hourly intervals for one year.
After the load flow calculation, the unbalance of voltage between phases is analyzed and, if a terminal has an unbalance higher than a pre-established threshold, it is added to the list of nodes that could host the D-STATCOM. Figure 2 shows the flowchart of the unbalance detection stage.
For each hour of the analyzed period, the process shown in Figure 2 was executed, in which the existing unbalances between the three phases (A, B, C) at the initial (i) and final (j) nodes were calculated. Only the unbalances between phases (Uab, Uac, Ubc) that exceeded the maximum limit were stored and considered as candidates to host the D-STATCOM. This limit (adaptable to the regulations applicable to the analyzed network) was set at 2%, as per the EN50160 standard [56].
In post-processing, the terminals were sorted based on the following priorities: 1.
Number of unbalances occurrences in the period studied.

2.
Average unbalance between phases AB, AC, and BC in the period studied.

3.
Maximum unbalance between phases AB, AC, and BC in the period studied.
This order is logical because the maximum power of the D-STATCOM is fixed at 30 kVA and selecting a location to solve high but infrequent unbalances can make it underused. Therefore, the nodes at the top of the list as per the sorting order explained above are the most appropriate to host the D-STATCOM and are used in the next phase of the methodology. In this case, 10 nodes were chosen as the starting point, although this number could be modified depending on factors such as the size of the network or the ratio of single-phase or unbalanced consumers with respect to the total consumers.

D-STATCOM Location Stage
The aim of the "D-STATCOM location" stage is to find the location of the D-STATCOM that minimizes distribution energy losses, see Figure 3. For this purpose, the ten candidate locations obtained from the "unbalance detection" stage were taken as a starting point. In a second phase of this process, the initial search space is extended by adding neighboring nodes. In a process similar to the methodologies based on PSO techniques [57], once the effect of the D-STATCOM has been calculated at one point, its potential effect on the neighboring nodes can be analyzed. If the loss reduction in one of the new nodes is greater than in the initial node, this new node is taken as a reference and a new analysis is launched for the neighboring nodes. This process is repeated until no improvement in the result is obtained and, as a result, the node where the distribution losses are minimal is chosen as the optimal place for the D-STATCOM.
The "D-STATCOM location" stage works in four steps for every node analyzed. In the first one, a load flow is calculated for the whole period analyzed without considering the possible effect of the D-STATCOM. As a result, the distribution losses are obtained by calculating the sum of the losses in lines and the sum of the losses of the secondary substation (Losses = ∑ Losses Lines + Losses Secondary substation ) using DIgSILENT PowerFactory. This will be used as a reference in the subsequent steps. In the second step, the D-STATCOM set-points that would reduce the network unbalances at the studied node are calculated for each moment of the analyzed period. As previously mentioned, the D-STATCOM reduces voltage unbalances at a node by exchanging energy between phases to balance the node's power output to an average level, common to all three phases (see Equation (2)). For example, if phase A consumes +10 kW, phase B consumes +20 kW, and phase C consumes +12 kW, its average power consumption would be +14 kW (see Figure 4). In phases A and C, which have a consumption lower than 14 kW, the D-STATCOM would be "add consumption": in phase A, it would be 4 kW while in phase C, it would be 2 kW. On the other hand, in phase B, the output power is higher than the average, so D-STATCOM should "provide" 6 kW, which will be gathered from phases A and C (see Figure 5). In other words, D-STATCOM exchanges power between phases.
Average active power :  Once the operating setpoints of the D-STATCOM that balance downstream consumptions (and thus node voltages) have been obtained, the third step of the process takes place. A new load flow is launched and energy losses are calculated over the entire period under evaluation, this time taking into account the effect of the D-STATCOM (a wide description of the emulated D-STATCOM is shown in Appendix B). In the fourth and last phase of the process, the initial losses are compared with the losses that occur when using D-STATCOM, and a reduction in distribution energy losses is observed.
These four steps were applied to all analyzed nodes. It started with the initial 10 nodes and was extended through the neighborhood until no improvement in loss reduction was observed and the highest loss minimizing node was chosen as the optimal D-STATCOM location.

Results
The methodology described in the previous sections was tested and validated through its application in four real distribution grids. These networks, described in Appendix A, have different characteristics and different kinds of users (consumers, prosumers and generators). Therefore, the proposed methodology has been tested in different and representative (current and future) European low voltage distribution grids:

•
Southern Europe rural grid. The methodology was initially developed, tested, and validated in this grid due to the availability of a large amount of quality data. • Northern Europe urban-residential grid. The methodology was applied to this network.

•
Central Europe rural-residential grid. The methodology was applied to this network. • Southern Europe urban grid. The methodology has been applied to this network.
The proposed methodology, although developed with the Southern Europe rural grid, is flexible to be used in other grids independent of its size, consumer type, or other characteristics. The next subsections show the results of applying the D-STATCOM optimal placement methodology to the distribution grids above-mentioned. The results are also analyzed in these subsections and in Section 4.
The D-STATCOM emulated and optimally placed in this document is being developed by the CIRCE Foundation in the PARITY Project (https://parity-h2020.eu/, accessed on 20 April 2021). This equipment consists of a 4-leg AC/DC converter that allows single-phase controllability, basically for the voltage unbalance compensation. More information about the device is provided in Appendix B.

Southern Europe Rural Grid
This network has 259 supply points including four prosumers (domestic consumers that have solar PV generation devices on their buildings). Besides the generation facilities of the prosumers, there is a 120 kWp photovoltaic plant connected to the distribution network (three-phase, built up from three 40 kWp facilities). Real customer data, obtained from smart meters for one year were used for network analysis and tool development and testing.
As explained in Section 2, the first step of the methodology, the "Unbalance detection stage" generates a database with all the points of the grid presenting unbalances higher than the established limit. This database is sorted according to the values of average and maximum unbalances as well as the number of unbalance events existing during the studied time. Table 1 and Figure 6 identify, characterize, and locate the 10 most unbalanced points of the grid. In the second step of the methodology, the "D-STATCOM location stage" calculates the grid energy losses reduction, emulating the placement of the D-STATCOM in different points and comparing it with the initial energy losses, when no D-STATCOM is used. Starting from the 10 most unbalanced nodes, a neighborhood search is carried out to find the location in which the loss reductions is the highest (i.e., the optimal D-STATCOM location). Table 2 shows the results of the application of this second stage to the initial 10 nodes, and Tables 3 and 4 show the results of the neighborhood search application until the optimal node is found. Finally, Figure 7 shows the optimal placement of the D-STATCOM in the Southern Europe rural grid. These tables show the grid energy losses with and without the use of the D-STATCOM and the energy losses reductions, in kWh and in percentage.   As can be seen, the optimal location of the D-STATCOM was not in the initial list of the 10 most suitable points, but was found using the proposed neighborhood search method. This can be because the initially analyzed points had higher average unbalance values, but these unbalances were not continuous and saturated the D-STATCOM, so it could not fully compensate for these high unbalances and the rest of the time, it was not working. On the other hand, the optimal point, although having lower average unbalances, could be more continuous in time and the D-STATCOM was used more efficiently for a longer period of time.
The effect of the D-STATCOM on the network studied was verified and it was observed that the voltage unbalances in the feeder where the equipment had been installed had been reduced, both in terms of value and number of occurrences. The initial three most unbalanced points with the effect of D-STATCOM fell to 19th, 22nd and 23rd ranks of unbalance, as shown in Table 5.
As shown in Table 6 and in Figure 8, the new 10 most unbalanced nodes were located in a different feeder to which the D-STATCOM was located. In fact, these nodes maintained the initial unbalance values, highlighting the local characteristics of voltage unbalances originated by unbalanced demands and the local effect of the D-STATCOM.  Ultimately, in this first grid, the correct behavior of the methodology was verified by applying it to 33 additional nodes and their neighborhood. In total, from the 869 nodes of the grid, the methodology was applied to 33 points and their neighborhoods, 70 nodes in total within the entire grid. Table 7 shows that no nodes with extra energy loss reductions were found, therefore, the proposed method can be considered correct and able to find the optimal location in the analyzed network. This last point, coupled with the characteristics in voltage unbalances (local and at the end of radial feeders suppling energy to single phase consumers), suggests that the proposed process can optimally locate a D-STATCOM in LV distribution grids.

Northern Europe Urban-Residential Grid
This network has 85 connection points (for consumers, prosumers, and generators). There are five prosumers with generation facilities of 5 or 6 kWp, all of which are threephase. Among these supply points, there are three photovoltaic generation plants (threephase and 31 kWp each). Figure 9 shows the location of the 10 most unbalanced nodes and Table 8 shows the energy loss reduction obtained by the D-STATCOM for each of them.
The application of the methodology and the neighborhood search showed no improvements in the energy losses reduction, so the initial best location was the definitive best location for the D-STATCOM in the Northern Europe urban-residential grid, as shown in Figure 10.  Table 8. Energy losses with and without D-STATCOM and energy loss savings in the 10 most unbalanced nodes (Northern Europe urban-residential grid).

Central Europe Rural-Residential Grid
This network has 25 supply points. Five of these points are prosumers. The photovoltaic generators of the prosumers are three-phase and their power is between 4 and 27 kWp. Figure 11 shows the location of the 10 most unbalanced nodes and Table 9 shows the energy losses reduction achieved by the D-STATCOM in these nodes. Figure 11. Central Europe rural-residential grid (the 10 most unbalanced points are shown in blue). Table 9. Energy losses with and without D-STATCOM and energy losses savings in the 10 most unbalanced nodes (Central Europe rural-residential grid). The application of the methodology and the neighborhood search showed no improvements in the energy loss reduction. The initial best location was the definitive one for the D-STATCOM in this grid, as shown in Figure 12.

Southern Europe Urban Grid
This network has 193 supply points, two of them are prosumers. The photovoltaic generators are three-phase with 14.3375 kWp each. Figure 13 shows the location of the 10 most unbalanced nodes and Table 10 shows the energy loss reduction obtained by the D-STATCOM.   Figure 14 shows the optimal placement of the D-STATCOM in the Southern Europe urban grid. As can be seen, the optimal location of the D-STATCOM was not in the initial list of the 10 most suitable points, but was found using the proposed neighborhood search method. The most suitable point was "Terminal 23" in the neighborhood of "Terminal 27" (see Table 11).

Discussion
The proposed method, unlike others mentioned in the literature review in the initial sections of this document, focused on the location of a single D-STATCOM in the low voltage network, while other studies have dealt with the location and sizing of this type of element. In contrast to other works, the present paper focused on the use of the D-STATCOM to avoid voltage unbalance between phases and reduce the associated energy losses. These two points allow for the development of a simple, as opposed to complex, genetic algorithm or PSO and other variants, and an accurate method for the optimal placement of a D-STATCOM of a fixed power to reduce unbalances or voltage and reactive compensation.
The results showed that the algorithm presented allows, in the first stage, for the identification of the network nodes with the highest voltage unbalances (caused by unbalanced consumption) and then to choose among them (and those geographically and electrically close) the one where the effect of the D-STATCOM is most efficient.
The major limitation of the presented method is that it requires a large amount of data: (i) an accurate modeling of the target distribution network is necessary, and (ii) it needs sufficiently long-and representative-time measurements of consumption and generation.
One of the main implications of the developed method, which is both simple and effective, is that the use of D-STATCOM devices in real distribution networks could become more common, given their great potential to avoid or at least reduce the problems that exist or may exist in the low voltage networks of the future. Table 12 shows the summary of the results of applying a D-STATCOM in the four example grids in their optimal locations, highlighting energy loss reductions and economic savings in each of the grids. As can be seen, the main advantages of the use of this equipment in networks are not directly economic, but technical by improving the balance of the network, the durability of the equipment by working with balanced consumption and voltages, and efficiency by reducing technical losses in the distribution network, which indirectly translates into better remuneration for the DSO, in Spain, for example. Further developments of the proposed method for the optimal placement of D-STATCOM devices in the short-term can consider:

•
Modeling in more depth the economic aspects of D-STATCOM deployment such as lifetime O&M costs, installation costs, and reactive compensation effect and economic evaluation.

•
Modeling the reactive power compensation and other D-STATCOM functionalities.
In the medium-term, it is proposed to extend the tool to determine not only the optimal location, but also the optimal number of D-STATCOM devices.

Conclusions
A high rate of single-phase consumers in low-voltage distribution networks can lead to demand unbalances between phases, resulting in voltage unbalances and increased losses, among other problems. These problems could increase in the near future, as distributed generation technologies are expected to become more widespread. Several techniques have been proposed to avoid, or at least reduce, these problems: demand management, use of electrical energy storage to adapt consumption to hypothetical energy generation, etc. This article proposes the use of D-STATCOM devices to reduce voltage unbalances and take advantage of their characteristics to compensate reactive power in times of balanced voltages.
In order to take advantage of the potential of these D-STATCOM devices, a methodology was developed, applied, and tested for the optimal location of a single D-STATCOM of a predefined power in a low voltage network. The developed method was based on an in-depth analysis of a distribution network to identify the points with the highest unbalances, in average value, throughout the year, and then search in these points and in their neighborhood for the point where the positive effect of the D-STATCOM was greatest. This simple approach is sufficient to solve these voltage unbalance problems, which were concentrated at the ends of long and radial distribution networks in most of the cases. This methodology has been proven to work in four real networks of different characteristics and different locations in Europe. for supporting the research carried out and providing information on their distribution grids. We would also like to thank all the project partners for their support and expertise. which was essential for the development of this research.

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

Appendix A
In this annex, a description of the low voltage grids used to develop and test the tool is shown: Southern Europe rural grid, Northern Europe urban-residential grid, Central Europe rural-residential grid, and Southern Europe urban grid. This description is highlevel, providing general data, but not personal information or sensitive network or DSO data: main characteristics of transformers and wires, general demand curves of connected users, power of DERs, etc.

Appendix A.1 Southern Europe Rural Grid
This network has single and three-phase consumers, prosumers, and photovoltaic generators, which makes it representative of future electric grids and makes it a good framework for algorithm development and testing. Figure A1 shows the one-line diagram of the Southern Europe rural grid network in which each of the branches can be seen in different colors.   Figure A2 show the main characteristics of the transformer and the voltage profile in the low voltage side of the secondary substation in a representative day.  All the lines of the network have been modeled according to the values in Table A2. This table shows the characteristics of the cables used: conductor voltage, maximum allowed current, cable type, resistance, reactance, and inductance. The distribution network has 259 supply points. Four of them are prosumers (PV generation in domestic buildings). These loads are organized into six different power branches connected to the secondary substation.
Real customer measurements were used for network analysis and tool development and testing. These measurements were obtained from smart meters for one year. As an example, Figure A3 shows a single-phase consumption profile example of two customers: Figure A3. Active power profiles of different consumers.
In addition to the prosumers' generation facilities, there is a 120 kWp photovoltaic plant (three-phase, built up from three 40 kWp facilities) connected to the distribution network, connected through three inverters (PV1, PV2, and PV3 in Table A3).

Appendix A.2 Northern Europe Urban-Residential Grid
This network has different type of consumers: family houses, distributed solar PV prosumers, and different types of consumption points as outdoor swimming pools and EVs. This combination of consumers, generators, and consumption technologies makes this grid representative to be used as a test bed for the D-STATCOM optimal placement tool. Figure A4 shows the one-line diagram of the Northern Europe urban-residential network. Figure A4. Northern Europe urban-residential network topology. Table A4 summarizes the characteristics of the secondary substation transformer.  Table A5 shows the characteristics of the cables used: conductor voltage, maximum allowed current, cable type, resistance, reactance, and inductance.
In this network, as not all the consumption profiles were available, different common profiles for consumers, electric vehicles, and outdoor swimming pools have been developed and considered: • Figure A5 shows an example profile of a consumer of 5 MWh per year. To see consumption in more detail, the 24-h profile is shown in Figure A6. • Figure A7 shows the proposed consumption of an EV in one day. As a simplification, it has been supposed that the same charging profile for the entire year of study and for all users.

•
In Figure A8, the consumption of an outdoor swimming pool is shown. The operation of this demand point is supposed to cover seven months, from April to September.     The Northern Europe urban-residential network has 85 supply points (consumption and generation). Among them, there are three photovoltaic generation plants whose main characteristics are shown in Table A6. On the other hand, there are customers who generate for their self-consumption (prosumers). In this network, there are five prosumers, who have a single smart meter so their profile is the sum of the profile consumed + generating profile by the photovoltaic. The summary of photovoltaic generation can be seen in Table A7.  This network has consumers, prosumers, and distributed generation. Figure A9 shows the one-line diagram of the Central Europe rural-residential network.    Table A9 shows the characteristics of the types of cables used: conductor voltage, maximum allowed current, cable type, resistance, reactance, and capacitance.
The distribution network has 25 supply points. Five of them are prosumers (PV generation in domestic buildings). The photovoltaic generators' main characteristics are shown in Table A10. Appendix A.4 Southern Europe Urban Grid Figure A10 shows the one-line diagram of the Southern Europe urban grid.   Table A12 shows the characteristics of the types of cables used: conductor voltage, maximum allowed current, cable type, resistance, reactance, and inductance. The distribution network has 193 supply points. Two of them are prosumers (PV generation in domestic buildings). The photovoltaic generators' main characteristics are shown in Table A13.

Appendix B
The D-STATCOM emulated and optimally placed in this document is being developed by CIRCE Foundation in the PARITY Project. This equipment consists of a 4-leg AC/DC converter, similar to the one shown in Figure A11. This 4-leg D-STATCOM works as three single-phase converters (i a , i b , i c show current phases in the figure) connected through their DC-link [58]. In a single-phase converter, the current path is closed through the neutral wire. Unlike three single-phase converters, in a 4-leg converter, the three neutral wires merge into one (i a + i b + i c are the current in the neutral), through which the currents of the three phases will return. Thus, unlike common 3-wire converters, a 4-wire D-STATCOM allows single-phase controllability, extending the operating points to unbalanced loads and allowing independent active and reactive power setpoints in each phase.

Appendix B
The D-STATCOM emulated and optimally placed in this document is being deve oped by CIRCE Foundation in the PARITY Project. This equipment consists of a 4-le AC/DC converter, similar to the one shown in Figure B1. This 4-leg D-STATCOM work as three single-phase converters (ia, ib, ic show current phases in the figure) connecte through their DC-link [58]. In a single-phase converter, the current path is closed throug the neutral wire. Unlike three single-phase converters, in a 4-leg converter, the three neu tral wires merge into one (ia + ib + ic are the current in the neutral), through which th currents of the three phases will return. Thus, unlike common 3-wire converters, a 4-wir D-STATCOM allows single-phase controllability, extending the operating points to un balanced loads and allowing independent active and reactive power setpoints in eac phase. Figure B1. The 4-leg bi-level AC/DC topology. The D-STATCOM developed has a three-level topo ogy, which achieves a lower harmonic content and a passive component size reduction compare to bi-level converters.
The 30 kVA D-STATCOM under development does not have energy storage, load o power source and, consequently, the energy entering one or two phases must be returne to the grid through the others [59]. This operation and the constructive characteristic makes D-STATCOM of a great potential as DER to fulfil the next functions: • Line current balancing. As above-mentioned, single phase loads produce differen current flows in each phase of the network and also different voltage drops in eac phase, affecting the power supply quality. This unbalance also increases the neutra current, requiring an oversizing of neutral cables and reducing energy efficiency an Figure A11. The 4-leg bi-level AC/DC topology. The D-STATCOM developed has a three-level topology, which achieves a lower harmonic content and a passive component size reduction compared to bi-level converters.
The 30 kVA D-STATCOM under development does not have energy storage, load or power source and, consequently, the energy entering one or two phases must be returned to the grid through the others [59]. This operation and the constructive characteristics makes D-STATCOM of a great potential as DER to fulfil the next functions: • Line current balancing. As above-mentioned, single phase loads produce different current flows in each phase of the network and also different voltage drops in each phase, affecting the power supply quality. This unbalance also increases the neutral current, requiring an oversizing of neutral cables and reducing energy efficiency and making failures more frequent. Figure A12 shows that the current injected by the D-STATCOM compensates for the unbalanced current demanded by consumers, so that current upstream is balanced and neutral current has been removed. • Reactive compensation. Related to the previous point, reactive power compensation reduces power loses and voltage drops, improving the network operation. • Voltage regulation. Similar to large STATCOMs used in transport network, a D-STATCOM can take advantage of the Ferranti effect to support voltage regulation in grid lines. In addition, this regulation can be carried out in a single-phase mode, applying an independent volt-var curve in each phase.
Another two benefits of the D-STATCOM to be highlighted are that due to the low harmonic emission, no additional filters are required and its high switching frequency over the audible spectrum makes it completely silent in operation and compatible with inhabited environments. Moreover, as Figure A12 shows, the D-STATCOM is shunt connected to the grid, allowing a safe disconnection when its operation is not required, avoiding power losses. Figure A12. Line current balancing (phase currents in blue, neutral current in pink). The unbalanced current demanded by consumers is measured by the D-STATCOM, that calculates and injects the current required to balance the line.