A Virtual Tool for Load Flow Analysis in a Micro-Grid

: This paper proposes a virtual tool for load ﬂow analysis in energy distribution systems of micro-grids. The solution is based on a low-cost measurement architecture, which entails low-voltage power measurements in each secondary substation and a voltage measurement at the beginning of the medium voltage (MV) feeder. The proposed virtual tool periodically queries these instruments to acquire the measurements. Then, it implements a backward–forward load ﬂow algorithm, to evaluate the power ﬂow in each branch and the voltage at each node. The virtual tool performances are validated using power measurements acquired at the beginning of each MV feeder. The uncertainties on each calculated quantity are also evaluated starting from the uncertainties due to the used measurement instruments. Moreover, the inﬂuence of the line parameter uncertainties on the evaluated quantities is also considered. The validated tool is useful for the online analysis of power ﬂows and also for planning purposes, as it allows verifying the inﬂuence of future distributed generator power injection. In fact, the tool is able to o ﬀ -line perform the load ﬂow calculation in di ﬀ erently distributed generation scenarios. The micro-grid of Favignana Island was used as a case study to test the developed virtual tool.


Introduction
The growing demand to increase the percentage of renewable energy and reduce diesel consumption led the distributor system operator (DSO) of micro-grids, as those of small islands, to carry out an analysis in order to verify the safety management of the power grid and to redesign it in case it does not satisfy the grid constraints. In such islands, several issues arise in terms of power system safe operation and planning [1][2][3][4][5][6][7], considering the specific characteristics of these kinds of distribution networks, which are relatively small, with a high variability between the winter and summer loads and not always sufficiently covered by public communication infrastructures. Apart from actual energy policies and regulatory frameworks, or technical capabilities enabled by advanced modeling and analysis tools, an important issue for effectively increasing the distributed generation and storage systems presence in distribution networks is the possibility for DSOs to achieve new simple and versatile tools for power system monitoring and management purposes. These tools have to be based on proper communication and measurement infrastructures, which should be feasible • the cost of the measurement infrastructure; • the availability and the cost of communication systems from public or private providers or eventually the installation cost of a dedicated infrastructure; • the high-load variability connected with the seasonal tourist influx; • the high sensitivity to distributed generation uncertainty, especially in low load seasons, which can cause a high variation of the required power and consequently high voltage and frequency variation in the network.
In this paper, these aspects are considered, for proposing solutions especially tailored for the case of an island's distribution network. The basic aim of this work was the development of a feasible tool for load flow analysis and power system planning, based on a low-cost distributed measurement system. The proposed solution has been implemented on-field, on the real distribution network of the Island of Favignana (Italy, Mediterranean Sea). To fully investigate the suitability of the proposed solution, it has to be characterized by the means of an uncertainty analysis, considering both the real measurement data and the network parameters uncertainty propagation on the power flow estimations. Experimental results are presented to validate the algorithm and verify its capability to evaluate in real time the power flows with good accuracy. Furthermore, off-line simulations based on real measurement data have been carried out, showing how the proposed virtual tool is also useful to study Energies 2020, 13, 3173 3 of 25 the impact of distributed generation in an isolated network. The proposed solution allows addressing all the aforementioned issues in terms of reduced costs, thanks to the use of low-cost instrumentation communication infrastructures, without affecting the capability for the real-time evaluation of the power flows and to plan the network improvement, avoiding critical situations due to the distributed generation and loads variability.
In detail, an ad hoc monitoring system is used, which is particularly suitable for a small island, because of its reduced cost and simplicity of installation. The solution is based on the use of power quality analyzers (PQAs) in distribution network substations, which are less expensive than PMUs. Moreover, they are installed at the low-voltage (LV) side of power transformers, thus reducing installation costs; these last could be even null, if smart meters are already installed by DSO for energy theft detection purposes. Starting from LV active and reactive power measurements acquired by these instruments in each secondary substation, the authors developed a backward-forward load flow (BF-LF) algorithm, which allows determining all the other network state variables [48][49][50].
The algorithm requires only one additional voltage measurement at medium voltage (MV) bus-bars of the central generating station; typically, this measurement can already be available in a real distribution network, thus no extra costs are needed for further instrumentation. Thanks to its low computation cost and simplicity of implementation, the BF-LF algorithm is a good solution for this kind of small distribution network. As regards the communication between the substation meters and DSO control center, a wireless HiperLAN-based architecture is used which is particularly suitable in the case of small islands, thanks to their orography. Starting from the aforementioned distributed measurement infrastructure, a virtual instrument (VI) has been developed and implemented, which is able to query all the installed PQAs to acquire the measurement data and to perform the load flow calculation of the whole network. The algorithm was implemented in a LabVIEW environment, because it allows assuring a highly readable and simple use. As regards the metrological characterization of the developed system, a Monte Carlo procedure is also implemented to perform an uncertainty analysis of the calculated power flows, considering the input uncertainties on both the real measurement data and the network parameter knowledge. The presented results show how the proposed architecture allows monitoring the power system in real-time and with good accuracy. Furthermore, the measurement data are acquired and stored in a database; this allows running the offline simulation; in this way, the validated software tool can also be used to perform the simulation of photovoltaic penetration scenarios and to observe its impact on power flows. This paper is organized as follows. In Section 2, the monitoring architecture and the developed virtual tool for load flow analysis are described, including the implementation of the uncertainty evaluation algorithm, used for the characterization of the load flow analysis accuracy starting from on-field measurements. In Section 3, the implementation of the proposed solution is presented for the real case study of Favignana Island micro-grid. In Section 4, the algorithm is validated with real measurement data, evaluating also all the uncertainty contributions. Finally, in Section 5 the virtual tool is used to perform a simulation of different scenarios of photovoltaic generation.

Monitoring Architecture and Virtual Tool for Load Flow Analysis
The observability of distribution networks in real time is the base element for a proper grid management, maintaining its stability and correct operation. Currently, most MV distribution networks around the world are scarcely monitored. Few measurement instruments are usually installed and DSOs are not able to perform a real-time load flow of the whole network. As already mentioned, this is mainly due to the intrinsic costs of a monitoring solution, which entails the costs of the measuring equipment, MV transducers and communication network. A solution to reduce these costs is shown in Figure 1. In this solution, the authors proposed to use PQAs at the LV side of the power transformer in each secondary substation and a further PQA at the MV bus-bars in the generating substation [48]. The developed virtual tool is installed in the DSO control center. It queries all PQAs and performs the load flow analysis. To this aim, a proper BF-LF algorithm was implemented. The algorithm uses as input the measured active and reactive powers of each load and the voltage at the MV bus-bars of the generating substation. Thanks to these measurements, the algorithm is able to univocally determine all the unknown state variables, i.e., node voltages and branch power flows.
The PQA at the MV bus-bars also allows measuring active and reactive powers at the beginning of the feeder; these data are not used by the BF algorithm; they will be used in Section 4 to validate the algorithm performances instead. The block diagram for the BF algorithm implementation in LabVIEW is shown in Figure 2, where:


V is the array of node voltages;  FP and FQ are the arrays of the active and reactive power flows, respectively;  PL measured and QL measured are the arrays of the measured active and reactive powers, respectively;  DeltaP is the array of the calculated power losses in the network;  VMT is the voltage used as reference for the slack bus: its module is equal to the value measured at MV bus-bars, i.e. V measured, and its phase is assumed as 0;  Tol module and Tol phase are the thresholds used as tolerance in the load flow algorithm; Two different sequence frames are used for backward and forward sweeps on the whole network: the backward sweep calculates the power flows in each branch, and the forward sweep calculates the node voltages. These two frames are included in a while loop, thus they are repeated until a convergence condition is met on both the amplitude and the phase of the voltage at each node (at each iteration, this condition is verified in the third sequence frame). To this aim, a proper BF-LF algorithm was implemented. The algorithm uses as input the measured active and reactive powers of each load and the voltage at the MV bus-bars of the generating substation. Thanks to these measurements, the algorithm is able to univocally determine all the unknown state variables, i.e., node voltages and branch power flows.
The PQA at the MV bus-bars also allows measuring active and reactive powers at the beginning of the feeder; these data are not used by the BF algorithm; they will be used in Section 4 to validate the algorithm performances instead. The block diagram for the BF algorithm implementation in LabVIEW is shown in Figure 2, where: • V is the array of node voltages; • FP and FQ are the arrays of the active and reactive power flows, respectively; • PL measured and QL measured are the arrays of the measured active and reactive powers, respectively; • DeltaP is the array of the calculated power losses in the network; • VMT is the voltage used as reference for the slack bus: its module is equal to the value measured at MV bus-bars, i.e., V measured, and its phase is assumed as 0; • Tol module and Tol phase are the thresholds used as tolerance in the load flow algorithm; Two different sequence frames are used for backward and forward sweeps on the whole network: the backward sweep calculates the power flows in each branch, and the forward sweep calculates the node voltages. These two frames are included in a while loop, thus they are repeated until a convergence condition is met on both the amplitude and the phase of the voltage at each node (at each iteration, this condition is verified in the third sequence frame).
To analyze the algorithm formulation in more detail, the single-phase network model used is shown in Figure 3 [50][51][52]. In the model, the voltages are the medium values of the three phases while the active and reactive powers are the total powers of the three phases. Network parameters are shown in Figure 3 and listed in Table 1; they have to be known for each branch and node of the network. As regards this, in practical cases this is a source of uncertainty (as these data are affected by uncertainty); in this viewpoint, in Section 4 the impact of such uncertainty on power flow results is analyzed.  To analyze the algorithm formulation in more detail, the single-phase network model used is shown in Figure 3 [50][51][52]. In the model, the voltages are the medium values of the three phases while the active and reactive powers are the total powers of the three phases. Network parameters are shown in Figure 3 and listed in Table 1; they have to be known for each branch and node of the network. As regards this, in practical cases this is a source of uncertainty (as these data are affected by uncertainty); in this viewpoint, in Section 4 the impact of such uncertainty on power flow results is analyzed.    To analyze the algorithm formulation in more detail, the single-phase network model used is shown in Figure 3 [50][51][52]. In the model, the voltages are the medium values of the three phases while the active and reactive powers are the total powers of the three phases. Network parameters are shown in Figure 3 and listed in Table 1; they have to be known for each branch and node of the network. As regards this, in practical cases this is a source of uncertainty (as these data are affected by uncertainty); in this viewpoint, in Section 4 the impact of such uncertainty on power flow results is analyzed.

Backward Sweep
As already mentioned, firstly the backward sweep is performed from the last node to the beginning of the MV feeder. Active and reactive power flows in the longitudinal impedance of each branch are calculated as: where: Energies 2020, 13, 3173 6 of 25 • V i is the voltage amplitude at the i-node; • FP i+1 e FQ i+1 are the power flows downstream from the i-node; these terms are null in the case of a terminal node; • P Li and Q Li are active and reactive powers measured at LV side of power transformers; • to obtain the equivalent MV load, the power transformer losses are added as P 0 i + k 2 L P cc i and Q 0 i + k 2 L Q cc i for the active and reactive power, respectively (these terms are not added in the case of MV users, because they are included in P Li and Q Li measured at the MV side of the transformer); • k L is the load factor, i.e., the ratio between the actually drained apparent power and its rated value: When the virtual tool is used to simulate the distributed generators' connection to the LV network, the generated powers will be summed to P Li and Q Li .
The active and reactive power flows in each branch are finally obtained by summing the line losses as:

Forward Sweep
In the forward sweep, node voltages are calculated starting from the measured voltage at MV bus-bars and the calculated power flows in each branch. The voltage phasor at node i is calculated as: where I i is the phasor of the current flowing in the longitudinal impedance. It can be obtained from the following expression: Combining these last two expressions, the voltage phasor can be finally obtained as:

Convergence Condition
The convergence condition is verified on both the voltage amplitude and phase. In further detail, the difference is calculated between the amplitudes and the phases of two subsequent cycles. If these differences were below a tolerance threshold for all the nodes, the while cycle is stopped, otherwise a further iteration is performed.

Uncertainty Analysis
To evaluate the uncertainty on power flows' calculated values, the propagation of uncertainties was studied starting from the measurement uncertainties of the input quantities [53], i.e., the load powers of secondary substations and the voltage of MV bus-bars of a generating station. The uncertainties on the power measurements acquired at the LV side of power transformers are calculated taking into account the following contributions: • The PQAs uncertainty of the power measurements, u P% and u Q% ; • The uncertainty introduced by the current transformers (CTs), due to the ratio and phase angle errors, η CT% and ε CT , respectively [54].
The uncertainty of power measurements acquired at the MV level in MV user substations is determined taking into account the following contributions: • The PQAs uncertainty of the power measurements, u P% and u Q% ; • The uncertainty introduced by the MV CTs [54]; • The uncertainty introduced by MV voltage transformers (VTs), due to the ratio and phase angle errors, η VT% and ε VT , respectively [55].
The uncertainty on the voltage measurement at the MV bus-bars of generating stations is determined taking into account the following contributions: • The PQAs uncertainty of the voltage measurements; • The uncertainty introduced by the MV VTs.
More in detail, the uncertainties on the active and reactive power measurements for the MV users are calculated, considering a type B evaluation and a rectangular distribution, through the following formulas [50]: where θ is the phase shift between the current and the voltage. For the uncertainties of active and reactive power measurements at the LV level, u P LV% and u Q LV% , a similar expression is used (where the terms related to the VTs are omitted).
To assess the uncertainty of the load flow output, the law of propagation of uncertainties should be applied to determine the partial derivatives of the measurement model. An alternative solution proposed in the standard [56] performs an iterative analysis with a Monte Carlo method. In more detail, the Monte Carlo procedure suggests repeating the calculation and iteratively varying the input quantities in their uncertainty range, thus obtaining the uncertainty distribution of the output quantities. Following this approach, a second VI was designed to be used offline to validate the load flow algorithm and evaluate its performances in terms of accuracy in the calculated power flows. The VI performs 10 5 times the load flow aforementioned algorithm; at each iteration the input quantities are randomly varied within the related uncertainty intervals through the following expressions: where: • P L i e Q L i are the estimated values of the power measurements; • u V MT is the relative uncertainty of the voltage measurements; Energies 2020, 13, 3173 8 of 25 • R p R q and R v are the random numbers chosen within a standard normal distribution.
The high number of iterations guarantees that random numbers do not affect the results. Active and reactive powers were considered as uncorrelated quantities. At each run, active and reactive power flows on each branch and node voltages were calculated. At the end of the 10 5 iterations, the frequency distributions of the calculated power flows were evaluated. The average value and the expanded uncertainty were then calculated (confidence level of 95.45%, coverage factor k = 2). Figure 4 shows the implementation of the Monte Carlo analysis in LabVIEW. The sub-VI implementing the load flow algorithm is inside a "for" cycle, which is used to iteratively repeat the calculations. A second "for" cycle is used to extract the frequency distribution for each node and then calculate the mean values and the standard deviations. The expended uncertainties are then obtained as twice (k = 2) the standard deviations. where:  e are the estimated values of the power measurements;  is the relative uncertainty of the voltage measurements;  and are the random numbers chosen within a standard normal distribution.
The high number of iterations guarantees that random numbers do not affect the results. Active and reactive powers were considered as uncorrelated quantities. At each run, active and reactive power flows on each branch and node voltages were calculated. At the end of the 10 5 iterations, the frequency distributions of the calculated power flows were evaluated. The average value and the expanded uncertainty were then calculated (confidence level of 95.45%, coverage factor k = 2). Figure 4 shows the implementation of the Monte Carlo analysis in LabVIEW. The sub-VI implementing the load flow algorithm is inside a "for" cycle, which is used to iteratively repeat the calculations. A second "for" cycle is used to extract the frequency distribution for each node and then calculate the mean values and the standard deviations. The expended uncertainties are then obtained as twice (k = 2) the standard deviations.

Case Study: Microgrid of Favignana ISLAND
The aforementioned virtual instrument and the related measurement architecture were implemented in the real case study of the microgrid of Favignana island.
The production, distribution and energy sale on

Case Study: Microgrid of Favignana ISLAND
The aforementioned virtual instrument and the related measurement architecture were implemented in the real case study of the microgrid of Favignana island.
The production, distribution and energy sale on Favignana island are managed by the SEA S.P.A. (Società Elettrica di Favignana). The electricity network of the island of Favignana is currently composed of three medium voltage lines (in the following, named MTL1, MTL2 and MTL3), which depart from a central generating station. The three lines feed both MV/LV secondary substations (which LV lines depart from, to supply LV users), and MV user substations. The central station has seven generation units for a total installed power of 16,120 kVA. The MV lines are mostly equipped with MV cables. Only a few feeder sections are equipped with overhead lines.
The electrical scheme of the MV line named "MT L1" is shown in Figure 5. It is the longest MV line of the island (25,640 m). It powers 28 secondary substations (21 MV/LV secondary substations and seven MV users) mostly placed outside the city center. In Figure 5, each node of the "MTL1" line is indicated with a number, which will be used to show the load flow results. The branches will be indicated with the numbers of the nodes in which they end instead. The black numbers indicate the principal nodal substations. Line parameters and power transformer-rated data were already reported in a first study focused on line "MTL1" [49].
Energies 2020, 13, 3173 9 of 25 in Figure 6. It is 2281 m long, and this line powers the city center with four MV/LV secondary substations. Its line parameters and related power transformer-rated data are reported in Table 2 and Table 3, respectively.
The third MV line is shown in Figure 7 and it is named "MTL3". It is 3785 m long, and it powers five MV/LV secondary substations and one MV user substation. Its line parameters and related power transformer-rated data are reported in Table 4 and Table 5, respectively.   The second line of the Favignana MV distribution network was named "MTL2" and it is shown in Figure 6. It is 2281 m long, and this line powers the city center with four MV/LV secondary substations. Its line parameters and related power transformer-rated data are reported in Tables 2 and 3, respectively. indicated with the numbers of the nodes in which they end instead. The black numbers indicate the principal nodal substations. Line parameters and power transformer-rated data were already reported in a first study focused on line "MTL1" [49].
The second line of the Favignana MV distribution network was named "MTL2" and it is shown in Figure 6. It is 2281 m long, and this line powers the city center with four MV/LV secondary substations. Its line parameters and related power transformer-rated data are reported in Table 2 and Table 3, respectively.
The third MV line is shown in Figure 7 and it is named "MTL3". It is 3785 m long, and it powers five MV/LV secondary substations and one MV user substation. Its line parameters and related power transformer-rated data are reported in Table 4 and Table 5, respectively.    The third MV line is shown in Figure 7 and it is named "MTL3". It is 3785 m long, and it powers five MV/LV secondary substations and one MV user substation. Its line parameters and related power transformer-rated data are reported in Tables 4 and 5, respectively.  Table 3. Rated data of the MV/LV transformers powered by MTL2.
Node An (kVA) P0 (W) Q0 (VAR) Pcc (W) Qcc (VAR)  1  160  460  3651  2350  5953  2  800  1900  8592  9000  47,148  3  800  1500  12,717  8500  47,241  4  630  1650  7378  7800     A PQA Janitza UMG 604 is installed in each secondary substation of the network. All the PQAs are linked to the DSO-monitoring control center via a HiperLAN network. This solution was chosen as it was the best economical solution due to the orography of the island. The developed VI can query each instrument via Modbus over TCP/IP. The VI periodically queries each PQA at time intervals of 2 s, to acquire the measured active and reactive powers. The collected measurements are used to run the power flow calculation; then they are stored along with the results. The considered application requires a time accuracy in the millisecond range, thus a network time protocol (NTP) over the Ethernet network is used to synchronize all PQAs. Moreover, a further PQA is installed at the beginning of each MV feeder. As already mentioned, the voltage measurements of these last PQAs are used in the load flow algorithm, while their active and reactive power measurements are used for the algorithm power flow output validation.

Algorithm Validation
The experimental validation of the BF-LF algorithm results was carried out by comparing calculated active and reactive power flows with active and reactive power values measured by the PQAs installed at the beginning of each MV line (for the assessment of the uncertainty on the powers measured in MV, see Section 4.2). Figure 8 shows the comparison between the measured and the calculated values, for the first branch of the "MTL1" line. The comparison is performed every 2 s for the 24 h of the 31 May 2018. As can be seen, the measured and estimated values are superimposed. To highlight their differences, they are reported in Figure 9. It can be observed that the difference between the measured and estimated values is always very small, in comparison with the measurement uncertainty, thus confirming the correctness of the power flow calculations. Similar graphs are reported for reactive power flows (see Figures 10 and 11). The results obtained for the MTL2 and MTL3 lines are very similar to those by MTL1, thus they are omitted.
The same analysis was carried out for different days. For each day, Figure 12 shows the maximum and average values of the difference between the measured and the calculated values in the percentage of the measured active power flow. Differences of less than 0.1% and 0.2% were observed. These results demonstrate how the values calculated by the virtual instrument were very close to the measured values. Similar results were obtained for the reactive power flows and for the other lines.          Energies 2020, 13, 3173 13 of 25 Figure 11. Difference between the measured and the calculated reactive power flow of branch 1 of the "MTL1" line and the uncertainty in its measurement (31 May 2018).

Uncertainty Analysis
To evaluate the uncertainty in the output quantities, a Monte Carlo analysis was performed using the VI described in Section 2.4. The Monte Carlo procedure was performed for a whole day, the 31 May 2018; the power flows and related uncertainties were evaluated every 2 s. For each set of measured input quantities, the load flow algorithm was performed 10 5 times. At the end of the 10 5 iteration, an average value and an extended uncertainty are obtained. Then, the process is repeated for the following set of input data, related to the subsequent 2 s. Figure 13 shows the comparison between the calculated uncertainty with the Monte Carlo procedure and the measurement uncertainty obtained with (9) for the active power flows measured by the PQA installed at the MV level of branch 1 of the "MTL1" line. Figure 14 shows a similar graph for the reactive power flows. It can be seen that calculated uncertainties are comparable with those of measurement power flows.

Uncertainty Analysis
To evaluate the uncertainty in the output quantities, a Monte Carlo analysis was performed using the VI described in Section 2.4. The Monte Carlo procedure was performed for a whole day, the 31 May 2018; the power flows and related uncertainties were evaluated every 2 s. For each set of measured input quantities, the load flow algorithm was performed 10 5 times. At the end of the 10 5 iteration, an average value and an extended uncertainty are obtained. Then, the process is repeated for the following set of input data, related to the subsequent 2 s. Figure 13 shows the comparison between the calculated uncertainty with the Monte Carlo procedure and the measurement uncertainty obtained with (9) for the active power flows measured by the PQA installed at the MV level of branch 1 of the "MTL1" line. Figure 14 shows a similar graph for the reactive power flows. It can be seen that calculated uncertainties are comparable with those of measurement power flows.
Energies 2020, 13, x FOR PEER REVIEW 14 of 26 Maximum, minimum and average uncertainties on the power flows of each branch of "MTL1" line are reported in Figure 15 and Figure 16. The same graphs are shown for the "MTL2" line ( Figure  17 and Figure 18) and for the "MTL3" line ( Figure 19 and Figure 20). In all cases, the results of the measured and calculated power flows were compatible and the calculated uncertainties are comparable with the measurement ones.      Maximum, minimum and average uncertainties on the power flows of each branch of "MTL1" line are reported in Figures 15 and 16. The same graphs are shown for the "MTL2" line ( Figures 17 and 18) and for the "MTL3" line (Figures 19 and 20). In all cases, the results of the measured and calculated power flows were compatible and the calculated uncertainties are comparable with the measurement ones.

Impact of Line Parameters Uncertainties
Since network parameters are also input quantities of the load flow algorithm, their uncertainty influence on the load flow calculation results was also studied. In fact, the network parameter-rated data provided by DSO cannot be exactly equal to the real ones. Thus, an analysis was conducted to assess the influence of the possible deviation of actual line parameter values from the rated ones. In addition, in this case, the evaluation was carried out by means of a Monte Carlo procedure.
In more detail, an uncertainty value was assumed equal for all the network parameters (R, X and Y). Then, for a given condition of all input quantities, the load flow calculation was repeated 10 5 times. At each execution, in addition to the random variation of all the measured quantity inputs, network parameters were also varied inside the assumed uncertainty range. At the end of the 10 5 iterations, an average value and an uncertainty value were obtained for each power flow. The procedure was repeated 16 times, varying the uncertainty value on the network parameters from 0 to 15% with a step equal to 1. The value 15% was chosen as upper limit value. It was determined considering a 10% uncertainty on line length. Moreover, it is lower than the parameter variation correspondent to two subsequent cable subsections (i.e., 25 and 50 mm 2 ). Figure 21 shows the trend of the relative uncertainties on the active power flow of branch 1 of the "MTL3" line, due to network parameter uncertainties. Figure 22 shows the same trend for reactive power. The input data are those measured at 13:00:00 on 31 May 2018. It can be seen that the relative uncertainty in the active power flow remains constant. This result can be justified by analyzing the dependence of the active power flow from the network parameters; in fact, it basically depends on the line losses on longitudinal resistance R i (see Figure 3); these losses represent an extremely small percentage of the active power flows. This explains the low dependence of the active power flow from the network parameter uncertainties. A different behavior was observed for the reactive power flow in Figure 22. It is more sensitive to network parameter variability. This is due to the reactive power flow dependence from the line transversal capacitive admittance, i.e., from the term (−V 2 i /Y i ) of Equation (2). It can be seen that network parameter uncertainty variation from 0 to 15% corresponds to a reactive power flow variation from 2% to 9%. Thus, reactive power flow calculations are more sensitive than active power flow ones to grid parameter uncertainty. However, the reactive power flow remains lower than 10% even with a maximum network parameter variation of 15%.
network parameters were also varied inside the assumed uncertainty range. At the end of the 10 5 iterations, an average value and an uncertainty value were obtained for each power flow. The procedure was repeated 16 times, varying the uncertainty value on the network parameters from 0 to 15% with a step equal to 1. The value 15% was chosen as upper limit value. It was determined considering a 10% uncertainty on line length. Moreover, it is lower than the parameter variation correspondent to two subsequent cable subsections (i.e., 25 and 50 mm 2 ). Figure 21 shows the trend of the relative uncertainties on the active power flow of branch 1 of the "MTL3" line, due to network parameter uncertainties. Figure 22 shows the same trend for reactive power. The input data are those measured at 13:00:00 on 31 May 2018. It can be seen that the relative uncertainty in the active power flow remains constant. This result can be justified by analyzing the dependence of the active power flow from the network parameters; in fact, it basically depends on the line losses on longitudinal resistance (see Figure 3); these losses represent an extremely small percentage of the active power flows. This explains the low dependence of the active power flow from the network parameter uncertainties. A different behavior was observed for the reactive power flow in Figure 22. It is more sensitive to network parameter variability. This is due to the reactive power flow dependence from the line transversal capacitive admittance, i.e., from the term (− / ) of Equation (2). It can be seen that network parameter uncertainty variation from 0 to 15% corresponds to a reactive power flow variation from 2% to 9%. Thus, reactive power flow calculations are more sensitive than active power flow ones to grid parameter uncertainty. However, the reactive power flow remains lower than 10% even with a maximum network parameter variation of 15%.

Simulation with Distributed Generation
In previous sections, the virtual tool measurement performances were validated. Thus, it can be used offline for planning purposes, i.e., to evaluate the network quantities (voltages, power flows and losses) in the case of an increase in the power injected into the network from distributed generation (DG). In this way, the behavior of the network quantities can be analyzed in different operating conditions whilst varying the number, size and position of the distributed generators connected to the grid.
In order to show a possible use of the VI, in this paragraph the results of some simulation on the "MTL2" line were reported. For each scenario, a fixed power value of photovoltaic production was

Simulation with Distributed Generation
In previous sections, the virtual tool measurement performances were validated. Thus, it can be used offline for planning purposes, i.e., to evaluate the network quantities (voltages, power flows and losses) in the case of an increase in the power injected into the network from distributed generation (DG). In this way, the behavior of the network quantities can be analyzed in different operating conditions whilst varying the number, size and position of the distributed generators connected to the grid.
In order to show a possible use of the VI, in this paragraph the results of some simulation on the "MTL2" line were reported. For each scenario, a fixed power value of photovoltaic production was chosen. In the hypothesis of installing the distributed generators in the LV network, their rated powers were expressed as a percentage of the rated power of the MV/LV transformer powering the related LV line. For a given rated power, the distributed generator's actual power depended on the period of the year under test and on the time during each day. Since the aim of this paper was to study the influence of an increase in the distributed generation injected into the network, the ideal conditions were considered as a worst case scenario, neglecting the possible influence of weather disturbances. Thus, the trend of daily solar radiation was modeled with a parabola curve, whose parameters depend on the analyzed season.
The photovoltaic power plants were simulated as PQ generators. In the case study herein presented, the generators' reactive powers were set to zero, in order to investigate a worst case scenario condition. Different simulations were performed on the "MTL2" line, varying the power injected by the distributed generators in each node. In more detail, five scenarios were here reported based on the following installed powers expressed in a percentage of the nominal power of the corresponding power transformer: • Scenario 1: no injected power from DG; • Scenario 2: installed DG power equal to 10% of the transformer-rated power for each secondary substation; • Scenario 3: installed DG power equal to 20% of the transformer-rated power; • Scenario 4: installed DG power equal to 30% of the transformer-rated power for substations 3 and 4 and equal to 10% for substations 1 and 2; • Scenario 5: installed DG power equal to 35% of the nominal transformer power for substations 3 and 4, 10% for substation 2 and 5% for substation 1. Table 6 shows the absolute values of the injected power for the aforementioned scenarios.  Figure 23 shows how the increase in the overall distributed generation causes a progressive reduction in the power flows of the line. Scenario 4 causes a reverse power flow in branch 4, while scenario 5 causes a reverse power flow up to branch 2. It should be considered that these power flow inversions have to be monitored and correctly managed, because they can cause frequency instability and network malfunctioning, especially in an islanded micro-grid as that of Favignana.               These results show how the tool can be used to know the possible consequences of installing photovoltaic DG on the network. Starting from the size and position of the generators, it is possible to study the effects of a new power plant installation on the MV network by simulating their presence and verifying the consequent variations on the voltage profiles and power flows. High-power flow inversions, especially close to the generating station, can in fact cause network instability. Thus, the virtual tool can be useful to plan for improvement in the network, such as the installation of storage systems and to define their power and energy in order to avoid or reduce power flow inversions in the network.

Conclusions
This paper investigated the possibility of using a feasible virtual tool for load flow analysis and power system planning, based on a low-cost distributed measurement system, specifically tailored for the case of an islanded distribution network. The proposed solution has been on-field implemented and characterized, on the real distribution network of the Island of Favignana (Italy, Mediterranean Sea).
The proposed virtual tool has been developed in a LabVIEW environment for monitoring the MV distribution network of the micro-grid; the tool allows determining the power flows and losses in all the branches and voltages in all the nodes of the MV network, even in the presence of distributed generation. The monitoring of the MV network is carried out through a simplified approach to load flow, implementing a backward/forward algorithm belonging to the class of power summation methods; the input quantities of the algorithm are active and reactive power measurements, which are taken at the LV side of the power transformers (with the exception ion the case of MV users), allowing a reduction in the costs of the measuring points.
The accuracy of the load flow calculations was experimentally verified for all three MV lines of the Favignana network, by comparing the power flow values calculated at the beginning of each line with the related values measured by the PQAs installed in the generating substation, also taking into account the related uncertainty range. This comparison, carried out using the measurement data acquired every 2 s in a period of 33 days, showed the compatibility between the calculated and measured power flows. The accuracy of the quantities calculated by the VI was also assessed by performing an uncertainty analysis. In further detail, starting from the accuracy specifications of the used instruments and measuring transducers, uncertainties in the power measurements were calculated both for the LV and MV secondary substations and for the voltage measurements at the MV bus-bars of the central generating station. The propagation of these uncertainties in the estimated power flows was investigated by implementing a Monte Carlo analysis. The uncertainty results obtained for the estimated values were comparable to that of the installed instruments and the results of the estimated and measured power flows were compatible. The same approach was also used to evaluate the dependence of the results on the variability of the network parameters. In this case, no high influence was observed in the active power flows, while the reactive powers were found sensible to the cable parameter knowledge.
The validated VI was also used as a useful tool for the network planning. It allows simulating different conditions of DG penetration (in particular from photovoltaics) starting from real load measurement data and evaluating power flows, voltage profiles and losses in the network, by varying the number, size and position of the distributed generators. A first study on one of the three lines showed how the distributed generators in an islanded micro-grid mostly affect the trend of power flows, causing power flow inversions which have to be correctly managed to avoid network instability or malfunctioning.
The obtained results confirm the feasibility of the developed solution, which allows the DSO to effectively monitor networks the power flows, by the means of a simple analysis tool and a low-cost distributed measurement system. It has been also shown that the proposed virtual tool can be used for planning purposes of distributed generation and storage increase. For example, in future works it can allow for investigating different distributed generation scenarios, where the installation of storage systems can be also investigated, in terms of both storage location and size, in order to avoid or reduce power flow inversions in the network. Furthermore, the use of power quality analyzers, as those used in the real case study implementation, can allow the expandability of the proposed system, with the implementation of power-quality additional virtual tools on the same platform, without the need of further instrumentation costs.