**5. Conclusions**

This article presents a method of analyzing long-term PQ data using a combined technique based on cluster analysis and newly proposed global power quality indices. The presented investigations were based on multipoint synchronized real measurements performed in a medium voltage electrical power network with distributed generation supplying the mining industry. Time-varying PQ conditions were intentionally created during the experiment when the distributed generation was switched on and off for some period of time, with a network reconfiguration also being performed.

The cluster analysis is the first step of the proposed method and is used for identification of the PQ data which represent different conditions. It was shown that cluster analysis with K-means and Euclidean distance successfully allowed for the identification of portions of PQ data related to the impact of distributed generation (switched on and switched off) and changes to the network configuration. Basic investigations of the application of cluster analysis in an electrical power network were presented by the authors in a previous work [9]. The extension of the mentioned work and the novelty involved in the proposed method lies in extending the cluster analysis by assessing the obtained portions of PQ data using global power quality indices. In order to achieve the goal, newly proposed global power quality indices were provided, including the aggregated data index and flagged data index. The proposed aggregated data index has a synthetic formula and is based on five classical 10-min aggregated power quality parameters and two parameters that demonstrate 200-ms values, including the envelope of voltage changes and the maximum of total harmonic distortion in the voltage. In this work, the proposed global indices were used for comparative assessment of identified clusters, which in turn demonstrated different states of the network condition: active distributed generation, switched off generation, and network reconfiguration when the generation was switched off. It was shown that the use of the proposed global power quality indices resulted in the comparative analysis between particular clusters being successfully performed.

Additionally, a sensitivity analysis of the synthetic aggregation data index was also proposed. It can be concluded that a reduction of the parameters comprising the synthetic global power quality index may influence the results of the assessment. In the case of the presented investigation, this inherent relation was more significant when the differences between power conditions in the compared clusters were insignificant.

The presented approach can be treated as an effective tool (not only related to power quality) for the assessment of long-term multipoint measurements. The advantages of the proposed method are the automatic classification of the data into clusters and the assessment of the condition of the identified group of data in a parametric global sense, which makes the comparative assessment easier and more intuitive. The proposed technique has the potential for further implementation in the analysis and optimization of energy processes, and also in the development of sustainable energy systems.

**Author Contributions:** Conceptualization, M.J. and T.S.; methodology, M.J. and T.S.; software, M.J.; validation, K.B.; formal analysis, M.J.; investigation, M.J.; resources, P.K. and K.B.; data curation, P.K.; writing—original draft preparation, M.J.; writing—review and editing, T.S.; visualization, M.J.; supervision, T.S. and Z.L.; project administration, T.S.; funding acquisition, Z.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received funding from the Chair of Electrical Engineering Fundamentals (K38W05D02), Wroclaw University of Technology, Wroclaw, Poland.

**Acknowledgments:** The authors also acknowledge the support of KGHM Polska Miedz SA.

**Conflicts of Interest:** The authors declare no conflicts of interest.
