Previously presented results described in detail cases with LED light sources and consequently increased level of supply voltage distortion. The presented results aimed to express the methodology of the investigation with special consideration of the identification and analysis of the characteristic spectra of voltage in the point of the connection of the load and energy meter. As already mentioned, the loads responsible for the majority of data transmission interference in systems based on PLC transmission are LED and CFL light sources and induction motors powered by a pulse width modulation (PWM) frequency inverter. Therefore, in order to assess the impact of the power supply voltage distortion on the operation of the tested PRIME PLC system, with the simultaneous presence of emissions of these loads, extended investigations were performed using several cases formulated as mixtures of the different scenario of supply voltage distortion and variant types of load. It resulted in ten investigation cases for deliberate comparative analysis:

Spectral analysis in the range of 2–150 kHz was carried out for the mentioned ten investigation cases. Figure 11 presents spectra of the investigated voltage in the point of the connection of the load and energy meter with PRIME PLC communication for: (a) LED, (b) CFL, and (c) induction motor with PWM converter, respectively. For better representation, every figure consists of margin characteristic spectra reflecting the background of the transmission obtained for the sinusoidal supply and no-load denoted as reference condition (grey) as well as spectrum of the signal with PRIME PLC transmission (black). The next three curves express the investigated voltage spectra for the consequently deteriorating supply voltage condition (brown—sinusoidal, yellow—EN 50160, orange—IEC 61000-4-13).

The first comment to the obtained results presented in Figure 11 might be addressed to the comparison of the non-intentional emission of the investigated loads for the sinusoidal supply voltage (brown) and normative curves representing emission in a power grid. It can be noticed that, for normative supply conditions, the spectra differ significantly and are characterised by different frequency components in the observed range 2–150 kHz. Moreover, temporarily the obtained spectra exceed the curves representing the normative level of non-intentional emission in the public grid defined in IEC 61000-3-8 [4] adopted in EN 50065:2012 [2] (green normative curve).

The second comment might be addressed to the influence of the distorted voltage condition on non-intentional emission in the range 2–150 kHz. As it was shown in Figure 11, increasing the level of the contribution of the low-frequency component 0–2 kHz in the supply voltage affected the non-intentional emission in the observed range 2–150 kHz in the connection point of the loads and energy meter with PRIME PLC transmission (yellow and orange lines). For the margin condition representing low-frequency contribution used in the immunity test, according to IEC 61000-4-13, the investigated spectra were very close to the intentional transmission signal of the PRIME PLC system (black).

**Figure 11.** Summary: spectra of the voltage in the connection point of the load and energy meter for mixture cases representing results of the analysis of PRIME PLC system operation with (**a**) LED; (**b**) CFL; and (**c**) induction motor with PWM converter; under the different contribution of low-frequency distortion in the supply voltage (pure sinusoid (brown), EN 50160:2015 [3] (yellow), IEC 61000-4- 13 [30] (orange)) with relation to no-load condition (grey) and PRIME transmission (black) (uL—line voltage in the point of the equipment connection, which is also the point of energy meter connection with PRIME PLC).

Details of the representative parameters of the transmission signal and the nonintentional emission in the transmission band 42–89 kHz of the investigated PRIME PLC system were collected in Table 4. It can be noticed that the condition of the transmission was consequently worse when the distortion of the supply voltage was increased.

**Table 4.** Characteristic parameters of the signal in the transmission band 42–89 kHz of PRIME PLC during the different scenarios of supply voltage distortion and variant types of loads.

*Nmax*—local maximum magnitude of the frequency component of the background signal; *S*(*Nmax*)—local magnitude of the frequency component of the transmission signal related to *Nmax*; *SNRlocal*—signal-to-noise ratio derived on the basis of local values of *S*(*Nmax*) and *Nmax*; *Psignal*—power of the transmission signal in the transmission band; *Pnoise*—power of the background signal (noise) in the transmission band; *SNRband*—signal-to-noise ration derived on the basis of *Psignal* and *Pnoise*.

> The impact of the supply voltage distortion on the signal-to-noise ratio (SNR) in the transmission band 42–89 kHz of the investigated PRIME PLC system is presented in Table 4 and illustrated in Figure 12. In particular:

**Figure 12.** Impact of the supply voltage distortion grade on the signal to noise ratio (SNR) in the transmission band 42–89 kHz of the investigated PRIME PLC system.

Direct investigation of a bit error rate (BER) was not performed in the presented study. However, based on [44,45] it can be roughly estimated that for the achieved range of SNR reduction from 30.63 dB to 2.94 dB possible increase of BER could be in the range from 10−5 to 10−1.

Details of the connections statistics in the investigated cases are collected in Table 5. It can be generally noticed that increasing the level of the supply voltage distortion resulted in increasing the total number of the attempted connections as well as a long duration of the failed connections during one hour. Figure 13 depicts the impact of the supply voltage distortion on the duration of the failed connections in one hour of the investigated PRIME PLC system concerning the different types of the investigated equipment. A prominent case is represented by waveform distortion used in the immunity test of the equipment. This case indicates the duration of the failed connections in one hour longer than level 180 s specified by the producer as a margin condition for proper connection. In particular:

**Table 5.** The statistics of the transmission of the investigated PRIME PLC during the different scenarios of supply voltage distortion and variant types of loads (2 h continuous work).

**Figure 13.** Impact of the supply voltage distortion grade on the duration of the failed connections in one hour of the investigated PRIME PLC system.

#### **5. Discussion**

Taking into account the results of the research presented in this paper, it can be stated that the harmonic content of the supply voltage can be considered as one of the origins of the increasing level of supraharmonics non-intentional emission. As it was shown in the paper, successively increased deterioration grade of the supply voltage waveform, representing respectively harmonic content of permissible level defined for the public grid as well as for the immunity test, had a direct influence on non-intentional emission in the range 2–150 kHz, that in consequence affected the transmission of the investigated PRIME PLC system.

 All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was founded by a subsidy of the Polish Ministry of Science and Higher Education for research activities at the Faculty of Electrical Engineering, Wrocław University of Science and Technology.

**Data Availability Statement:** The data presented in this study are available on request from the corresponding author.

**Acknowledgments:** In the research, commercial measurement equipment and software for supraharmonics analysis was used to validate the university laboratory setup. This part of the investigations was supported by TAURON Dystrybucja Pomiary Ltd., Poland.

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

#### **References**

### *Article* **A Case Study on a Hierarchical Clustering Application in a Virtual Power Plant: Detection of Specific Working Conditions from Power Quality Data**

**Michał Jasi ´nski 1,\*, Tomasz Sikorski 1, Dominika Kaczorowska 1,\*, Jacek Rezmer 1, Vishnu Suresh 1, Zbigniew Leonowicz 1, Paweł Kostyła 1, Jarosław Szyma ´nda 1, Przemysław Janik 2, Jacek Bie ´nkowski 2 and Przemysław Prus 2**

**Abstract:** The integration of virtual power plants (VPP) has become more popular. Thus, research on VPP for different issues is highly desirable. This article addresses power quality issues. The presented investigation is based on multipoint, synchronic measurements obtained from five points that are related to the VPP. This article provides a proposition and discussion of using one global index in place of the classical power quality (PQ) parameters. Furthermore, in the article, one new global power quality index was proposed. Then the PQ measurements, as well as global indexes, were used to prepare input databases for cluster analysis. The mentioned cluster analysis aimed to detect the short-term working conditions of VPP that were specific from the point of view of power quality. To realize this the hierarchical clustering using the Ward algorithm was realized. The article also presents the application of the cubic clustering criterion to support cluster analysis. Then the assessment of the obtained condition was realized using the global index to assure the general information of the cause of its occurrence. Furthermore, the article noticed that the application of the global index, assured reduction of database size to around 74%, without losing the features of the data.

**Keywords:** virtual power plant; power quality; data mining; clustering; distributed energy resources; energy storage systems; short term conditions

### **1. Introduction**

The concept of renewable energy sources (RES) and energy storage systems (ESS) integration into virtual power plants (VPP) includes different areas. This investigation concerns power quality (PQ) and data mining (DM) issues in VPP.

The article [1] is concerned with standard IEC 61850. It proposed an extension to this standard as a step to enhance the interaction between the controller of RESs and VPPs. As one of the elements, the power quality recorders' issues were included. The demands for them in point of IEC 61850 are discussed. Finally, the proposed methodology was verified in the virtual power plant that consists of HPP, PV, and wind power plant as well as storage systems. The indicated VPP operates on a medium voltage (MV) level. In Pudjianto et al. [2], the virtual power plant is treated as an instrument to enable a cost efficient integration of RES with the present power systems. The article includes the performance analysis of a VPP system from the point of view of different indicators such as energy efficiency, power quality, and security. The analyzed case consists of fuel cells, a

**Citation:** Jasi ´nski, M.; Sikorski, T.; Kaczorowska, D.; Rezmer, J.; Suresh, V.; Leonowicz, Z.; Kostyła, P.; Szyma ´nda, J.; Janik, P.; Bie ´nkowski, J.; et al. A Case Study on a Hierarchical Clustering Application in a Virtual Power Plant: Detection of Specific Working Conditions from Power Quality Data. *Energies* **2021**, *14*, 907. https://doi.org/10.3390/ en14040907

Academic Editor: Pedro Faria Received: 6 January 2021 Accepted: 6 February 2021 Published: 9 February 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

wind microturbine PV system, a fly wheel, a combined heat and power plant, and a storage system. Caldon et al. [3] propose the applicable framework for harmonizing operations of different VPP units. The authors indicated that decisions and profits although complying with power quality requirements and real network constraints must be a significant part of VPP operation strategies. Zhang et al. [4] considered the coordinated operation of VPPs. The bi objective dispatch model was applied for the performance optimization of multi energy VPP in terms of both economic and power quality issues. The article concerned both simulations based on a 118-node IEEE test system and a real case from Hongfeng Eco-town in China. Gong et al. [5] proposed the optimization issues concerning VPP management strategies. The customers' satisfaction, system stability, and PQ were used together with the economic objective to formulate a multi-objective optimization problem. The fuzzy multiple objective optimizations were applied to solve optimization problems. The proposed approach was verified in a test system. Beguin et al. [6] presented simulations for an islanded grid model of the virtual power plant. The VPP integrates a 0.2 GW wind power plant, a 0.1 GW PV power plant, and a 0.25 GW pumped storage system. The outcomes of the research were control strategies of the storage plant. The control strategies were investigated to highlight VPP on PQ.

Another element of the investigation is using data mining (DM) techniques to obtain knowledge from dataset. In Ref. [7], one of the DM techniques available is cluster analysis (CA). The current research connecting CA and VPP are as follows. Luo et al. [8] proposed demand response schemes based on data mining for electricity trading between VPPs and their participants. Participants' bid offers were used to categorize them using ordering points to identify the clustering structure (OPTICS) algorithm. Yi et al. [9] presented multi time scale scheduling for VPP. The scheduling contains both a day ahead bidding and real-time operations. The proposed models were based on the deferrable loads' aggregation connected with the k-mean cluster analysis. The proposed strategy enables efficient management of massive deferrable loads. Then it results in a reduction of the energy management complexity, and increases the general economics. This approach seems promising for s efficient scheduling of VPPs. Kong et al. [10] presented the robust stochastic optimal dispatching approach to solve scheduling issues. K-medoids cluster analysis was used to define typical scenarios of different units, that were integrated into VPP. Ai et al. [11] proposed a VPP load curve cluster analysis approach. It uses the principal-component dimension-reduction analysis, aggregation level clustering, and fcmeans clustering. The principal component analysis is applied to determine different loads, that are aggregated into a VPP. Then hierarchical aggregation and fc-means cluster analysis was applied to divide all load output curves participating in the aggregation process. The last step of the investigation was the analysis of clustering results to establish an evaluation system. The article [12] proposes the methodology concerning distributed energy sources management. It concerns resource scheduling, aggregation, as well as remuneration. To realize the aggregation process, the k-means algorithm was proposed. The calculations of the clusters optimum number were used to determine the best number of demand response programs to be implemented by the VPP units. The research was based on 20,000 consumers and 500 DG units. Then, in article [13], the proposed methodology was extended to investigate other 2592 operation scenarios.

Under this investigation, a VPP that operates at both low voltage (LV) and medium voltage (MV) distribution networks in Poland was selected. The investigated part of the VPP consists of a 1250 kW hydropower plant (HPP) and associated 500 kWh battery energy storage system (BESS) as well as low voltage loads. The investigation is concerned with power quality issues in the selected part of the VPP. The PQ measurements were performed synchronically in five measurement points of the VPP area. The measurement points include the HPP, the BESS, the associated MV line, and two LV loads. The measurements were conducted for 182 days: from 1 May 2020 to 28 October 2020. Therefore, they are 26 weeks long from the point of view of classical PQ assessment [14].

The single parameter analysis of each measurement point for such a period of time would be very time-consuming. Thus, the concept of the global index was introduced. Such an approach, in the literature, is known under different names e.g., global power quality index [15,16]; unified power quality index [17,18]; total power quality index [19,20]; or synthetic power quality index [21,22].

This article applied the ADI index proposed in [16], and the newly proposed power quality pollution index (PQPI). Then both the classic PQ parameters and the global indexes were used to define datasets for cluster analysis. Global indexes were applied to reduce the size of the input database, without losing features of the PQ data. Then for those databases, hierarchical clustering was performed. Cluster analysis aimed to detect short term specific working conditions of the VPP from the point of power quality. As a tool to realize this, the cubic clustering criterion was applied for results assessment of hierarchical cluster analysis with the Ward algorithm for indicated databases. Finally, the application of PQPI was presented to highlight the difference from the point of PQ level for clusters.

The contributions of this research are as follows:

To realize those contributions, the article is organized into five sections. In Section 2 the virtual power plant description, global index proposition, clustering methods, and input databases are presented. Section 3 presents the results of specific working conditions detection in view of power quality using hierarchical clustering. Section 4 presents a discussion of the results. Section 5 concludes the article.

#### **2. Methodology and Research Object Description**

This section is based on four elements. The first element is a description of the real VPP, that operates in Poland. This VPP became a source for long term, synchronic power quality measurements. Then, the global index approach was discussed. Next the long-term measurements and the global index were combined to obtain different datasets. These datasets consisted of classic power quality parameters and global power quality indexes. Then those datasets were used as an input for hierarchical clustering. The assessment of cluster assignment for those measurement data was realized using cubic clustering criterion (CCC). The CCC were applied to select the adequate number of clusters, that will indicate short-term specific working conditions from a power quality point of view. To summarise the proposed approach, the simplified methodology scheme was presented in Figure 1.

**Figure 1.** Simplified methodology scheme.

#### *2.1. Virtual Power Plant That Operates in Poland as a Source of Power Quality Measurements*

This article deals with a real VPP that operates in Poland, in a region called Lower Silesia. The virtual power plant consists of a fragment of the distribution network on both medium voltage (MV) and low voltage (LV) [23]. The two substations 110/20 kV are used as points of connection to the 110 kV polish grid. However, under this investigation one MV network was selected. The network fed from the 110/20 kV station is an overhead cable network. The selected network has earth fault current compensation [24]. The main distributed energy resources that are integrated into the virtual power plant are a 1.25 MW HPP and a 0.5 MW battery ESS. Both are connected to a medium voltage level.

The scheme of the investigated fragment of the VPP is presented in Figure 1. The analyzed fragment consists of a 20 kV distribution network with a 1.25 MW hydropower plant (HPP\_MV) and an 0.5 MW battery ESS (ESS\_MV). Those energy sources are connected with the HV/MV substation by a 20 kV line (Line\_MV). Additionally, representatives of low voltage loads are indicated: LOAD1\_LV and LOAD2\_LV. LOAD1\_LV is connected with the indicated medium voltage line (LINE\_MV). LOAD2\_LV is connected with the node of the HPP\_MV and ESS\_MV. This fragment of the VPP is monitored by power quality recorders. Power quality recorders are indicated as "R". The location of these recorders is also included in Figure 2. The HPP\_MV and ESS\_MV are connected to one node and their PQ recorders use the same voltage transformer. Thus, in this research, they are treated as one point for the PQ level (HPP and ESS\_MV) and another for the active power level (HPP\_MV and ESS\_MV).

**Figure 2.** The virtual power plant with the power quality (PQ) recorders placements. Where: LINE\_MV: medium voltage line that connects the virtual power plant (VPP) to 110/20 substation; HPP\_MW: 1.25 MW hydropower plant; ESS\_MW: 0.5 MW electric energy storage; LOAD1\_LV: low voltage load related with LINE\_MV; LOAD2\_LV: low voltage load related with the hydropower plant (HPP) and ESS substation.

#### *2.2. Global Power Quality Index*

Recent research on power quality considers different areas. One of these areas is a simplification of the assessment using global values. Thus this article is concerned with the application of the global index-aggregated data index (ADI) [16], as well as the proposition of a new power quality pollution index (PQPI). ADI consists of seven 10 min PQ parameters–frequency (f), voltage (U), an envelope of voltage, short term flicker severity (Pst), unbalance (ku2), total harmonic distortion in voltage (THDu), and maximum harmonic distortion.

However, it was decided to exclude frequency as a customization step of the index to VPP issues as proposed in [16]. Thus, the ADI index corresponds to:

The mentioned indicators are in response to a 10-min aggregation interval proposed by standard IEC 61000-4-30 [25]. They use the mean value from three phase values to calculate one as a representative. Those factors of ADI are based on the differences between the measured 10-min data and the recommended limit as a division. The limits may be taken differently and based on the object. For VPP that operates in the distribution network standard EN 50,160 [26] was selected. The applied limits based on EN 50,160 [26] are:

ADI index responds to the voltage level as well as an envelope of voltage. The same situation is with total harmonic distortion and maximum total harmonic distortion. So in view of data features, they are similar. Thus, in this article, the power quality pollution index (PQPI) is representative of the ADI factor but with the reduction of voltage and harmonic distortion indicators. This reduction would retain the data features of those parameters using the envelope of voltage and maximal THDu. Thus, PQPI includes following indicators:

#### *2.3. Input Databases Description*

During the investigation, three different databases were analyzed. The data for each parameter or indicator were used in a 10-min aggregation interval. Generally, the applied variables represented classical PQ parameters, global indexes as well as the active power level (P). The indicated databases are presented in Table 1.

**Table 1.** Description of input databases.

Database A (PQ parameters + P) consists of classic power quality parameters and active power level:

The database B (ADI + P) consists of ADI components and active power

The third database (PQPI + P) consists of PQPI and active power:

To summarize the database construction a simplified scheme is presented in Figure 3.

**Figure 3.** The comparison between investigated databases for hierarchical clustering.

#### *2.4. Hierarchical Clustering*

Clustering is one of the data mining (DM) techniques, that aims to divide data into groups that represent similar features [27]. Clustering may be realized in two approaches: a hierarchical or a nonhierarchical [28].

The nonhierarchical algorithms aim toward assigning all observations to the earlier known number of clusters [29]. The most commonly used methods are e.g., K-mean, K-median, or expectation maximization [30].

The hierarchical methods constitute x classes of y observations. Hierarchical methods are also realized by two approaches: agglomerative or divisive. In this research, the agglomerative approach was selected. Generally, the agglomerative approach represents a set of observations, when each piece of data is treated as a separate cluster during the first step. Then, the data are connected into new clusters until one single cluster is established. This single cluster contains all the data [31]. The agglomerative methods to obtain clusters are single linkage, complete linkage, average linkage, weighted pair-group average linkage, unweighted pair-group centroid linkage, and the Ward method [31,32].

In this article, hierarchical clustering was selected. It determines if the connection is better realized by a single data point or by a group of similar data (achieved in the previous agglomeration) to get a final classification. In this article hierarchical clustering is realized using the Ward algorithm. Ward algorithm cluster analysis is carried out to connect data concentrated in an average value until the data has a similar value (range). The hierarchical CA algorithm, that uses the Ward method of minimal variance, is based on six steps [31,33].

In the Ward method, the indicated "finding pair of clusters which have the smallest sum of squares distance between the object and the cluster center to which this object belongs" is obtained using Equation (1) [31,33].

$$\mathrm{Dis}\_{\mathrm{lk}} = \frac{\mathrm{n}\_{\mathrm{i}} + \mathrm{n}\_{\mathrm{k}}}{\mathrm{n}\_{\mathrm{i}} + \mathrm{n}\_{\mathrm{j}} + \mathrm{n}\_{\mathrm{k}}} \ast \mathrm{dis}\_{\mathrm{lk}} + \frac{\mathrm{n}\_{\mathrm{j}} + \mathrm{n}\_{\mathrm{k}}}{\mathrm{n}\_{\mathrm{i}} + \mathrm{n}\_{\mathrm{j}} + \mathrm{n}\_{\mathrm{k}}} \ast \mathrm{dis}\_{\mathrm{jk}} + \frac{-\mathrm{n}\_{\mathrm{k}}}{\mathrm{n}\_{\mathrm{i}} + \mathrm{n}\_{\mathrm{j}} + \mathrm{n}\_{\mathrm{k}}} \ast \mathrm{dis}\_{\mathrm{ij}} \tag{1}$$

where: [31,33]

Dispr: the distance of a new cluster to cluster of number "k", k: the proceed numbers of cluster from "i" to "j", disik: the distance of a primary cluster "i" from cluster "k", disjk: the distance of a primary cluster "j" from cluster "k", disij: the common distance of primary clusters "i" and "j", n: number of a single object inside each object.

The big problem in cluster analysis, irrespective of the method, is to determine the final number of clusters [34]. The solution in literature for the Ward method is the cubic clustering criterion (CCC). This criterion is obtained by comparing an observed coefficient of determination (R2) to the approximate expected R2. It is realized using an approximate variance-stabilizing transformation [35]. The positive values of the cubic clustering criterion inform us that the obtained coefficient of determination is greater than would be expected if sampled from a uniform distribution and, therefore, indicate the possible presence of clusters. The features of the cubic clustering criterion are [35]:

The last feature was a contribution to apply CCC criteria to detect short-term working conditions of VPP that are specific (outliners) in view of PQ.

#### **3. Hierarchical Clustering of Power Quality Measurement Obtained from the Virtual Power Plant**

In this section, the comparison between different databases was performed on the basis of hierarchical clustering with the Ward algorithm. The assessment of cluster assignment was realized using the cubic clustering criterion. Then for the selected number of the cluster and the PQ, comparison between clusters was performed using PQPI.

#### *3.1. Comparison between Databases Using Cubic Clustering Criterion*

The PQ measurement time was from 1 May 2020 to 29 October 2020. The analyzed number of PQ points were five: Line\_MV, HPP\_MV, ESS\_MV, Load1\_LV, Load2\_LV. However, due to the fact that the HPP\_MV and ESS\_MV PQ records were obtained from the same voltage transformer they were treated as the same point (HPP and ESS\_MV). The only difference was the active power level. So, for the analysis of HPP and ESS\_MV, there is one more active power parameter than the number of measurement points. For the observed time period, 26 weeks, there is an analysis of 26,208 single 10-min data points. However, the coverage of data point is equal to 97.7% due to measurement device problems. Thus 25,069 10-min data points were accessible [24]. However, as a preprocessing of PQ data, the voltage events connecting data were also excluded as suggested in [36]. Thus, the final number of 10-min data points was 24,612.

Then, for such defined measurement dataset, the input databases for hierarchical clustering were prepared. The database was a matrix that has 24,612 rows (10-min aggregated data) and a different number of columns. The number of columns was connected with the measurement points and the number of variables for each database (check Figure 2). The size of each database set is as follows:

The first aim was the verification of using global indexes (ADI and PQPI) in place of classic PQ parameters. These global indexes aimed to minimize the size of the database and retrain the features of data in point of power quality.

The investigated datasets concern long term measurements. During this measurement time, the specific working conditions (like high/low harmonic content, high low voltage level or asymmetry), are indicated. Such states are mainly, short. Thus, it may be treated as an anomaly in view of the general assessment. The selection of such anomalies (specific short-term working conditions) by analyzing every 10-min data of each PQ parameter separately may be time-consuming. Thus, in this article the application of the cubic clustering criterion (CCC) is proposed.

The CCC was used on the databases (A, B, C) for hierarchical clustering with the Ward algorithm. Under the investigation, the minimum number of clusters was equal to two and maximum was equal to ten. Ten, as the maximum value, was selected on the basis of justification presented in e.g., [37] or [38]. The results were presented in Table 2.

**Table 2.** The results of the cubic clustering criterion for different databases.

The results in point of CCC values were different for each database for different clusters, but for each database the extremal value was indicated for a final number of clusters equal to 4. It means that this division assured clusters that represent data which are very different from one another. Thus, four clusters were selected as the most appropriate to detect the specific short-term working conditions for the investigated measurement. Furthermore, as for all databases that indicated extremum for CCC the least numerous input database was selected to further investigate (database C), which uses PQPI indicators and an active power level.

#### *3.2. Results of Hierarchical Clustering*

As it was indicated in the previous subsection the optimal selection in view of the size of the input database is those that consist of PQPI indicators and active power level (database C). Thus, in this section, that database was used for hierarchical clustering with the Ward algorithm.

The main result of the hierarchical clustering is a dendrogram. The dendrogram for the selected database for 26 measurement weeks is presented in Figure 4. On the vertical line, the connection distance between clusters is presented. On a horizontal line, each of 24,612 single 10-min data points is indicated.

As it was indicated in the previous subsection, division into four clusters has an extremum value for cubic clustering criteria. Based on the dendrogram, it was indicated that for four clusters one is with a small number of 10-min data. The numbers for each cluster are presented and the cluster assignment in the time-domain is presented in Figure 5. It can be observed that cluster 4 is a short-term condition that is represented by only 165 10-min data points. Those 165 10-min data points represent around 0.7% of the measurement time.

#### *3.3. Qualitative Assessment of Hierarchical Clustering Results Using the Global Index*

In this subsection, the qualitative assessment for indicated clusters is performed. The assessment is realized using PQPI. Thus, the comparison for voltage indicator (a), unbalance indicator (b), flicker indicator (c), and harmonic distortion indicator (d) was presented in Figure 6. The assessment goes towards obtaining knowledge about what PQ parameters and for which measurement point there was a reason for indicating this short-term working condition of VPP. Based on this comparison it may be concluded that cluster 4 represents:

**Figure 6.** The qualitative comparison between clusters for power quality pollution index (PQPI) indicators: (**a**) voltage indicator; (**b**) unbalance indicator; (**c**) flicker indicator; (**d**) harmonic distortion indicator.

#### **4. Discussion**

This article is concerned with a virtual power plant that operates in Poland. The presented research is based on synchronic measurements from five PQ recorders. The PQ measurements were performed at both medium and low voltage levels. The PQ data consists of 182 days (26 weeks) (from 1 May 2020 to 28 October 2020). Thus, these data represent long term data during which different working conditions may occur. This dataset, in work [24], was used to compare the working conditions that were defined a-priory. The states were connected with HPP and ESS working condition, and level of active power. Thus in this work, the conditions were obtained without any predefinition but based on data features.

Those long-term measurements were used as the input to define different PQ databases. The proposed databases were based on classical PQ parameters, PQ global indices as well as the level of active power. Database A represents classical PQ parameters and active power. It concerns 20 variables for each measurement point. Database B uses the ADI components separately and active power level. It concerns seven variables for each measurement point. Database C consists of PQPI and active power level. It concerns five variables for each measurement point. It is important to notice that both global indexes (ADI and PQPI) aim to reduce the amount of data that are analyzed. However, this minimization should not cause one to lose the data features.

The research aimed to detect short-term working conditions in view of power quality. This task was realized using hierarchical clustering with the Ward algorithm. For those three databases, the clustering was realized using the cubic clustering criterion to realize the qualitative assessment of the clustering process. As it is known from the literature if CCC has a negative value it may mean that clustered data has anomalies. For all databases, the CCC was negative for final clusters equal to the range of 2 to 10. Additionally, the extremum for each database was the same and equal to four clusters. Thus, for further investigation, the database with the smallest number of variables (database C) was selected. Furthermore, the final number of clusters was selected as four.

Then, for the indicated circumstances, the comparison between clusters for each measurement point was performed. The PQPI indicators such as voltage indicator, unbalance indicator, flicker indicator and harmonic distortion indicator was used. Based on a comparison of the above mentioned parameters it was concluded that this short term condition (anomaly) was connected with problems of voltage, unbalance, and flicker. The harmonic distortion does not have a significant impact on this condition. It is very important to notice that this short-term condition was not connected with the voltage event. All data that contained voltage events were excluded during the preprocessing of measurements.

The appliances of PQPI index and hierarchical clustering indicated the short-term condition and measurement points, for which it occurs. Thus, the general information about the outcome in PQ problems was also indicated. However, using all this information, it is impossible to define the reason for this condition. Thus, the proposed solution seems essential as a first step of the investigation to define the time period of specific working condition occurrence.

Furthermore, to generalize the discussion of the results, it is important to notice that:

#### **5. Conclusions**

The article proposes the application of clustering to long term power quality data obtained from a virtual power plant. The synchronic, multipoint measurements were used as common input to prepare different databases. The databases were based on both classic PQ parameters and global indexes as well as active power level. The selected PQ global indexes (ADI and PQPI) enabled reduction of the size of the input databases and retrain the features of the PQ data.

The application of the global indexes for clustering the input dataset reduced the size by around 74%. The results for 26 weeks clustering in view of cubic clustering criterion had an extremum for the same number of clusters and indicated specific short-term working conditions of the virtual power plant in view of PQ.

Additionally, using the proposed global index PQPI helped decide which measurement points and which group of parameters had caused the specific working condition. However, it is not possible to define the reason for such a situation. Thus, the single parameter for a single measurement point assessment is still needed even though the time period of this short condition is strictly defined. So, the application of global index and hierarchical clustering may be treated as a first step for deeper analysis.

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

**Funding:** This research was funded by the National Center of Research and Development in Poland, the project "Developing a platform for aggregating generation and regulatory potential of dispersed renewable energy sources, power retention devices and selected categories of controllable load" supported by European Union Operational Programme Smart Growth 2014–2020, Priority Axis I: Supporting R&D carried out by enterprises, Measure 1.2: Sectoral R&D Programmes, POIR.01.02.00- 00-0221/16, performed by TAURON Ekoenergia Ltd.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data are not publicly available due to policy of associate company.

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

#### **References**

### *Article* **A Case Study on Data Mining Application in a Virtual Power Plant: Cluster Analysis of Power Quality Measurements**

**Michał Jasi ´nski 1,\*, Tomasz Sikorski 1, Dominika Kaczorowska 1,\*, Jacek Rezmer 1, Vishnu Suresh 1, Zbigniew Leonowicz 1, Paweł Kostyła 1, Jarosław Szyma ´nda 1, Przemysław Janik 2, Jacek Bie ´nkowski 2,3 and Przemysław Prus 2**

**Abstract:** One of the recent trends that concern renewable energy sources and energy storage systems is the concept of virtual power plants (VPP). The majority of research now focuses on analyzing case studies of VPP in different issues. This article presents the investigation that is based on a real VPP. That VPP operates in Poland and consists of hydropower plants (HPP), as well as energy storage systems (ESS). For specific analysis, cluster analysis, as a representative technique of data mining, was selected for power quality (PQ) issues. The used data represents 26 weeks of PQ multipoint synchronic measurements for 5 related to VPP points. The investigation discusses different input databases for cluster analysis. Moreover, as an extension to using classical PQ parameters as an input, the application of the global index was proposed. This enables the reduction of the size of the input database with maintaining the data features for cluster analysis. Moreover, the problem of the optimal number of cluster selection is discussed. Finally, the assessment of clustering results was performed to assess the VPP impact on PQ level.

**Keywords:** virtual power plant (VPP); cluster analysis (CA); power quality (PQ); global index; distributed energy resources (DER); energy storage systems (ESS); power systems; smart grids

#### **1. Introduction**

Currently, in electrical power networks (EPN), the number of renewable energy sources (RES) and energy storage systems (ESS) are scientifically increasing [1]. Thus, different approaches that enable to control them are highly desirable [2,3]. Commonly known are microgrids and virtual power plants (VPP) [4]. Generally, virtual power plants are autonomous units, that are equipped with systems for effective power flow control. VPPs consist of different units that are integrated with the distribution network. The used elements are, e.g., generators, loads, as well as energy storage systems [5]. Thus, the current literature analyzes the real cases of VPPs. The international examples are in, e.g., United Kingdom [6], Denmark [7], Ireland [8], Greece [9], Germany [10], China [11], India [12], Australia [13], and South Korea [14]. The range of VPP functioning is wide. Thus, there is a possibility of indicating different research trends that concerns VPP, e.g., network voltage control by renewable energy sources integrated [15–18], power flow control and analysis [19–22], playing a role on the energy market [23–26], energy management in a VPP [27–30], optimal active and reactive power scheduling [31–34], and ESS sizing, localization, and management in VPP [35–38].

**Citation:** Jasi ´nski, M.; Sikorski, T.; Kaczorowska, D.; Rezmer, J.; Suresh, V.; Leonowicz, Z.; Kostyła, P.; Szyma ´nda, J.; Janik, P.; Bie ´nkowski, J.; et al. A Case Study on Data Mining Application in a Virtual Power Plant: Cluster Analysis of Power Quality Measurements. *Energies* **2021**, *14*, 974. https://doi.org/10.3390/en14040974

Academic Editor: Andrea Mariscotti Received: 2 January 2021 Accepted: 9 February 2021 Published: 12 February 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

One of the elements that concerns VPP is power quality (PQ) issues. Reference [39] introduces the virtual power plant as vehicles to facilitate cost-efficient integration of distributed energy sources into the existing power system (PS). This research also includes a demonstration of the application of the test system. The analysis of the system performance concerns energy efficiency, power quality, and security. Reference [40] proposes the extensions of the standard International Electrotechnical Commission (IEC) 61850 as a solution to enhance the interaction between the virtual power plant controller and the distributed energy resources. This research concerns the implementation of virtual power plant communication and control architecture as a real case study. The presented case concerns the power quality recorders issues and demands presented in IEC 61850. Reference [41] presents virtual power plant management with the priority requirements optimized by the compromised methods. The model of operation optimization of a VPP was based on fuzzy multiple objective optimization problems. The indicated optimization problem concerns the satisfaction of both customers and suppliers, system stability, power quality, as well as the costs of operation limitations. The presented method was verified in a test system. Reference [42] attempts to assure the applicable framework for harmonizing operations of different units of the virtual power plant. The authors concluded that decisions and obtaining profits, although complying with the required power quality levels and real network constraints, are a crucial part of virtual power plant strategies. Reference [43] concerns simulations when a virtual power plant is in islanded grid mode with a thermal power plant for baseload. The presented virtual power plant consists of 0.2 GW wind power, 0.1 GW photovoltaic power, and ±0.25 GW pumped storage. The research results include different control strategies of the storage plant to highlight the impact of a virtual power plant on PQ. Reference [44] presents the coordinative operation problem of multi-energy virtual power plants. The bi-objective dispatch model was proposed for the optimization of the performance of a multi-energy virtual power plant in terms of economic issues and power quality. The presented case study was based on Hongfeng Eco-town in China.

Additionally, literature from 2019 and 2020 also present recent applications of clustering methods to virtual power plant issues. Reference [45] proposes the application of a robust stochastic optimal dispatching method for solving the scheduling problem. In this research, the K-medoids clustering is used to obtain typical scenes of different units integrated into VPP. Reference [46] proposes the virtual power plant multi-timescale scheduling that contains day-ahead bidding and real-time operation. The models are based on the deferrable loads' aggregation model with the k-mean clustering approach. The introduced strategy helps to obtain efficient management of massive deferrable loads to reduce the energy management complexity as well as to increase the general economics, which seems a promising application in the virtual power plant economic scheduling. Reference [47] presents a data-mining-driven incentive-based demand response scheme to model electricity trading between a virtual power plant and its participants. In this article, cluster analysis is used to divide consumers into different categories by their bidoffers. The algorithm applied in this article was based on ordering points to identify the clustering structure (OPTICS) algorithm. Reference [48] presents a virtual power plant load curve cluster analysis approach based on principal-component dimension-reduced analysis, aggregation level clustering, and fc-means clustering. The principal component analysis method is used to define the specific different loads in the virtual power plant aggregation. Then aggregation hierarchical clustering and fc-means clustering are used to realize the division of all load output curves participating in the aggregation. As a result, load curve clusters of the same class are obtained. Finally, the cluster analysis results are analyzed to establish an evaluation system.

Also, the concept of "global/synthetic/unified/total" power quality indices are indicated in the literature, such as total power quality index [49,50], synthetic power quality index [51,52], unified power quality index [53,54], or global power quality index [55,56]. All of these approaches are aimed toward reducing the number of analyzing power quality data. However, in the literature, there is a lack of research that uses the global indexes as

an input to data-mining techniques to reduce the size of the input database. This investigation therefore verifies whether this approach is possible. The verification is based on real long-term PQ data obtained from VPP.

This research concerns a case study of a VPP that operates in Poland. The analyzed VPP is a part of both low-voltage (LV) and medium-voltage (MV) distribution networks. The main units of the VPP are a hydropower plant (HPP), a photovoltaic system (PV), and energy storage systems (ESS). This article aims to analyze a fragment of this virtual power plant that consists of 1.25 MW HPP and associates 0.5 MW ESS as well as LV loads. The presented research is based on PQ measurements. These measurements were realized synchronically in five measurement points. The observed measurement points are HPP, ESS, associated MV line, and two LV loads. The measurements were conducted from 1 May to 28 October 2020. Thus, the measurement period of time was 26 weeks (182 days). The analysis for full weeks is used as in classical PQ assessment [57]. From such a big amount of data, different datasets may be prepared. Thus, in this article, different databases were obtained. Those databases consist of classic PQ parameters as well as an application of the global index. Then, these databases were used as an input to data-mining algorithms. The selected algorithm was k-mean with Euclidean distance. A comparison of the results and effectiveness was performed. Additionally, the solution for defining the optimal number of clusters was performed using the v-fold cross-validation test. Finally, the qualitative assessment of clustering results was presented to respond to the different working conditions of VPP. All calculations were performed in Statistica 13 software (StatSoft Polska, Kraków, Poland).

To summarize the contributions of this article:

To realize those contributions, the article is organized into 6 sections. In Section 2, the clustering methods, global index proposition, and virtual power plant description are presented. Section 3 presents the construction of different datasets and a comparison between them. Section 4 presents the optimal number of cluster selection and a qualitative assessment of the final classification. Section 5 is a discussion of the obtained results. Section 6 presents the conclusions.

#### **2. Methodology and Research Object Description**

This section is based on three main elements of this article. In Section 2.1, the cluster analysis algorithm is introduced as a representant of the data-mining technique. The justification of the k-mean algorithm for long-term data is included. Also, methods for obtaining the optimal number of clusters are presented. Then, the definition of the global index is proposed. The global index is proposed to minimize the number of parameters that represent power quality while retaining their features. Finally, the description of the real virtual power plant is presented. That VPP was used as a source to obtain multipoint synchronic power quality data.

#### *2.1. Cluster Analysis*

Cluster analysis (CA) is one of the data-mining techniques [58]. Generally, the aim of cluster analysis is to divide data in the point of their features [59]. Clustering may be realized in a hierarchical or nonhierarchical approach. The hierarchical methods constitute x classes of y observations. The nonhierarchical approach is based on assigning all observations to the earlier known number of clusters. The non-hierarchical clustering is not a tree as in the case of the hierarchical clustering. It assures the division into groups of the data in order to maximize/minimize some evaluation criteria [60]. The nonhierarchical methods most used in the literature are based on, e.g., k-mean algorithm, k-median algorithm, or expectation maximization (EM) algorithm [61,62]. In this paper, the authors suggest using the nonhierarchical with the k-mean algorithm with Euclidean distance. The Euclidean distance was selected because it is not sensitive to the changeability of a single measurement [63]. It assures the general information about the data difference, especially for multiparameter input [64].

The k-mean algorithm's goal is to find the extremum of the objective function. The k-mean algorithm function with Euclidean distance is defined as [65]:

$$J\ (\mathcal{U},\ M) = \sum\_{i=1}^{m} \sum\_{j=1}^{k} u\_{ij} \ast \sqrt{\sum\_{i} (x\_i - y\_i)^2} \,\tag{1}$$

where:

*J*—objective function,

*U*—matrix of the object belonging to a cluster,

*M*—matrix in which a row vector represents the centroids of clusters,

*i* = 1,2,3, . . . ,*m*—number of objects,

*j* = 1,2,3 . . . ,*k*—number of classes (clusters),

*uij*—element indicating the fact of assignment of *i*-th object to the *j*-th class (cluster),

*xi*—vector of observations belonging to cluster *x*,

*yi*—vector of observations belonging to cluster *y*.

However, the main disadvantage is that for the nonhierarchical approach, there is a need to define the final number of clusters for which data may be divided. There are different approaches to realize this optimal number of cluster selection, e.g., an entropybased initialization method [66], gap statistic [67], u-control chart [68], or k-fold crossvalidation test [69]. In this research, the k-fold cross-validation test was selected. This type of cross-validation is useful for the situation where there is no known test sample: The user-specified 'v' value for v-fold cross-validation. Normally, the v is equal to 3. The v value determines the number of random subsamples that are used for the learning sample. Then, the tree of the specified size is computed v times. After each iteration, it leaves out one of the subsamples from the computations. Then, these subsamples are used as a test sample for cross-validation. The cross-validation cost is computed for each of the v test samples that are then averaged to give the v-fold estimate of the cross-validation costs [69]. Then, on the basis of cross-validation cost, the optimal number of clusters is selected.

#### *2.2. Global Power Quality Index*

One of the current trends in PQ is using global indexes. Thus, in this article, there is a proposition of using the synthetic (global) index. The selected index was called the aggregated data index (ADI) [55,70]. The selected index consists of five classic 10 min PQ parameters (frequency, voltage, flicker severity, asymmetry, harmonic distortion in voltage), and two extremal (envelope of voltage deviation and maximum harmonic distortion).

However, it was decided to exclude frequency as a customization step of the index to VPP issues. Thus, the index corresponds to:

Selected parameters correspond to the demands of the standard IEC 61000-4-30 [72]. Additionally, the mean value of three phase values is used as a representative. All factors that are included in the ADI are based on the differences between the measured 10 min aggregated power quality data and the recommended limits of the selected standard. In this article, the European standard EN 50160 [73] was selected to obtain global values. The applied limits based on EN 50160 [73] are presented in Table 1.

**Table 1.** Acceptable values base on standard EN 50160 [73] used for the global index.

#### *2.3. Investigated VPP*

The investigated VPP is based on a fragment of the distribution network in the Lower Silesia region in Poland [32]. It is supplied by two substations, 110/20 kV. The mentioned substations are connected to a 110 kV electrical power system of Poland [74]. However, in this research, only one substation area was selected. The investigated 20 kV network fed from the station is an overhead-cable network. The selected MV network fed from the second station is mainly an urban cable network. This network has earth fault current compensation. Connected distributed energy resources to the VPP are a 1.25 MW hydro power plant and a 0.5 MW battery energy storage system. Those resources are connected to a MV level.

The simplified scheme of the investigated fragment of the virtual power plant area is presented in Figure 1. It consists of a 20 kV distribution network with 1.25 MW hydropower plant and an 0.5 MW battery energy storage system (ESS) connected with the HV/MV substation by MV line (1—MV). HPP and ESS are connected to the same node of the network. Also, two additional low-voltage loads are indicated: 3—LV and 4—LV. 3—LV is connected with indicated MV-associated lined. 4—LV is connected with the node of the HPP and ESS. Power quality recorders are denoted as a "R" and are also presented in Figure 1. Due to that, the hydro power plant and electric energy storage are connected to one node and their PQ recorders use the same voltage transformer. In further research, they are treated as one point indicated as 2 for PQ issues but the active power level is treated separately as 2-HPP and 2-ESS.

**Figure 1.** Investigated part of VPP with the placement of PQ recorders.

#### **3. Power Quality Data as an Input to Cluster Analysis Techniques**

In this section, the power quality data from VPP were used to prepare three different input databases. The proposed databases consist of classical power quality measurement and active power level as well as global power quality index, which was proposed in Section 2.2. Then, in Section 3.2, the comparison of cluster analysis with the k-mean algorithm and Euclidean distance was performed for those different input databases.

#### *3.1. Input Databases Describtion*

Under this investigation, three different databases were included. Each of the parameters are represented as one value from a 10 min time interval. The indicated databases are:

The first database (Raw PQ data + *Pphase*) consists of classic power quality parameters:

The second database (PQ Global Indicators + *Psum*) consists of ADI index components and sum of active power from all phases:

The third database (Global PQ Index + *Psum*) consists of ADI index and sum of active power from all phases:

To summarize database construction, the simplified scheme is presented in Figure 2.

**Figure 2.** Simplified scheme of the proposed input databases.

#### *3.2. Selection of Optimal Database—Results for 26-Week Measurements*

In this section, the measurement from five PQ recorders localized as indicated in Section 2.2 was used. The observed time was selected from 1 May to 29 October 2020, which represents 26 weeks of the measurements. Thus, in point of PQ assessment, there is an analysis of 26,208 single 10 min data points. However, for such a long period of multipoint measurements, the coverage of data is equal to 97.7%, thus 25,069 data points were used [71]. Also, as a preprocessing of PQ data, the data that come from the time when a voltage event occurred were excluded, as suggested in Reference [62]. So, the final number of 10 min data points was equal to 24,612.

Then, for such a defined measurement dataset, the input databases for cluster analysis were prepared. The database was a matrix that has 24,612 rows and a different number of columns. The number of columns was connected with five measurements and features of the database (check Figure 2). The size of each database set is as follows:

The next step of the investigation was to conduct a cluster analysis of the indicated power quality measurement. The aim was to verify if it is possible to use global indicators in place of classic PQ parameters to minimize the size of the dataset. As the main representant, the k-mean algorithm with Euclidean distance was selected. The final number of clusters was equal to 2. The results of this data-mining process in the time domain are presented in Figure 3.

**Figure 3.** Results of cluster analysis for different input databases. (**a**) Database I: raw PQ data + *Pphase*, (**b**) Database II: ADI components separately + *Psum*, (**c**) Database III: ADI + *Psum*.

To summarize the results of cluster analysis for those three input databases, Table 2 was prepared. In this table, the number of data that were connected to each cluster is given. Additionally, to compare the results of the clustering for different databases, the number of single cells that were included in different clusters compared to database I were calculated. As it can be observed, generally, the final classification for the k-mean algorithm with Euclidean distance for each dataset is similar. The difference between classification is no more than 111 single data, which is only 0.5% of the difference. It is important to notice that the final classification was obtained with 99.5% similarity and the reduction of the dataset was at 90%. Thus, the application of the global index as an input to cluster analysis for general issues is desirable.

**Table 2.** The number of 10 min data points in each cluster for different input databases, and simplified comparison.

#### **4. Cluster Analysis for Identification of Different Working Conditions of Virtual Power Plant**

The previous section indicated that database III is suitable for cluster analysis. The database uses a global index and sum of active power level for each observed measurement point. However, the division into two clusters of such a big database may not be sufficient. Thus, in this section, the investigation of the selection of the optimal number of clusters using the v-fold cross-validation scheme is performed. Then, for the selected number of the cluster, the qualitative assessment is realized to compare different working conditions of VPP.

#### *4.1. Optimal Number of Clusters*

As it was indicated in Section 3.2, the selected input database for PQ issues was database III, which represents global indexes for measurement points and active power level. However, the cluster analysis for this dataset was realized for the previously determined number of clusters (2 clusters). But, to analyze the long-term data, the adequate number of final clusters is unknown at the beginning. Thus, there is a need for the introduction of other methods to obtain this. One of the known solutions is the application of the v-fold cross-validation.

Thus, the application of v-fold cross-validation was realized for dataset III. As a result, the chart of the cost sequence was obtained and is presented in Figure 4. The circumstances for this test were performed for the minimal number of clusters equal to 2 and maximal equal to 10. The maximal value equal to 10 is then justified and indicated, e.g., as in References [75,76].

**Figure 4.** Cost sequence in relation for the number of clusters for v-fold cross-validation for database III and k-mean algorithm with Euclidean distance.

However, to analyze this cost chart, the minimal percentage decrease was calculated. The results of these calculations are indicated in Table 3. In the literature, the most commonly used value of the range of minimal decrease is equal to 5% [69]. Thus, for the observed measurement data applied for database III, the optimal number of clusters is 3.

**Table 3.** The calculations of minimal decrease for v-fold cross-validation test results.

#### *4.2. Qualitative Assessment of Clusters*

As indicated in the previous subsection, the optimal number of clusters using v-fold cross-validation is equal to 3. Thus, in this section, the qualitative comparison is realized for each cluster. The results are presented in Table 4. Additionally, using the knowledge about the operation schedule of HPP and ESS, the main feature for each cluster was indicated.

Generally, the cluster analysis indicated one major working condition (cluster 1). Cluster 1 presents a time when HPP is switched off and ESS is not working with high power. As it can be observed, these conditions last for around 72% of the time. Cluster 2 corresponds to a time when HPP is generally working with high power that takes around 22% of the time, and during this time, ESS is charged/discharged with low power. Cluster 3 represents a time when ESS is discharged with high power. In point of power quality level, the most positive working condition is cluster 3, which represents the lowest value for the global index in each measurement point.

**Table 4.** Qualitative assessment between clusters and main defining feature.

#### **5. Discussion**

This research demonstrated a case study of a virtual power plant that operates in the Lower Silesia in Poland. The presented virtual power plant operates at both low-voltage (LV) and medium-voltage (MV) levels of the distribution network. The investigation concerned synchronic measurements from 5 PQ recorders. The measurements were realized at both MV and LV levels. The measurements were based on 26 weeks (from 1 May to 28 October 2020). Thus, they represent long-term data when different working conditions may occur, but defining this working condition a priori would lead to missing some specific data. The solution for this is an application of cluster analysis that assures the division of data into clusters (that represent different working conditions) based on data features.

The indicated measurements were used as the sources for different databases. The used parameters were classical PQ parameters, proposed global indices, as well as the level of active power. Database I consists of classical PQ parameters and active power level for each phase, separately (22 variables for each measurement point). Database II consists of ADI components separately and active power level as a sum of each phase (7 variables for each measurement point). Database III consists of ADI and active power level as a sum of each phase (2 variables for each measurement point).

The cluster analysis for the k-mean algorithm with Euclidean distance for the three different databases generally indicated the same final classification for 2 clusters. The similarity of data clustering results was higher than 99.5%. So, applying the global index, which represents PQ level, reduced the size of the database by around 90% for the multipoint approach.

Another element of investigation was the proposition of selecting the optimal number of clusters. This step is always an important element of the research. In this article, the v-fold cross-validation was selected. Based on the cost sequence chart, the optimal number of clusters was equal to 3. However, the 6 and 9 clusters also were indicated if the cost sequence would be selected as 2% or 1%.

The final element of the investigation was the qualitative assessment of obtained cluster results. The qualitative comparison was realized for the number of clusters equal to 3, as indicated by the v-fold cross-validation test. The assessment was realized using the global index ADI [55,70]. The standard used to apply limits to the global value was EN 50160 [73]. The results of clustering were related to the working conditions of VPP units. The indicated results were described as a time when HPP and ESS are not working with high power (less than half of the nominal values), HPP is working with high power, and ESS is working with high power. The result of comparison in point of global index indicated that the most positive working condition was cluster 3 (ESS is working with high power). This result means that values of PQ parameter were closer to nominal (e.g., nominal voltage) or the smallest (e.g., asymmetry level).

The analysis of a single point for single PQ parameters seems more vulnerable. But for long-term assessment, such analysis is time-consuming. Additionally, the main purpose of the VPP is generally to achieve economic profits, and technical issues are mostly omitted. So, the proposition of using cluster analysis for the global index database seems interesting to extend the assessment of VPP in a long-term approach.

Finally, it is important to notice that the research was realized in a VPP that operates in Poland, but it may also be applied to other VPPs. Additionally, the proposed solution may

also be applied only if long-term power quality data would be available and the different working conditions of monitored objects occur.

#### **6. Conclusions**

This article proposed the application of cluster analysis in a virtual power plant. Power quality measurements were used as input to prepare different databases. The databases consisted of classic parameters as well as the global indexes. The selected index (ADI) enabled simplifying the assessment from the number of classical PQ parameters to one global value as a representant of each measurement point. But, on the other hand, including extreme 200 ms values of voltage and harmonics parameters represents the extension to the classical methods. Thus, the global index approach simplifies the assessment and increases the range of used parameters during analysis.

The application of the global index as an input to the cluster analysis dataset enables to reduce the size to around 90% for clustering into 2 clusters. The results for 26 weeks of clustering were similar, with a level over 99.5%. Thus, such applications seem interesting.

The cluster analysis for the global index as an input database was indicated as useful for the identification of working conditions in point of PQ. Also, it enables to simplify the assessment between those working conditions, but using this global value does not enable to define the reason for this situation. However, it is a good first step for deep analysis.

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

**Funding:** This research was funded by the National Center of Research and Development in Poland, the project "Developing a platform for aggregating generation and regulatory potential of dispersed renewable energy sources, power retention devices and selected categories of controllable load" supported by European Union Operational Programme Smart Growth 2014–2020, Priority Axis I: Supporting R & D carried out by enterprises, Measure 1.2: Sectoral R & D Programmes, POIR.01.02.00- 00-0221/16, performed by TAURON Ekoenergia Ltd.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data are not publicly available due to policy of associate company.

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

#### **References**

### *Article* **Impact of Harmonic Currents of Nonlinear Loads on Power Quality of a Low Voltage Network–Review and Case Study**

**Łukasz Michalec, Michał Jasi ´nski \*, Tomasz Sikorski, Zbigniew Leonowicz, Łukasz Jasi ´nski and Vishnu Suresh**

Faculty of Electrical Engineering, Wroclaw University of Science and Technology, 50-370 Wroclaw, Poland<EMAIL_ADDRESS>(Ł.M<EMAIL_ADDRESS>(T.S<EMAIL_ADDRESS>(Z.L<EMAIL_ADDRESS>(Ł.J<EMAIL_ADDRESS>(V.S.)

**\*** Correspondence<EMAIL_ADDRESS>Tel.: +48-71320202

**Abstract:** The paper presents a power-quality analysis in the utility low-voltage network focusing on harmonic currents' pollution. Usually, to forecast the modern electrical and electronic devices' contribution to increasing the current total harmonic distortion factor (*THDI*) and exceeding the regulation limit, analyses based on tests and models of individual devices are conducted. In this article, a composite approach was applied. The performance of harmonic currents produced by sets of devices commonly used in commercial and residential facilities' nonlinear loads was investigated. The measurements were conducted with the class A PQ analyzer (FLUKE 435) and dedicated to the specialized PC software. The experimental tests show that the harmonic currents produced by multiple types of nonlinear loads tend to reduce the current total harmonic distortion factor (*THDI*). The changes of harmonic content caused by summation and/or cancellation effects in total current drawn from the grid by nonlinear loads should be a key factor in harmonic currents' pollution study. Proper forecasting of the level of harmonic currents injected into the utility grid helps to maintain the quality of electricity at an appropriate level and reduce active power losses, which have a direct impact on the price of electricity generation.

**Keywords:** nonlinear loads; harmonics, cancellation, and attenuation of harmonics; waveform distortion; THDi; power quality; low-voltage networks

#### **1. Introduction**

Power electronics components and microprocessors are the key entities of the evolution of nonlinear loads and smart devices/systems in commercial and household environments [1,2]. On one hand, due to their nonlinear V–I characteristics, these devices introduce power quality (PQ) problems in the electric power distribution system, and on the other hand they are sensitive to the PQ level. In the case of electrical energy billing, even the revenue meters that measure electrical quantities may be not immune enough to the impact generated by disturbing devices [3–5]. Since the intensified integration of nonlinear components, PQ monitoring is essential to improving the performance of both power system equipment and the end-user loads. [6,7] Thus, the PQ disturbances are the responsibility of not only utilities but also end-users, manufacturers as well as researchers, and engineers. [8,9] The remarkable growth in research and development work on identifying the avoidable energy losses caused by poor PQ has been observed in recent years [10–16]. The proper measurements and analysis of the distribution system and implementation of the evolving methods and techniques to improve the condition of the supply system are developing areas of present-day electrical engineering [17–19].

Due to the nonlinearity of the electrical devices, the major fault in PQ is observed as harmonic pollution. The severity of harmonic disturbances contained in the current signal

**Citation:** Michalec, Ł.; Jasi ´nski, M.; Sikorski, T.; Leonowicz, Z.; Jasi ´nski, Ł.; Suresh, V. Impact of Harmonic Currents of Nonlinear Loads on Power Quality of a Low Voltage Network–Review and Case Study. *Energies* **2021**, *14*, 3665. https:// doi.org/10.3390/en14123665

Academic Editor: Abu-Siada Ahmed

Received: 10 May 2021 Accepted: 16 June 2021 Published: 19 June 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

99

can be specified collectively by the current total harmonic distortion factor (*THDI*), which can be calculated according to the formula:

$$THD\_I = \frac{\sqrt{\sum\_{h=2}^{\infty} I\_h^2}^2}{I\_1} \cdot 100\%\_{\prime} \tag{1}$$

where,

*Ih*—RMS value of the individual harmonic component of order *h* for current, *I*1—RMS value of the fundamental harmonic (a component of order 1) for current.

To forecast how increased nonlinear loads will contribute to the *THDI* level and when they may exceed the regulation limit, harmonic impact and propagation studies of the distribution network need to be performed for future scenarios [20–22]. Distribution system operators can use these analyses and simulations to take preventive steps to avoid deterioration and improve the PQ level [23].

Currently, the increase of new technologies and the changing of conventional appliances to power electronic-driven appliances can be observed in residential and commercial buildings feeding from the LV distribution networks [18,24]. Modern power electronicdriven appliances can be divided into four groups (Figure 1).

**Figure 1.** Groups of modern power electronic-driven appliances.

This nonlinear electrical equipment which, indeed, forms the power system is one of the main causes of harmonic distortion. Since its AC circuit topology draws, often in a pulsed manner, a distorted current whose waveform shape does not resemble the applied voltage waveform shape for the considered cycle, it is non–sinusoidal [21,25].

#### **2. Review**

#### *2.1. Problems Caused by Harmonic Currents*

The first and major problems caused by harmonic currents in the mains feeding residential and commercial buildings are those caused by voltage waveform distortion [18]. Due to the propagation of harmonic currents through a finite system impedance, the vector sum of all individual voltage drops results in the increased voltage total harmonic distortion factor (*THDV*), which contributes to significant deterioration of power quality and affects the effective performance of consumers' devices connected to the same point of common coupling (PCC).

Figure 2 shows the power system where multiple customers are connected at PCC with different operating and load conditions. Because of the significantly distorted supply voltage waveform, all electrical devices (also linear ones) will generate nonlinear currents (in different degrees) [25].

**Figure 2.** The typical model of the customer's loads supply system.

The levels of harmonic currents which the customers are allowed to inject into the power network at the PCC are limited by standards [26,27].

The second problem caused by harmonic currents is associated with the harmonic currents themselves [28]. The harmonic currents injected into distribution networks cause high disturbances [22,29], such as:

#### *2.2. Recent Research*

The equipment within domestic as well as commercial installations is increasingly sensitive to some type of electromagnetic interference, both from internal and external sources [1,18]. Therefore, there is a need to control the electromagnetic environment, namely by limiting the harmonic pollutions caused by any type of electrical appliance. Thus, the IEC 61000–3–2 standard [30] classifies all electrical equipment into four categories, that are presented in Figure 3.

**Figure 3.** Classification of electrical equipment to limit harmonic pollution.

Unlike IEC limits [30] that can be applied to all systems, irrespective of their stiffness, the IEEE standards (according to IEEE Std 519) [31] introduce the harmonics current

distortion criteria limits (individual harmonic distortion as well as *THDI* factors), which are a function of maximum short circuit current *ISC* to maximum demand load current *IL* at PCC [32,33].

From past literature reviews [34–36], it was found that many harmonic current impact studies were performed with individual usage of a specific type of nonlinear device or groups of devices used for the same purpose, often for sinusoidal conditions of the supply voltage [37].

The effects of harmonics current for fluorescent lamps (FLs) with different ballasts are studied in [38]. Various configurations of the fluorescent T8 and T5 tube lamps from different commercial brands were used. The results indicate that with the increased number of fluorescent T8 lamp (from 4 lamps to 10 lamps) with electromagnetic as well as electronic ballasts, the percentage of the total harmonic current distortion factor (*THDI*) has little change, approximately 0.5–1%, while the consumed power increases significantly. For T8 FLs with electromagnetic ballast, the *THDI* ≈ 9%, whereas for the T8 FLs with electronic ballasts the *THDI* ≈ 10%. The newer technology, fluorescent T5 lamps with electronic ballasts, generates much more distorted current waveforms (selected in the experiment low-class lamps). Four T5 FLs show the *THDI* = 23.7% and 10 T5 FLs demonstrate the *THDI* = 27.2%. The authors also present the high class T5 type lighting devices with electronic ballast, which indicate the current total harmonic distortion factor even less (3–5%) than the tested electromagnetic ballast for the T8 lamp.

The comprehensive overview conducted by several researchers investigating the harmonic performance of the utility grid when employing compact fluorescent lamps (CFLs) on a large sczzale is reviewed in [39]. The authors conclude that power quality is affected significantly by CFLs. For a typical CFL tested in [39], the *THDI* is as high as about 75%. However, in [40] the lamps were tested in varying the RMS terminal voltage conditions. The results show that the *THDI* for 12 CFLs of the different manufacturers is practically constant (*THDI* ≈ 110%) in the operation range between 80% to 100% of the nominal voltage of the CFLs. The next research [41] signifies that when connecting subsequent CFLs, the harmonic content is expected to increase as the more distorted current is drawn. To anticipate the problems generated by a massive insertion of small nonlinear loads, several investigations focused on modeling, characterizing, and predicting the increase of harmonic currents due to the CFLs [40,41]. The results of the research on the cancellation of harmonics between groups of compact fluorescent lamps are demonstrated in [42].

Light-emitting diodes (LEDs) and another solid-state lighting (SSL) system's impact on power quality is studied in [12,43,44]. For these types of lighting, the individual current harmonic components as well as the *THDI* values often exceed the limits set by the IEEE standard 519 [26]. According to [44], the LED and micro-LED lamps show moderated harmonic current pollutions. As indicated in [12], as a greater number of LED lamps are connected to the grid, their performance improves both in terms of power factor and harmonic distortion. In [45] it is shown that there is a relevant difference in harmonic pollution behavior of CFLs and LED lamps, not only between the two types of lamps but also within the same type. Thus, it seems to be sensible to utilize some lamp combinations to keep harmonic distortion within permissible limits.

Besides the lighting devices, the literature has documented measurements of other commercial as well as household appliances such as TV sets, personal computers, monitors, printers, laptops, chargers, etc. [18,41,46]. The conventional main interface of these electrical devices consists of a diode bridge rectifier followed by a large DC capacitor. In this case, the current drawn from the AC supply is relatively linear [21]. However, in the newer technology, switch-mode power supply (SMPS) systems, the rectifier is usually followed by a converter that can be controlled in different modes to achieve a smooth DC output. The input current waveform is highly nonlinear and often comes to the load in very short pulses [47]. Today, single-phase electronic equipment almost universally employs SMPSs [21,47,48]. Although individual consumption is small, the collective effect can

be significant because many of them are often connected to the same PCC. Additionally, to satisfy harmonic standards' requirements, the latest SMPSs utilize complex circuits with active power factor correction (PFC) and usually change the equipment classification to Class A according to the mentioned IEC standard [30]. In [49,50], three main circuit topologies of these devices are proposed: without PFC, with passive PFC, and with active PFC. The result is low pollution in the case of sinusoidal supply voltage but often also increased harmonic currents' pollution, which then increases the distortion of the supply voltage as already described.

The experimental measurements of harmonic currents' generation by a cluster of desktop personal computers (20 PCs during different operating modes) are described in [41,51,52]. Generally, the connecting subsequent number of PCs decrease the current total harmonic distortion factor (*THDI*). The main reason is the attenuation phenomenon for the 3rd, 5th, and 7th harmonics [52]. Interestingly, the obtained result shows that when the number of PCs is increased from 1 to 124, the 3rd current harmonic is reduced from 76% to 24% [41]. Other results [51] provide insight into PC harmonic behavior in different conditions. Due to voltage change, the *THDI* of 20 PCs is about 7% lower than that of a single PC. When a group of 20 PCs is fed from the same supply, the *THDI* decreases by more than 15% (in comparison to a single PC) for maximum system impedance. Even with a group of PCs connected to a single supply, changing the system frequency in the range 50 Hz ± 1% has almost no effect on the generated harmonics. Moreover, the studies [51] focused on attenuation and diversity phenomena in PC clusters indicate that diversity effects have a minor impact on the harmonics produced by a cluster of PCs but some kind of harmonic compensation may occur. Also highlighted is that presented factors affecting produced harmonics are related to each other, and if nonlinear devices are supplied by different power systems their harmonics generation and other power quantity levels will be different [52]. This as well as other relevant experimental data can be useful in harmonic characterization studies.

In [47], the energy efficiency of power electronic-based home appliances was analyzed. The authors underline that although most energy-efficient loads based on power electronics consume considerably less power than their older counterparts, they are harmonic polluters and inject a relatively large number of harmonic currents into the power grid relative to their power demand.

#### *2.3. Problem Description*

Most of the presented research focuses on the harmonic generated by one type of commonly used nonlinear loads (NLLs), often in sinusoidal conditions of the supply voltage. The main general properties of all NLLs can be distinguished as follows [41,42,53]:

When large amounts of such appliances operate in power distribution systems, the collective effect on the feeder power quality [54,55] has become a large concern to utilities. For predicting the harmonic current injection to the utility grid and implementing compensation technique, several theoretical models and simulations of nonlinear loads were conducted in the past decades [24]. The level of injected harmonic pollutions from a group of nonlinear loads of the same type operating simultaneously can be predicted by scaling the typical harmonic current spectrum of one load in proportion to total load power [52].

However, we seldom must deal with such a situation in real life because many different types of harmonic sources are almost always connected to one point of common coupling (PCC) [56]. Thus, the simple combined approach for forecasting the level of harmonic current injection to the utility grid is not proper anymore [57]. Therefore, a composite approach is required, which takes into account different nonlinear load types placed in the PCC at the same time [58].

By applying such an approach, not only can the addition effect of many harmonic sources be assessed, but the attenuation outcome of future harmonic distortion in the network can also be better estimated [59]. The main purpose of the experimental tests presented in this paper is to create a first baseline study for office and domestic environments in case of deterioration of PQ by harmonic currents.

#### **3. Case study**

#### *3.1. Methodology for Case Study*

In Stage 1, the problem was defined and detailed, based on the collected knowledge of the subject, and a description was delivered. The theory of the power quality deterioration phenomenon associated with the operation of nonlinear loads was provided in the Introduction section of this paper.

Stage 2 determined relevant aspects to be included in the study and its scope. For the analysis of the deterioration level of PQ caused by harmonic currents, some sets of various commercial and residential electrical appliances with different technical specifications were tested. For comparison, the research was conducted for selected individual devices as well as for sets of diverse appliances.

Table 1 shows the technical specification of the selected nonlinear loads. The power value included in the table is the value that the manufacturer declares the device consumes. All devices are supplied from a single-phase LV network, in a voltage range of 230–240 V, with a frequency of 50 Hz.

The accuracy of the measurements conducted by PQ Analyser Fluke 435 is as follows:

**Table 1.** Technical specifications of the selected equipment.

For each set of devices, the same parameters as those obtained for the appliances individually are measured. One of these sets consists of some typical domestic electrical loads used for a short and long time. For the second test, the office electrical equipment is selected. The third test is conducted for a set of lighting equipment (including an incandescent lamp dimmer) that can be used in both commercial and residential spaces. According to the IEC 61000–3–2 standards [30], incandescent lamp dimmers are not classified into Class C (lighting equipment) in the case of the injection of high-order harmonic currents to the grid, but to Class A, which include difficult-to-classify devices. Thus, the level of harmonic contained in the current drawn from the LV grid by incandescent lamp dimmers

is not so strictly limited as other lighting equipment. Table 2 shows the type of set and the appliances that constitute it.

**Table 2.** Selected sets of equipment.

After the selection of the appliances, the laboratory test stand to assess the impact of various nonlinear electrical equipment on PQ were constructed. The diagram and photo of the prepared test stand are shown in Figures 4 and 5.

**Figure 4.** Diagram of the measurement system.

**Figure 5.** Laboratory measurement stand for testing the impact of nonlinear devices on power quality: (**a**) power supply AC 230 V 50 Hz; (**b**) power quality analyzer Fluke 435; (**c**) adapter for measuring voltage in a single-phase circuit; (**d**) measuring clamp; (**e**) PC with FlukeView software; (**f**) adapter for testing a set of electrical equipment; (**g**) electrical equipment under test.

In Stage 3, the indicators of the impact on power quality associated with their operation were collected. Hence, the current harmonics distortion rate of each of the devices as well three different sets of them are measured. To conduct the measurements, the class A PQ analyzer (FLUKE 435) and the associated equipment were used, including 5 A and 20 A precision current clamps.

In this work, the steady-state operation and respective harmonic pollution of devices are considered. The power quality analysis was performed by the assessment of the current distortion level, which was evaluated via the current total harmonic distortion factor (*THDI*) in percentage. The power quality analyzer allows the recording of harmonics up to the 50th order. Thus, the current distortion rate was calculated according to the expression shown in Equation (2), as defined in IEC 61000–2–2 standard [60].

$$THD\_I = \frac{\sqrt{\sum\_{h=2}^{50} I\_h^2}}{I\_1} \cdot 100\% \tag{2}$$

For organization of the data, Stage 4 in systematic methodology was conducted using the simple mouse-controlled PC software FlukeView (version 3.2), which communicates with the PQ analyzer via the optically isolated OC4USB adapter/cable connected to the USB of the PC. The software enables saving, opening, and printing the data collected by the PQ analyzer, or exporting it to other programs.

The next section of this paper presents the obtained measurement results. It is followed by the discussion section, where the analysis and interpretation of the results are provided (Stage 5).

#### *3.2. Results of Case Study*

This section presents the measurement results that were conducted in a laboratory environment with the class A PQ analyzer (FLUKE 435) on the commonly used residential and commercial appliances to assess their impact on PQ.

In Figure 6, the measurement results for the appliances tested individually are presented. The input current waveforms are shown in a time domain, the harmonic spectra are represented up to the 50th harmonic, and the current total harmonic distortion factor (*THDI*) is obtained in percentage. Additionally, Table 3 was prepared to sum up the information about appliances and results of *THDI*.

**Figure 6.** *Cont*.

**Figure 6.** Measurements obtained for individual devices: (**a**) current waveform; (**b**) harmonic spectrum; 1—AC Power Adapter, 2—Adaptive Fast Smartphone Charger, 3—LCD monitor–20", 4—Vacuum cleaner, 5—Microwave oven, 6— Compact fluorescent lamp, 7—Dimmer and incandescent lamp.

**Table 3.** Current total harmonic distortion factor (*THDI*) measurements obtained for individual devices.

The input current waveforms in all cases are highly non-sinusoidal in each cycle. They are in different shapes and often flow in a pulsed manner, which indicates a relevant harmonic content in the signals. The level of harmonic distortion is graphically represented by bars that represent the individual harmonic magnitudes (as a percentage of the fundamental component). In all harmonic spectra, there is visible a clear advantage of the odd harmonics (gradually decreasing for larger orders) over even harmonics, which suggests that positive and negative half-cycles of the signals are symmetrical.

Analyzing the numerical indicator of harmonic current distortions (the *THDI*) for each device, it can be seen that all of these values are excessively high, which implies that harmonic pollution injected into the network is very significant. The highest measured current distortion rate is equal to 207.3% for the adaptive fast smartphone charger. It is not difficult to imagine the negative impact of a huge number of these devices, which is adequate to the number of smartphones, on the distribution network. The smallest *THDI* is noticed for the microwave oven, and it is equal to 24.6%.

As established in the IEC 61000–3–2 standards [30], the equipment with a rated current not greater than or equal to 16 A must not breach specified limits for harmonic current pollution. The literature [28,30,35] studies in detail whether the commercial and residential nonlinear loads supplied from the low-voltage utility grids meet the established criteria or not. This paper presents results that only support the hypothesis that nonlinear electrical loads are one of the main causes of electrical power quality deterioration and require appropriate analysis to evaluate their negative impact on the AC power distribution system.

In subsections below (Sections 3.2.1–3.2.3), the results of experimental tests for sets of devices are presented. The same parameters as those obtained for the appliances individually are measured.

#### 3.2.1. Experimental Test 1: Set of household equipment

The set consists of some typical domestic electrical loads used for a short and long time, such as an LCD monitor–20", coffee machine, compact fluorescent lamp, microwave oven, AC power adapter (laptop charger), and vacuum cleaner.

Figure 7 shows the waveforms of applied voltage and current drawn by the set of household equipment when connected collectively to the single-phase utility LV network, in the voltage range of 230–240 V. Due to the nonlinear behavior of all connected devices (see Figure 8) the total current drawn from the grid is significantly distorted by high-order harmonic currents, while the supplying voltage waveform is almost sinusoidal in shape.

**Figure 7.** Set of household equipment: (**a**) input voltage waveform; (**b**) input current waveform.

The obtained harmonic spectrum (Figure 8) consists mainly of third (≈25%), fifth (≈7%), and seventh harmonics (≈4%). The values in brackets indicate the magnitude of the harmonic current components in percentages of the magnitude of the fundamental component. The individual amplitudes decrease for larger orders. The *THDI* factor is equal to 25. 7%, which means a relatively low impact on PQ.

As previously mentioned, harmonic cancellation and attenuation phenomena in lowvoltage networks occur. The first is due to phase angle diversity between the same-order harmonics produced by different nonlinear loads; the second is due to system impedance and the corresponding voltage distortion.

Thus, the current flowing through the sockets adapter (Figure 6f) has a lower current total harmonic distortion than each piece of previously individually tested household equipment.

**Figure 8.** Set of household equipment: harmonic spectrum and current total harmonic distortion factor. *THDI* = 25.7%.

#### 3.2.2. Experimental Test 2: Set of Office Equipment

The set consists of some typical office electrical equipment used for a short and long time, such as an LCD monitor–20", fluorescent lamp type T8, compact fluorescent lamp, desktop copier, AC power adapter (laptop charger), and adaptive fast smartphone charger.

The combination of lighting and office equipment also features the harmonic currents' cancellation and attenuation effects in the low-voltage network. Figure 9 shows that the total current drawn in a pulsed manner by the second set of nonlinear loads is strongly distorted, while supplying voltage is almost free from distortion.

The visible bars in Figure 10 represent the odd harmonic currents' magnitudes (as a percentage of the fundamental component). These results demonstrate that the devices operating simultaneously produce less current distortion (*THDI* = 74.7%) than individually, e.g., or one adaptive fast smartphone charger the *THDI* = 207.3% (Figure 6).

**Figure 9.** *Cont*.

**Figure 9.** Set of office equipment: (**a**) input voltage waveform, (**b**) input current waveform.

**Figure 10.** Set of office equipment: harmonic spectrum and current total harmonic distortion factor. *THDI* = 74.7%.

#### 3.2.3. Experimental Test 3: Set of Lighting Equipment

The set consists of some lighting equipment that can be used in both commercial and residential spaces, such as a: compact fluorescent lamp, fluorescent lamp type T8, high–intensity discharge lamp, dimmer and incandescent lamp.

Analyzing the harmonics spectrum (Figure 11) for the set of lighting equipment supplied from one socket adapter, it is evident again that the harmonic currents of different nonlinear loads are vectorially superposed. The higher magnitude reaches the third harmonic (c. 35% of the fundamental component). The amplitudes of successive odd harmonics are lower and do not decrease proportionally (the 17th harmonic ≈ 9%, whereas the 19th harmonic ≈ 1%, and then the 21st harmonic ≈ 7%). The current total harmonic distortion factor (*THDI*) is equal to 46. 3%, and it is reflected in the oscillatory current waveform shape (Figure 12). This leads to the conclusion that the set of different types of lighting equipment has less impact on PQ than, e.g., the *THDI* factor equal to 73.8% for the CFL operating individually (see Figure 6). However, in general, the harmonic currents for CFLs are additive in behavior [51].

**Figure 11.** Set of lighting equipment: (**a**) input voltage waveform, (**b**) input current waveform.

**Figure 12.** Set of lighting equipment: harmonic spectrum and current total harmonic distortion factor. *THDI* = 46.3%.

#### **4. Discussion**

The laboratory experiments demonstrated that the harmonic currents produced by multiple types of nonlinear loads were reduced. This effect is often less significant for the 3rd and 5th and 7th harmonics but becomes important for higher-current harmonics. Thus, the current total harmonic distortion factors (*THDI*) for the combination of different residential, commercial, or lighting receivers were typically lower than for the individually tested units.

Although the results were based on a relatively small sample of electrical appliances, the obtained results are highly useful. For example, adding from 2 to even 10 CFLs to the set of different types of lighting sources in a typical house is not as harmonically harmful as one may expect.

In the obtained results, there were harmonic current summation and cancellation effects between individual loads working on the same network caused by phase angle diversity as well as a system impedance and the voltage distortions corresponding to them. This statement is in accord with harmonic studies about the impact of electric equipment on the utility grid [26,33,36,41].

Causes of summation and cancellation phenomena are other aspects of the presented analysis that will be investigated in future work, together with considering the interactions between different types of loads typically found in the residential and commercial sectors.

In all the different load groups analyzed, it was found that although there is a slight improvement, the distortion effect on the currents is still high.

There are considerable financial losses associated with poor PQ, and thus associated with harmonics [61,62]. The harmonic currents generated by nonlinear loads decrease the power factor, which can be considered an indicator of the quality of the device's energy conversion and consequently distortion power. The reactive power and distortion power lead to actual energy consumption required for these loads' proper operation that is higher than declared by the manufacturer. The losses associated with harmonics constantly vary with the change of the *THDI* factor and thus with connected and disconnected electrical equipment. Even if the amount of wasted energy in one residential area may be negligible, the total amount of energy that is used in the residential and commercial sector is relevant and the losses cannot be neglected anymore.

Working in accordance with the standards often requires some assumptions to be made. In the conducted experimental tests described in this paper, it is simplified that the voltage stays undistorted (sinusoidal, without harmonics); however, in the real low-voltage grid conditions the *THDV* changed continuously in respect to time and location. Thus, the same loads put in two different places in the power system may result in various harmonic characteristics because of two different distortion values in supplying voltage [63,64].

Often, the additional difficulty is to measure harmonic characteristics for many nonlinear receivers in laboratory conditions due to lack of space and costs. Thus, to simulate harmonic currents generated by sets of large–scale nonlinear loads and to assess their impact on power quality, different software packages such as MATLAB, ETAP, CYME, PSCAD are often used [29]. Some of the research related to the simulation of harmonic character by using this software is presented in [42,49].

There are typical mitigation techniques used in industry today to reduce harmonic loading in a system [65]. They include active filtering, series and shunt passive filtering, multiple pulse rectifiers, and isolation transformers. Each type of these solutions has its advantages and disadvantages, which are described in more detail in [66–68].

The PQ problems and their mitigation techniques are playing a very important role in future electrical engineering. Thus, this area requires a continuous process for research and development.

#### **5. Conclusions**

The appliances commonly used in commercial and residential facilities can be significant sources of harmonic currents. This is particularly true when the simple approach for

forecasting the level of harmonic current injection to the utility grid is taken into account. The composite approach also contributes to the harmonic-producing characteristics of electrical equipment.

The objective of this paper was to present a comparative study on both approaches. The measurements were conducted for different nonlinear load types served from the same feeder at the same time. The study indicates that harmonics in the current waveforms strongly deteriorate the quality of the electricity. The current harmonic pollution at PCC depends on the summation and/or cancellation effects in total current drawn from the grid by nonlinear loads. This should be a key factor used to determine the guidelines that limit current harmonic pollution in the distribution system.

Another value of this work is the establishment of a framework for comparing the harmonic effect of various appliances consistently. The next effort is to increase the number of appliance types measured so a useful database can be established.

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

**Funding:** The research was founded by the Chair of Electrical Engineering Fundamentals K38W05D02, Wroclaw University of Science and Technology.

**Data Availability Statement:** Data will be sent on request by correspondence author.

**Acknowledgments:** This research was founded by the K38W05D02 of Wroclaw University of Science and Technology.

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

#### **References**

### *Article* **Off-Grid Rural Electrification in India Using Renewable Energy Resources and Different Battery Technologies with a Dynamic Differential Annealed Optimization**

**Polamarasetty P Kumar 1,\*, Vishnu Suresh 2,3,\*, Michal Jasinski 2 and Zbigniew Leonowicz 2**

**Abstract:** Several families in India live in remote places with no access to grid-connected power supply due to their remoteness. The study area chosen from the Indian state of Odisha does not have an electrical power supply due to its distant location. As a result, this study analyzed the electrification process using Renewable Energy (RE) resources available in the locality. However, these RE resources are limited by their dependency on weather conditions and time. So, a robust battery storage system is needed for a continuous power supply. Hence, the Nickel Iron (Ni-Fe), Lithium-Ion (Li-Ion) and Lead Acid (LA) battery technologies have been analyzed to identify a battery technology that is both technologically and economically viable. Using the available RE resources in the study area, such as photovoltaic and biomass energy resources, as well as the various battery technologies, three configurations have been modelled, such as Photovoltaic Panels (PVP)/Biomass Generator(BIOMG)/BATTERY(Ni-Fe), PV/BIOMG/BATTERY(Li-Ion) and PVP/BMG/BATTERY(LA). These three configurations have been examined using nine prominent metaheuristic algorithms, in which the PVP/BIOMG/BATTERY(Ni-Fe) configuration provided the optimal Life Cycle Cost value of 367,586 USD. Among the all metaheuristic algorithms, the dynamic differential annealed optimization algorithm was given the best Life Cycle Cost values for all of the three configurations.

**Keywords:** optimization techniques; different batteries; off-grid microgrid; integrated renewable energy system

#### **1. Introduction**

Despite the fact that freshwater and energy are essential for human survival, existing and future energy and freshwater demands are having a significant impact on the earth. Renewable Energy (RE) resources play a critical role in addressing these concerns. This is especially true in rural and distant areas where the grid expansion is neither feasible nor cost-effective. For a multitude of reasons, planning and constructing an off-grid microgrid is difficult from a both technological and economic perspective. One of them is the reliance of RE resources on meteorological conditions. A suitable battery storage system is needed for power supply continuity. In order to fulfil the energy requirements, most off-grid systems are either over or under-sized. While the larger system is more expensive and produces more energy, the smaller system is incapable of meeting the required load demands, resulting in a power supply shortage. To overcome these challenges and fully utilize the benefits of an off-grid microgrid built with RE sources, an Energy Management Strategy (EMS) is necessary [1]. Furthermore, renewable energy resources, particularly solar energy resource can be used in a wide range of applications, including solar dryers, solar home systems, solar cookers, thermal power generation and water heaters. The biomass generator can produce both heat and electricity. The hydro energy resource can

**Citation:** Kumar, P.P.; Suresh, V.; Jasinski, M.; Leonowicz, Z. Off-Grid Rural Electrification in India Using Renewable Energy Resources and Different Battery Technologies with a Dynamic Differential Annealed Optimization. *Energies* **2021**, *14*, 5866. https://doi.org/10.3390/en14185866

Academic Editor: Nicu Bizon

Received: 15 August 2021 Accepted: 10 September 2021 Published: 16 September 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

be used for irrigation, drinking water supply and hydropower generation. Wind energy has many applications, including power generation, water pumps and windmills. Some commercial and residential applications of battery energy storage systems are explained as follows. From a commercial point of view, battery energy storage systems are useful in the following applications such as peak shaving, emergency backup, microgrids, load shifting, grid services and renewable energy resource integration. From a residential standpoint, battery energy storage systems are useful in the following applications: storing excess energy produced by the solar PV panels, emergency backup and off-grid applications.

Numerous studies on the sizing of microgrids have been published in reputed journals. These approaches can be classified into three broad categories, which are categorized as follows: (i) software tools such as IHOGA, RETScreen, HOMER and HOGA, [2] (ii) deterministic methodologies such as linear programming, numerical, iterative, graphical design, analytical and probabilistic methods [3] and (iii) metaheuristic algorithms such as Grasshopper Optimization Algorithm (GOA), Moth Flame Optimization (MFO), Genetic Algorithm (GA) and Dragonfly Algorithm (DA). Nevertheless, while software tools are simple to use the relevant components inside them cannot be picked. Furthermore, its algorithms and calculations are hidden from users. When it comes to estimating the size of a microgrid, software tools are constrained by certain assumptions. Deterministic approaches, on the other hand, outperform the software tools but the solutions are trapped at the local optima due to its complex design. They are unable to discover the global best optimal values under such conditions. It should be run several times with random beginning conditions to prevent the local optima trapping. Hence, the solution is unlikely to be the global best optimum value. Obtaining the global best optimal solution may necessitate multiple efforts. Finally, metaheuristic algorithms were chosen as the most promising methods, and they are widely used for optimization problems [4].

Last decade, metaheuristic algorithms were built to manage microgrid sizing issues. Surprisingly, certain algorithms, such as Differential Evolutionary Algorithm (DE), Particle Swarm Optimization (PSO) [5] and GA, are well-known among most software engineers as well as other researchers from other disciplines. They are adaptable techniques and offer better results than deterministic methods by preventing the local optima entanglement. These algorithms offer a range of properties that allow them to tackle any optimization problem and they solve optimization problems by imitating natural processes. On the other hand, the No-Free-Lunch theorem states that while a specific metaheuristic algorithm can produce optimal results for a specific objective function, the same algorithm produces lower performance in other objective functions. For such reasons, researchers working on microgrid sizing issues have looked at robust metaheuristic algorithms [6].

A review of the literature on off-grid microgrid size issues revealed that evaluating the techno-economic feasibility analysis with various battery technologies to deliver an uninterrupted electrical supply is quite limited. Moreover, researchers can determine a specific algorithm's robustness and convergence efficiency using various algorithms. However, such studies are limited.

The limitations stated above should be addressed while analyzing perfect off-grid rural electrification from a techno-economic perspective. So, taking these limitations into account, some research has been undertaken to supply power to four un-electrified villages in the Indian state of Odisha. After conducting some research in the study area, it was discovered that the accessible RE resources in the study area are solar and biomass. Solar energy is the most volatile of the two RE resources due to its time-dependent nature and weather conditions. So, the power supply is not continuous. Hence, a robust battery system is essential to ensure a continuous electrical supply. Therefore, in this study, a detailed analysis with three v kinds of batteries, such as Ni-Fe, Li-Ion and LA, has been carried out. Three types of configurations are modelled using available RE resources and battery technologies to identify the most viable configuration for electrifying the study region, such as Photovoltaic Panels (PVP)/ Biomass Generator (BIOMG)//BATTERY(Ni-Fe), PVP/BIOMG/BATTERY(Li-Ion) and PVP/BIOMG/BATTERY(LA). In order to find out a

feasible configuration to electrify the study area, nine proven metaheuristic algorithms have been used in the study, such as Differential Evolutionary Algorithm (DE) [5], Genetic Algorithm (GA) [6], Moth Flame Optimization (MFO) [7], Dragonfly Algorithm (DA) [8], Particle Swarm Optimization (PSO) [9], Ant Lion Optimization (ALO) [10], Grey Wolf Optimization (GWO) [11], Grasshopper Optimization Algorithm (GOA) [12] and Dynamic Differential Annealed Optimization Algorithm [13]. Finally, after identifying the optimal configuration, it is evaluated with various loss of power supply probability values. The novelty in this work can be summarized as:

#### **2. The Study Area Identification**

The study examined the off-grid rural electrification procedure using an off-grid remote rural area located more than 50 km away. Power supply to this area via grid connection is not possible due to the area's hilly terrain and its location in the middle of a dense forest. Four villages are included in the study area, which are located in the Chandrapur block of the Rayagada district of Odisha state in India. Figure 1 depicts the study area's location on a map of India. The study area's latitude and longitude are 19.5927◦ N and 83.8712◦ E, respectively. The whole population of the villages is accommodated in 153 houses. People in this area continue to rely on candles, kerosene lanterns and solar lamps for illumination.

**Figure 1.** The position of the research region on the Indian map.

#### **3. Renewable Energy Resources Identification in the Study Region**

Natural RE resources can be exploited to electrify off-grid areas. The study area has been completely covered by solar and biomass energy resources. The study area's annual ambient temperature is 26 ◦C. The simulation used a ten-year average, i.e., from 2005 to 2015, of ambient temperature and solar radiation values obtained from the National Renewable Energy Laboratory, which are provided, respectively, in Figures 2 and 3. The study area is located in the middle of a high-density forest, which is around 196 hectares. With a foliage production assumption of 16 tons per hectare. Each year, the foliage for the 196 hectares of forest will be 31.36 tons. If the yearly foliage collecting rate is 60%, the annual foliage collection will be around 19 tons.

**Figure 3.** Study areas ambient temperature.

#### **4. Study Area's Load Estimation**

The load demands have been estimated based on the villagers' load requirements. According to villagers' needs, the total number of load sectors is anticipated to be domestic, community, agricultural, small scale industrial and commercial. Table 1 clearly explains the complete load estimation details of the rated power, quantity and time of usage of the appliances for the study areas winter (November–February) and summer (March–October) seasons of the study area.

*Energies* **2021** , *14*, 5866

**Table 1.** *Cont.*

Charger".

**Figure 4.** The daily load demand of the study area.

#### **5. The Components of Mathematical Modelling**

The optimal sizing of an off-grid microgrid is primarily determined by the components utilized in the analysis, hence accurate component analysis is essential before optimal sizing of the off-grid microgrid. The current study includes PV panels, a biomass generator, a battery bank and a bi-directional converter with a charge controller. The schematic diagram is shown in Figure 5.

#### *5.1. Solar Energy System*

A variety of approaches can be used to compute the PV output power from the PV panels. A normal framework was employed in this study to compute the output power of the PV panels, which was determined by taking into consideration of hourly ambient temperature and solar radiation values [14]:

$$P\_{PV}(t) = PV\_{rated} \times \left( G(t) / G\_{ref} \right) \times \left[ 1 + K\_T \times \left( T\_C - T\_{ref} \right) \right] \tag{1}$$

where, *Tref* = the standard test condition temperature value i.e., 25◦ degrees Celsius for PV cells. *PVrated* = the PV panel's rated power, *KT* = at maximum power, the temperature coefficient, its value is 3.7 × 10−3 (1/◦C) and *Gref* = the solar radiation value at reference condition, its value is 1000 W/m2..

The PV panel cell temperature (*TC*) can be determined as:

$$T\_{\mathbb{C}} = T\_{amb}(t) + (0.0256 \times G(t))\tag{2}$$

The amount of energy produced by the PV panels (*EPV*) can be determined as follows:

$$EPV(t) = NPV \times Ppv(t) \times \Delta t \tag{3}$$

where, Δ*t* = time period.

**Figure 5.** Schematic diagram of the study area electrification model.

#### *5.2. Biomass Generator*

In this study, we are advised to use the down draught gasifier model of biomass generator. The following equation can be used to calculate the power generated by the Biomass Generator [1]:

$$P\_{BMG}(t) = \frac{Q\_{BM} \times \eta\_{BMG} \times CV\_{BM} \times 1000}{DOH\_{BMG} \times 365 \times 860} \tag{4}$$

where, the conversion factor from kcal to kWh is 860, *QBM* = biomass quantity (tons/year), *ηBMG* = efficiency of the biomass generator, *DOHBMG* = per day operative hours of the biomass generator and *CVBM* = the biomass has a calorific value of 4015 kcal/kg.

The biomass generator's hourly energy output is determined as follows:

$$E\_{BMG}(t) = P\_{BMG}(t) \times \Delta t \tag{5}$$

#### *5.3. Battery Bank*

When RE sources are not available to deliver power, the battery bank will supply power in off-grid systems. In general, the battery bank stores the extra energy generated by the RE sources. This phenomenon is known as a battery bank charging process, and it is expressed by the equation below [14,15]:

$$E\_{\rm Bat}(t) = (1 - \sigma) \times E\_{\rm Bat}(t - 1) + (E\_{\rm G}(t) - E\_{\rm L}(t)/\eta\_{\rmConv}) \times \eta\_{\rm CC} \times \eta\_{\rm rbat} \tag{6}$$

where, *EBat*(*t*), and *EBat*(*t* − 1) are the energy levels of a battery bank, respectively, at time "*t* − 1" and "*t*", *σ* = hourly self-discharge rate of the battery, *ηCC* = efficiency of the charge controller, *EL* = electrical energy demand, *EG* = generated electrical energy, *ηConv* = the bidirectional converter's efficiency and *ηrbat* = the battery's round-trip efficiency.

The total electrical energy generation is calculated as:

$$E\_G(t) = \left[E\_{DC}(t) + E\_{AC}(t)\right] \times \eta\_{Conv} \tag{7}$$

where, (*EDC*) denotes the DC energy produced by the RE resources:

$$E\_{DC}(t) = E\_{PV}(t) \tag{8}$$

The AC energy (*EAC*) produced by RE sources is calculated as follows:

$$E\_{AC}(t) = E\_{BMG}(t) \tag{9}$$

Whenever the energy produced by the RE sources is inadequate to meet the load demands or when RE resources completely fail to meet the load demand. The energy in the battery bank will supply the load demand; this occurrence is known as the battery bank discharge process, and it is described in the following equation:

$$E\_{Bat}(t) = (1 - \sigma) \times E\_{Bat}(t - 1) - \left(E\_L(t) / \eta\_{Conv} - E\_G(t)\right) / \eta\_{rbat} \tag{10}$$

#### *5.4. Bi-Directional Converter with a Charge Controller*

The bi-directional converter is essential in off-grid systems because it collects energy from both DC and AC sources. Its primary function is to convert direct current to alternating current and vice versa. The charge controller inside the converter is useful for controlling the battery bank's overcharging and discharging. The following equation can be used to compute the converter's rated power for the off-grid microgrid [2]:

$$P\_{BD\overline{C}-\overline{C}\overline{C}} = E\_{T,max} \times 1.1\tag{11}$$

The multiplication factor 1.1 specifies the converter's overloading capacity, which means that the converter power rating should be 10% greater than the system's peak load demand.

#### **6. Economic Analysis of the Off-Grid Microgrid**

The Life Cycle Cost (LCC) technique is widely used for economic analysis. The LCC has been estimated in this study by adding the Initial Capital Costs (ICC), Erection Costs (*EREC*), the Present Value of O&M Costs (*PV*,*O*&*M*), the Present Value of Replacement Costs (*PV*,*REP*) and the Present Value of Fuel Costs (*PV*,*FUEL*) using all system components, which is expressed as follows [2]:

$$LCC = ICC + EREC + P\_{V,O\&M} + P\_{V,REP} + P\_{V,FILEL} \tag{12}$$

The initial capital cost (*ICC*) of the IRES components are calculated as follows [2]:

$$I\text{CC} = \begin{bmatrix} \text{(C}\_{BMG, cap}) + \left(\text{N}\_{PV} \times \text{C}\_{PV, cap}\right) + \\ \left(\text{N}\_{BAT} \times \text{C}\_{BAT, cap}\right) + \left(\text{C}\_{BDC-\text{CC}, cap}\right) \end{bmatrix} \tag{13}$$

where, *CBMG*,*cap*, *CPV*,*cap*, *CBAT*,*cap* and *CBDC*−*CC*,*cap* are the initial capital costs of the biomass generator, PV panels, batteries and bi-directional converter with a charge controller respectively.

The erection costs (*EREC*) of the IRES components are calculated as follows [2]:

$$\begin{aligned} \text{EECC} = \begin{bmatrix} \left( \mathbf{N}\_{PV} \times \mathbf{C}\_{PV, \text{rect}} \right) + \left( \left( \mathbf{N}\_{\text{BAT}} \times \mathbf{C}\_{\text{BAT}, \text{rect}} \right) \times \sum\_{k=1}^{\text{N}\_r} \frac{(1+x)^{k\text{N}\_c - 1}}{(1+y)^{k\text{N}\_c}} \right) + \\\ \left( \mathbf{C}\_{\text{BDC}-\text{CC}, \text{rect}} \times \sum\_{d=1}^{\text{N}\_r} \frac{(1+x)^{d\text{N}\_c - 1}}{(1+y)^{d\text{N}\_c}} \right) + \left( \mathbf{C}\_{\text{BMC}, \text{rect}} \times \sum\_{g=1}^{\text{N}\_r} \frac{(1+y)^{g\text{N}\_c - 1}}{(1+y)^{g\text{N}\_c}} \right) \end{bmatrix} \end{aligned} \tag{14}$$

where, *CPV*,*erect*, *CBAT*,*erect*, *CBDC*−*CC*,*erect* and *CBMG*,*erect* are erection costs of the PV panels, batteries and bi-directional converter with a charge controller and biomass generator, respectively.

The present value of annual O&M (*PV*,*O*&*M*) costs of the IRES components are calculated as follows [2]:

$$P\_{V, \text{O:M}} = \left[ \begin{array}{c} \left( \text{N}\_{PV} \times \text{C}\_{PV, \rho \& m} \right) + \left( \text{C}\_{BMG, \rho \& m} \right) \\ \left( \text{N}\_{BAT} \times \text{C}\_{BAT, \rho \& m} \right) + \left( \text{C}\_{BDC-CC, \rho \& m} \right) \end{array} \right] \times \sum\_{i=1}^{N} \frac{\left( 1 + \text{x} \right)^{i-1}}{\left( 1 + \text{y} \right)^{i}} \tag{15}$$

where, *CPV*,*o*&*m*, *CBMG*,*o*&*m*, *CBAT*,*o*&*m* and *CBDC*−*CC*,*o*&*m* are O&M costs of the PV panels, biomass generator, batteries and bi-directional converter with a charge controller, respectively, and *y* is defined as follows [2]:

$$y = \frac{I\_{\text{nom}} - x}{1 + x}.\tag{16}$$

where, *Inom* = nominal interest rate, *y* = discount rate, *N* = life span of the project and *x* = inflation rate of the project.

The IRES components, such as a bi-directional converter with a charge controller, biomass generator are needed to replace because they have a shortened lifespan than the project lifetime. The present value of annual replacement cost (*PV*,*REP*) of the microgrid is calculated as follows [2]:

$$P\_{V, \text{REP}} = \left[ \begin{array}{c} \left( \text{N}\_{\text{BAT}} \times \text{C}\_{\text{BAT}, \text{rep}} \times \sum\_{b=1}^{\text{N}\_{\text{r}}} \frac{(1+x)^{\text{N}\_{\text{c}}-1}}{(1+y)^{\text{N}\_{\text{c}}}} \right) + \left( \text{C}\_{\text{BMS}, \text{rep}} \times \sum\_{g=1}^{\text{N}\_{\text{r}}} \frac{(1+x)^{\text{N}\_{\text{c}}-1}}{(1+y)^{\text{N}\_{\text{c}}}} \right) + \\ \quad + \left( \text{C}\_{\text{BDC}-\text{CC}, \text{rep}} \times \sum\_{d=1}^{\text{N}\_{\text{r}}} \frac{(1+x)^{\text{N}\_{\text{c}}-1}}{(1+y)^{\text{N}\_{\text{c}}}} \right) \end{array} \tag{17}$$

where, *CBAT*,*rep*, *CBMG*,*rep* and *CBDC*−*CC*,*rep* are the replacement costs of the batteries, biomass generator and bi-directional converter with a charge controller, respectively, and the *Nr* is defined as follows [2]:

$$N\_r = \operatorname{int}\left(\frac{N - N\_c}{N\_c}\right) \tag{18}$$

where, *Nr* = the number of replacements needed for the system components and *Nc* = life span of each system component.

The present value of annual fuel cost (*PV,FUEL*) of the microgrid is calculated as follows [2]:

$$P\_{V,FIEL} = \left[ \left( \mathbb{C}\_{BM} \times Q\_{BM} \right) \right] \times \sum\_{i=1}^{N} \frac{\left( 1 + \mathbf{x} \right)^{i-1}}{\left( 1 + \mathbf{y} \right)^{i}} \tag{19}$$

where, *QBM* and *CBM* are the quantity and cost of the biomass.

#### **7. The Objective Function and Its Constraints**

The objective function of the system is finding the optimal Life Cycle Cost (LCC) of the system. The system cost mainly depends on two variable parameters such as the number of PV panels and batteries. The objective function is defined as follows:

$$\min \text{LCC}(N\_{PV}, N\_{BAT}) = \sum\_{\text{C=PV,RMG,BAT,BDC-CC}}^{min} (\text{LCC})\_{\text{C}} \tag{20}$$

#### *7.1. Upper and Lower Bounds*