**Grid-Connected Renewable Energy Sources**

Editor

**Jesus C. Hern´andez**

MDPI • Basel • Beijing • Wuhan • Barcelona • Belgrade • Manchester • Tokyo • Cluj • Tianjin

*Editor* Jesus C. Hernandez ´ University of Jaen Spain

*Editorial Office* MDPI St. Alban-Anlage 66 4052 Basel, Switzerland

This is a reprint of articles from the Special Issue published online in the open access journal *Electronics* (ISSN 2079-9292) (available at: https://www.mdpi.com/journal/electronics/special issues/grid renewable energy).

For citation purposes, cite each article independently as indicated on the article page online and as indicated below:

LastName, A.A.; LastName, B.B.; LastName, C.C. Article Title. *Journal Name* **Year**, *Volume Number*, Page Range.

**ISBN 978-3-0365-0998-3 (Hbk) ISBN 978-3-0365-0999-0 (PDF)**

© 2021 by the authors. Articles in this book are Open Access and distributed under the Creative Commons Attribution (CC BY) license, which allows users to download, copy and build upon published articles, as long as the author and publisher are properly credited, which ensures maximum dissemination and a wider impact of our publications.

The book as a whole is distributed by MDPI under the terms and conditions of the Creative Commons license CC BY-NC-ND.

### **Contents**


#### **F. Sanchez-Sutil, A. Cano-Ortega, J.C. Hernandez and C. Rus-Casas**


**Kinga M ´at ´e and G ´abor Pint ´er** Intermittent Renewable Energy Sources: The Role of Energy Storage in the European Power System of 2040

Reprinted from: *Electronics* **2019**, *8*, 729, doi:10.3390/electronics8070729 ............... **207**

### **About the Editor**

**Jesus C. Hern ´andez** was born in Jaen, Spain. He received his M.Sc. and Ph.D. degrees from the ´ University of Jaen, in 1994 and 2003, respectively. Since 1995, he has been an Associate Professor in ´ the Department of Electrical Engineering, University of Jaen. His current research interests are smart ´ grids, smart meters, renewable energy, and power electronics.

### *Editorial* **Grid-Connected Renewable Energy Sources**

**Jesus C. Hernández**

Department of Electrical Engineering, University of Jaén, Campus Lagunillas s/n, Edificio A3, 23071 Jaén, Spain; jcasa@ujaen.es

**Abstract:** The use of renewable energy sources (RESs) is a need of global society. This editorial, and its associated Special Issue "Grid-Connected Renewable Energy Sources", offer a compilation of some of the recent advances in the analysis of current power systems composed after the high penetration of distributed generation (DG) with different RESs. The focus is on both new control configurations and novel methodologies for the optimal placement and sizing of DG. The eleven accepted papers certainly provide a good contribution to control deployments and methodologies for the allocation and sizing of DG.

**Keywords:** renewable energy conversion; power conditioning devices; renewable energy policies; power quality; computations methods; control strategies; electric vehicle charging; energy management systems; ancillary services; monitoring; prognostic and diagnostic

#### **1. Introduction**

A significant share of the electricity presently produced worldwide is generated by centralized systems based on conventional fossil fuel plants or nuclear power. Nonetheless, energy systems across the globe are undergoing a significant transformation as society transitions towards the widespread use of clean and sustainable energy sources. Thus, renewable distributed generation (DG) can play a major role in the future world's energy generation. As a result, the architecture of energy generation is rapidly shifting from centralized to decentralized power plants. Instead of depending on only one energy source, a wide range of types can be used. This will eventually lead to the extensive inclusion of power electronics based on non-synchronous or renewable DG. The grid-interactive power converters involved will significantly improve the flexibility, controllability, and efficiency of conventional power systems. Smart control strategies can thus enable energy management capabilities as well as the provision of ancillary services to the grid from renewable DG. Nevertheless, maintaining a reliable and safe power system poses significant challenges. The optimization of the allocation and sizing of renewable DG is also an important task in this context.

#### **2. A Short Review of the Contributions in This Issue**

To cover the above-mentioned promising areas of research and development, this Special Issue collects the latest research on relevant topics, and more importantly, addresses current issues related to more sustainable, safer, and more resilient power systems. This Special Issue received fifteen submissions, of which eleven were accepted for publication. Various topics are addressed in these manuscripts, mainly on energy storage and photovoltaic and wind power technologies. The contents of these papers are summarized hereafter.

In the paper "Intermittent Renewable Energy Sources: The Role of Energy Storage in the European Power System of 2040" [1], the authors address the challenges of variable renewable energy integration in Europe in terms of the power capacity and energy capacity of stationary storage technologies.

Two papers discuss the issues related to the time framework. In article [2], the enhanced time delay compensator approach manages varying time delays inherent to

**Citation:** Hernández, J.C. Grid-Connected Renewable Energy Sources. *Electronics* **2021**, *10*, 588. https://doi.org/10.3390/electronics 10050588

Received: 8 February 2021 Accepted: 1 March 2021 Published: 3 March 2021

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

**Copyright:** © 2021 by the author. 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/).

communications schemes in power systems. This introduces the perspective of network latency instead of dead time. The potential provision of advanced energy services from the small grid-connected renewable DG is described in article [3]. This work shows that the smart meter roll-out in household-prosumers offers an easy access to granular meter measurements for future advanced energy applications. The development and calibration of a smart meter prototype is adjusted as required in the provision of advanced energy services.

The grid integration of renewable DG is increasingly pursued all over the world due to several technical, economical, and environmental benefits. Consequently, three articles work on the optimal placement and sizing of DG in distribution networks. The work done by S. Katyara et al. [4] exploits genetic algorithms for the proper placement of a new DG; meanwhile, the energy management is designed using a fuzzy inference system. A hybrid master–slave optimization procedure is proposed in article [5]. In the master stage, the discrete version of the sine–cosine algorithm determines the optimal location of the DG. In the slave stage, the problem of the optimal sizing of the DG is solved through the implementation of the second-order cone programming equivalent model to obtain solutions for the resulting optimal power flow problem. Still on the topic of DG, the comparison between AC and DC distribution networks to provide electricity to rural and urban areas from the point of view of grid energy losses and greenhouse gas emissions impact is analyzed in [6]. Results confirm that power distribution with DC technology is more efficient than its AC counterpart.

Electrical system performance can be enhanced to maximize economic benefits by incorporating an appropriate electric energy control scheme. Accordingly, this Special Issues includes four papers focused on converter control. The research in [7] introduces an LC impedance source bi-directional DC–DC converter by redesigning after rearranging the reduced number of components of a switched boost bi-directional DC–DC converter. This novel design decreases the stress on the capacitor voltage compared to existing topologies in literature. The second paper, [8], proposes a proportional-integral passivity-based controller to regulate the amplitude and frequency of the three-phase output voltage in a DC–AC converter with an LC filter. The third paper, [9], authored by Md.R. Hazari et al., presents a novel control scheme for a battery-based energy storage system (ESS) in coordination with an SCIG-based wind turbine generator (WTG), which improves the low voltage ride through capability. A closely related work of [9] is [10], which automatically identifies the frequency stabilization by WTG and ESS. The work models a control scheme that shares their releasable and absorbable energies between both sources.

Another range of topics is addressed in this Special Issue. Thus, a microcontrollerbased PV source emulator is presented in [11]. This modeling and design is based on a completely new technique, which consists in subtracting an adequate amount of current from a fixed direct current source so as to reproduce the desired I–V characteristic.

#### **3. Future**

While the potential of grid-connected renewable DG has been extensively recognized by the research community, several significant obstacles still remain, and therefore, research and technology are essentials tools for attaining a new energy paradigm, which is going towards the responsible and careful use of the environment's resources. In the future, it can be expected that more friendly and pollution-free energy sources will be required in large amounts for sustainable societies. In this circumstance, for the optimal planning of DG in electrical distribution networks, appropriate converter control strategies and approaches should be ready.

**Acknowledgments:** First of all, the Guest Editor would like to thank all the authors for their great contributions in this Special Issue. We are grateful to all the peer reviewers who helped evaluate the submitted manuscripts and made beneficial suggestions for their improvement. We would also like to acknowledge the editorial board of *Electronics*, who graciously invited me to guest edit this Special Issue. Finally, we are grateful to the *Electronics* Editorial Office staff; they worked tirelessly to ensure the peer-review schedule and timely publication.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


### *Article* **Latencies in Power Systems: A Database-Based Time-Delay Compensation for Memory Controllers**

**Alexander Molina-Cabrera 1,2, Mario A. Ríos 1, Yvon Besanger 3,\*, Nouredine Hadjsaid <sup>3</sup> and Oscar Danilo Montoya 4,5**


**Abstract:** Time-delay is inherent to communications schemes in power systems, and in a closed loop strategy the presence of latencies increases inter-area oscillations and security problems in tie-lines. Recently, Wide Area Measurement Systems (WAMS) have been introduced to improve observability and overcome slow-rate communications from traditional Supervisory Control and Data Acquisition (SCADA). However, there is a need for tackling time-delays in control strategies based in WAMS. For this purpose, this paper proposes an Enhanced Time Delay Compensator (ETDC) approach which manages varying time delays introducing the perspective of network latency instead dead time; also, ETDC takes advantage of real signals and measurements transmission procedure in WAMS building a closed-loop memory control for power systems. The strength of the proposal was tested satisfactorily in a widely studied benchmark model in which inter-area oscillations were excited properly.

**Keywords:** power systems analysis; interconnected power systems; latencies; time-delay effects; wide area monitoring systems

#### **1. Introduction**

Wide Area Measurement Systems (WAMS) bring information to the control center in modern power systems to improve observability for achieving stability and security [1,2]. WAMS are integrated by Phasor Measurement Units (PMU) and a sophisticated communication infrastructure [3–7]. This communication infrastructure is based on several standards, interoperability of devices, language, and agents involved in the procedure. Also, this infrastructure involves protocols such as TCP/IP and UDP/IP to provide redundancy, guarantee information integrity, solve traffic problems, and tackle failures of some links [8–11]. For observability purposes, WAMS is better than traditional supervisory control and data acquisition (SCADA). Unfortunately, the measurements managed by WAMS reach the control center with time-delay due to the size of large power systems monitored as well as procedures such as filtering, digitalization, time stamping, and labeling [8,12]. The time-delay is problematic in closed loop control for power systems; i.e., time-lapse in the backward channel is an important issue that emerges with undesirable effects on the performance of transferred power due to inter-area oscillations and frequency oscillations, among others [13–17].

There are many authors who are committed to tackling the time-delay problem in power systems, but the main problem remains unsolved. In the most common perspective, the time compensators were used considering time-lapse as a dead-time phenomenon.

**Citation:** Molina-Cabrera, A.; Ríos, M.A.; Besanger, Y.; Hadjsaid, N.; Montoya, O.D. Latencies in Power Systems: A Database-Based Time-Delay Compensation for Memory Controllers. *Electronics* **2021**, *10*, 208. https://doi.org/10.3390/ electronics10020208

Received: 27 November 2020 Accepted: 13 January 2021 Published: 18 January 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/).

In this direction, one of the first time-delay strategies for compensation was the Smith Predictor (SP), primarily used in chemical process [18–20]. In [19], Chaudhuri et al. implemented a unified SP to design a damping control, but its success dependeds strongly on the exactitude of the model. Then, they proposed a unified Smith phasorial time-delay compensator which runs fast with few calculations; nonetheless, it only works well for small values of delay [21]. Moktari developed a time compensator based on fuzzy logic, which works well for higher values of time delays close to tens of milliseconds; however, it fails in cases of disturbances associated with tripping lines [22]. Another more sophisticated perspective considers the complexities of actual WAMS. For instance, [23] obtains time-delay values from isolated arriving signals using time-stamp from the data package. The authors of [10] employ the knowledge of the WAMS only to simulate the communication procedure in a Hardware In the Loop (HIL) test but leave these data out of the compensation strategy. The first perspective presented above fails because it considers time-delays as a dead-time phenomenon, as in a chemical process; in the second perspective, the complexity of WAMS is considered, but no capitalization of the valuable information available from the communication process is carried out. Generally, recent investigations suffer from misconceptions in modeling and simulating scenarios of time-delay performance [24–26]. Following with the literature revision, the authors in [27] obtain worthy results using buffers and a widearea power oscillation damper (WPOD) to compensate for delays and packet dropouts; nevertheless, the implementation is based on a straightforward model for single-input single-output applied in a Double-Fed Induction Generator (DFIG). Another drawback in the proposal: it takes a long time to stabilize signals (more than 20 seconds) with dangerous power explorations (more than one hundred percent and negative values). Consequently, the main gap in the literature to be filled is the absence of a definitive proposal to face power system oscillations increased by time-delays, considering a more realistic performance of WAMS with high values for network latencies [10,28–31].

There are previous contributions to the aforementioned gap: our early works include an adapted Model Predictive Control (MPC) capable of dealing with the nonlinear largescale nature of delayed power system (power systems with delays in WAMS) to maintain stability; then, we introduced time-delay compensation suitable for tackling fixed and varying values of latencies [32–34]. This paper contributes in time compensation strategies for reaching a memory closed loop control in delayed power systems; furthermore, this work details the WAMS' performance to offer the background needed for the proposal (to run more realistic simulations). The strategy is named Enhanced Time-Delay Compensation (ETDC): it features a Kalman-based time-compensator and a time-organized database of measurements. The ETDC introduces the concept of the Most Updated Available (MUA) information, which is the key value to feed the MPC. The inclusion of historic data in the control closed loop leads to a memory controller to face latencies.

The paper is organized as follows: Section 2 summarizes the general problem of latencies in communications, including some details of their behavior, typical values, and shape. Subsequently, a typical performance of time-delays is illustrated, which will be considered for simulations. Section 3 describes the model of power systems with delays in the backward channel to offer a better picture of the control problem from a math perspective, thereby allowing us to hypothesize the possible solution. Then, in Section 3.2, the Enhanced Time-Delay Compensation is introduced, and some statements are made to study the convenience of the solution. Finally, the results of the simulation (Section 4), conclusions, and further works (Section 5) are presented.

#### **2. Latencies in Wams Communications Infrastructure: Reaching a More Realistic Model**

#### *2.1. The General Delayed Communication Infrastructure*

At present, energy management systems (EMS) have been improved with the introduction of Phasor Measurement Units (PMUs) and their supporting infrastructure. PMUs are fundamental elements of the modern Wide Area Measurement Systems (WAMS), whose capabilities allow the development of Wide Area Monitoring and Control Systems (WAMCS) [3,34–36].

Secondly, signals from several PMUs installed in different locations are gathered with Phasor Data Concentrators (PDCs) to run an additional routine of synchronization; then, each PDC sends the new data packet to the super PDC (SPDC) or directly to the control center. However, these signals do not arrive at the same time due to the inherent latency of communication channels. For this reason, before running the synchronization, PDC manages the absence of simultaneity of the arrival of signals with the assistance of either TCP/IP or UDC/IP protocol. Despite this compensatory mechanism, the total latency increases [8,9].

The measurements are taken with electrical sensors in substations and main buses; then, they are synchronized with PMUs and sent to the control center. The resulting information packet complies with C.37.117.7 and IEC 61850 standards [37]. This procedure includes not only metering but also filtering, processing, digitalization, and time-stamp labelling. Obviously, this procedure add delays to the signal and it is considered the first component of the latency in WAMS.

In cases of a wide area power system, the utilities gather the information of PMUs and other regional PDCs through a Super PDC (SPDCs). Then the SPDCs send the signals to the control center. The time spent by the SPDCs in this process increases the time-delay [8,9,38]. Finally, at the control center, all the signals are gathered to allow control in Wide Area Monitoring Protection and Control (WAMPaC) [6,9].

Another important component of latencies is the signal flying time to travel through the medium and routers at each link. Their stochastic behaviour contributes to the total time delay [35].

In addition to the aforementioned physical infrastructure, the TCP/IP protocol, as well as C.37.117.7 and IEC 61850 standards, are introduced in power system communications to provide flexible, reliable, and standardized communications [8,37]. Standards C.37.117.7 and IEC 61850 provide values of satellite-synchronized time-stamp for each measurement in the WAMS. This time stamp is valuable in the proposal because it allows to determine each signal latency value, which is subsequently included in the compensation scheme. Now, the TCP/IP protocol is responsible for the information interchange among the agents in the communication network. Based on the protocol, the sender always guarantees the reception of the data packets in the final destination. Despite this guaranteed reception, some authors have focused their efforts on the need to face a non-existent loss of data packets [39].

The aforementioned WAMS description shows the capabilities of the power systems' communication infrastructure. In WAMS, the well-structured packets transferred with TCP/IP should be organized in databases due to their useful information (e.g., time stamps), with the purpose of improving power system control and time compensators.

#### *2.2. Behavior and Modeling of the Random Time Delays in the Pmu Communication Infrastructure*

The communication infrastructure can be understood as a net of devices interconnected through communication links. They collect and process information in some topological nodes. Two major delay components are considered to describe the latency. Firstly, *τ<sup>v</sup>* denotes the total time delay produced by the devices mentioned in the previous section (PMU, PDC, SPDC). Secondly, *τ*link is the total additional latency due to the links of the communication process; *τ*link is related to the weather conditions and the medium and is generally greater than *τ<sup>v</sup>* [35]. The sum of these values is given by:

$$
\tau\_d = \tau\_v + \tau\_{\text{link}\prime} \tag{1}
$$

Table 1 shows the typical corresponding ranges of *τ<sup>d</sup>* for different communication links in power systems.


**Table 1.** Ranges of Latencies in Communications [40].

The development of tools to deal with delayed systems requires clarity of the network latencies. The time-delay is stochastic and unpredictable; however, it is possible to model time delays with a probability density function as in [8]. The authors in [8] gathered empirical data, and then they made a goodness-of-fit test. They found that Gaussian shape properly models the time delay behavior of *τ<sup>d</sup>* with a formal math representation given by:

$$
\pi\_d = \mathcal{N}(\mu\_{G'} \sigma\_G)\_\prime \tag{2}
$$

The advantages of the *τ<sup>d</sup>* representation in (2) are a better description of the varying time-delay and the possibility of running more realistic simulations. Figure 1 illustrates an example: the histogram of events called *DG* with a mean value *μ<sup>G</sup>* = 300 ms and standard deviation *σ<sup>G</sup>* = 60 ms. The maximum value for the time delay in this set is close to 550 ms. Typical values *μ<sup>G</sup>* and *σ<sup>G</sup>* presented in [8,40] were adapted for this research to include the effects of the latencies in the simulation of the power systems' behavior.

**Figure 1.** Typical behavior of latencies in a Phasor Measurement Unit (PMU)-based communication system.

#### **3. The Enhanced Time-Delay Compensator for Time-Delayed Power Systems Control: Modeling the Problem to Propose a Solution**

In this section, we derive the math model of the closed loop considering the power system with its nonlinearities because the proposed control must act over the actual nonlinear power system. The math model includes the behavior of network latencies in the feedback channel and the control law based on the estimated delayed states. Based on this model, it was possible to determine the complexities involved in the whole problem to hypothesize a solution. Then, in Section 3.2, the structure of the ETDC is described, taking into consideration the WAMS' description in Section 2 and the math model in Section 3.1. Following this, ETDC consistency and stability are studied trough some statements at the end of Section 3.2.

#### *3.1. Time-Delayed Power Systems Modeling*

The present paper proposes a formal model to include the nonlinearities of power systems and the variability of time-delays, which is made with the purpose to provide a more appropriate representation of the WAMS communications infrastructure. The formulation for modeling the dynamic behavior of nonlinear power systems is as described by (3)–(7):

$$
\dot{x}(t) = f(x(t), u(t)),
\tag{3}
$$

In this case, *u*(*t*) denotes the feedback control law. Basically, Equation (3) describes a memoryless closed loop strategy and if the control law is *u*(*t*) = *γ*(*x*(*t*)), then it turns into:

$$
\dot{x}(t) = f(x(t), \gamma(x(t))),
\tag{4}
$$

Equation (4) represents the ideal case with a proper control law and accessibility to actualized states. Hence, considering the latency in communications in the feedback channel affecting *u*(*t*), the nonlinear problem formulation turns into the autonomous model:

$$\dot{\mathbf{x}}(t) = (\mathbf{x}(t), \gamma(\mathbf{x}(t - \pi\_d))),\tag{5}$$

Now, by including the expression for *τ<sup>d</sup>* denoted by (2):

$$\dot{\mathbf{x}}(t) = (\mathbf{x}(t), \gamma(\mathbf{x}(t - \mathcal{N}(\mu\_{\mathbf{G}\prime} \sigma\_{\mathbf{G}})))),\tag{6}$$

Equation (6) gathers two emerging difficulties to be tackled in real applications on power systems. The first is the power system's nonlinear nature (including parameterchanging, uncertainties and its large number of variables); the second is associated with time delays in the closed loop control strategy. In this regard, although the nonlinearity was successfully addressed in [32,33], the dead time misconception is yet to be faced.

Finally, the computation of the control law in Equation (4) requires the values of *x*(*t*). The typical way to obtain the states in such a complex system is by using state estimators like Kalman filters. Basically, estimators derive estimated values of states, *x*ˆ(*t*), from output signals *y*(*t*). Hence, Equation (6) turns into:

$$\dot{\mathfrak{x}}(t) = (\mathfrak{x}(t), \gamma(\mathfrak{x}(t - \mathcal{N}(\mu\_{G'}, \sigma\_G)))),\tag{7}$$

Note the following: Equation (7) establishes the complexity of the problem, which is highly nonlinear, and the controller must use estimated states *x*ˆ(*t*) instead of actual states *x*(*t*). In addition, it is included the stochastic behaviour of the time-delay trough N (.). From this point, a valuable strategy must keep values of (7) as close as possible from (4) to achieve a good performance.

#### *3.2. The Enhanced Time-Delay Compensator*

This section shows an improved time compensator named Enhanced Time-Delay Compensator (ETDC), which is more suitable for practical power systems and represents a major improvement when compared to previous research in two main aspects: (a) it manages varying values of latencies under a new paradigm that re-evaluates the dead time misconception and (b) incorporates real WAMS operational elements.

As mentioned in the introduction, time-delay compensation is a strategy included in the closed loop controllers to obtain actualized states for the feedback control law in which signals reach the controller with a retard [18–20,41,42]. The main objective of a time compensator is to reduce the error *e*(*ti*) = *x*ˆ(*ti*) − *x*(*ti*) at a given time *ti*, where *x*ˆ(*ti*) is calculated by the time compensator and *x*(*ti*) represents the actual and unknown states. In the compensation strategy, the vector *x*ˆ(*ti*) is calculated from the delayed values *x*(*ti* − *τd*) [18–20]. Most compensators work satisfactorily under two main conditions: the precise model of the system and the knowledge of the constant time-delay value. However, it is almost impossible to have an exact model of the system. Consequently, the implementation of those compensators in real systems has been thwarted: instabilities emerge even with small errors in the model [18,41,43]. The challenge at this regard is identifying how to compensate delayed signals without adding instabilities: here ETDC plays an important role. In Figure 2, the traditional scheme of compensations is illustrated.

**Figure 2.** The Enhanced Time-Delay Compensator scheme.

The proposed ETDC is composed by two main components to be presented: the Sliding Prediction Block, and the added database. By this way, in the closed loop control the ETDC compensates the network latencies; next, signals are delivered to the control strategy. Then, control signals are sent to the power system.

The first component of the ETDC is the Sliding Prediction Block. The authors have been developing tools for damping oscillations in power systems with delays in their communication [33]. As a previous contribution, a time-delay compensator called Sliding Prediction Block (SPB) has been developed. It performs properly with the Model Predictive Control (MPC) strategy adapted to power systems. The SPB is as follows: the classic Kalman filter is fed by the couple *y*(*ti*)-*u*(*ti*) to obtain *x*ˆ(*ti*). The novelty here is: SPB is fed by the delayed states *x*ˆ(*ti* − *τd*) and the known historical control sequence *U*(*ti*) = [*u*(*ti* − *τd*)... *u*(*ti* − *τm*)... *u*(*ti*)]. The values of *x*ˆ(*ti* − *τd*) are obtained by a previous Kalman filter fed by *y*(*ti* − *τd*)-*u*(*ti* − *τd*). Another Kalman filter stage is used recursively to obtain *x*ˆ(*ti*) from *x*ˆ(*ti* − *τd*) . Then, the states are brought to the control strategy.

The second main component of the ETDC is the database which allows keep old measurements. Discrete time is considered for the description. The database takes arriving signals {*x*ˆ(*ki* − *θd*); *θd*} and lists them according to the value of the time delay (here, *θ<sup>d</sup>* is the corresponding time-delay for the delayed signal *x*ˆ(*ki* − *θd*)). The less-delayed data packet is allocated at the top of the list and denoted by {*x*ˆ(*ki* − *θdm*); *θdm*}. This packet will become the Most Updated Available state, *x*ˆMUA, and it allows the building of a memory control strategy for delayed power systems. Then, *x*ˆMUA is delivered to the SPB for the time-compensation. The listing procedure is possible owing to the processing of signals during PMU measurements in compliance with IEEE C37.118 data formatting. Basically, from a specific signal, the PMU takes measurements and organizes them into data packets. Within the information included in the data packet, the time stamp is crucial for both the listing and time compensation.

The Algorithm 1 illustrates the ETDC with the two components. As shown, the simplicity of the procedure allows fast calculations and easy-implementation; also, it is higly scalable. In brief, the strength of the ETDC lies in his simplicity, with very good results.

```
Algorithm 1: Enhanced Time-delay Compensator.
  Data: Read the information of the power system.
1 Require: Delayed states xˆ(ki − θd); Time Delay θd; Buffered Control Signal U(ki);
2 Ensure: Estimated states xˆ(ki);
3 Initialize: iter = 1;
4 θd; xDEL ← xˆ(ki − θd);
5 if iter = 1 then
6 xMUA ← xDEL;
7 θdm ← θd;
8 iter = iter + 1;
9 else
10 BEGIN Database sorting and Listing;
11 read database (θdm, xMUA);
12 if θdm + 1 ≥ θd then
13 xMUA ← xDEL;
14 θdm ← θd;
15 else
16 xMUA ← xMUA;
17 θdm ← θdm + 1;
18 end
19 END Database sorting and Listing BEGIN Sliding Prediction Procedure;
20 for j = ki − θd to j = ki − 1 do
21 x(j + 1) = A(j) + Bu(j);
22 xˆ(ki) ← x(j + 1);
23 end
24 END Sliding Prediction Procedure
25 end
26 iter = iter + 1.;
  Result: Return xˆ(ki)
```
Now, once the signals are compensated by the ETDC, the signals are brought to the robust control strategy. In the case of this work, it was used Model Predictive Control (MPC). As illustrated below, all the strategy is coherently implemented considering the functioning of the MPC. According to Figure 3, the outputs of the Power System are measured, then, data packages are sent to the control center; and they arrive with network latencies. The output and control signals are used by the Kalman filter to obtain the states. Here, ETDC acts to compensate the time-delay in order to obtain an estimation of the current states. This work's main contribution is providing a very good estimation that allows a good performance of the closed control loop strategy. The MPC receives the estimated states to create the control sequence.

Model Predictive Control is responsible for the control task. The MPC strategy creates a time evolution of the states in a horizon of prediction using as initial condition the values of *x*ˆ(*ki*) and the state-space model of the power system [44,45]. There, the evolution of the states are dependent from the control signals *U*(*k*). Thereby, an optimal control problem is built considering an objective function and several constraints. The objective function includes minimization of efforts in control signals and the error in reference, the variable of interest here is the control signal. Physical limits and other considerations are included in the set of constrains. In this way, we derive a convex problem to be solved by any optimization technique [45–47]. The solution is a sequence of control signals in time, the first of which is applied to the power system. This procedure is made recursively at each sampling time using values of *x*ˆ(*ki*) by the ETDC as the initial condition [44,45].

The whole compensation scheme proposed here, including database and SPB, is illustrated in Figure 3.

**Figure 3.** The Enhanced Time-Delay Compensator scheme.

Due to the ETDC, values of time-delay for the compensation strategy has quantitative reductions that can be established by comparison of the datasets from *x*ˆDEL and *x*ˆMUA (see signals in Figure 3). As an example, we took the Gaussian test-data called *DG* of the Section 2 (Figure 1) and built with all the signals *x*ˆDEL (in Figure 3). Those signals were processed by the proposed storage block of the ETDC; so a new set of data *DW* was obtained (corresponding to the set of signals *x*ˆMUA in Figure 3). The resulting histogram of events for the *DW* dataset had Weibull shape with lower means values than the original sets. The dataset *DW* (obtained with the MUA processing) has mean value *μ<sup>W</sup>* = 254 ms being almost 50 ms smaller than the mean value *μ<sup>G</sup>* = 300 ms for the dataset *DG* (without the MUA processing). The data dispersion of the same set of data is also reduced and the maximum value for the latencies after the MUA processing is less than 400 ms, as Figure 4 shows. That is, while a traditional compensator is fed by signals with time-delays around 550 ms (histogram without MUA processing), with the same dataset, the ETDC will feed the SPB with time-delays under 400 ms (histogram of latencies with MUA processing) improving the performance of the compensator.

**Figure 4.** Time Delay shape after using enhanced time delay compensator (ETDC) compared with Sliding Prediction Block (SPB).

The use of the *x*ˆMUA information not only provokes changes in the shape of the data, but also enhances the performance of the SPB. Time-compensator routines are related with the time delay that needs to be compensated for; hence, the computational burden is lowered because *x*ˆMUA are less delayed. Additionally, the error in prediction is improved due to the reduction of the horizon time.

In order to offer information about the convenience of the solution based on the database added to the SPB compensation strategy, some statements are made by the authors.

Firstly, for the compensation procedure in discrete time *k*, a possible statement is: let Ω be an invariant set for *x*(*k*) and *x*ˆ(*k*), let *X* be the time evolution of real states for the autonomous system *x*(*k* + 1) = *f*(*x*(*k*), *γ*(*x*(*t*))), and *X*ˆ ; the resulting trajectory of the time compensator with a representation *x*ˆ(*k* + 1) = *F*(*x*ˆ(*k*)); both *X* and *X*ˆ exist in the interval of time [*ki*, *ki* + *The*] and have *x*<sup>0</sup> = *x*(*ki*) ∈ Ω as the initial condition. *The* represents the horizon of evolution. Additionally, the relationship between *f*(·) and *F*(·) includes the error *E*(·):

$$f(\cdot) = F(\cdot) + E(\cdot),\tag{8}$$

Given a small scalar > 0, and with associated value *δ* > 0, which defines a set of functions *β*:

$$\beta = \{ F(\mathfrak{X}(k)) \| \| F(\mathfrak{X}(k)) - f(\mathfrak{x}(k), \gamma(\mathfrak{x}(k))) \| < \delta \}, \ \forall k \in [k\_i, k\_i + T\_{h\varepsilon}].\tag{9}$$

The states trajectory derived by the compensator satisfies the following:

$$\|\|\hat{X} - X\|\| \le \varepsilon\_{\prime} \; \forall \, k \in [k\_{i\prime}k\_{i} + T\_{hc}],\tag{10}$$

As such, with limited *E*(·), it corresponds to an appropriate representation *F*(·) of the real system *<sup>f</sup>*(·). Then, *<sup>X</sup>*<sup>ˆ</sup> and *<sup>X</sup>* are close trajectories remaining in the invariant set <sup>Ω</sup>.

Secondly, regarding the error in the compensation, a statement could be formulated: let *ζ* = *x*ˆ(*ki* + *The*) − *x*(*ki* + *The*) be the error between *x*ˆ(*ki* + *The*) and *x*(*ki* + *The*) at the end of the time interval [*ki*, *ki* + *The*]. Let [*ki*, *ki* + *Tdb*] be a new interval for the evolution of *x*(*k*) and *x*ˆ(*k*). Given a small scalar value for *ζ* > 0, and with the same associated value of *δ* > 0 for the same compact set of functions *β* (see Equation (9)), the final values obtained by the compensator satisfy:

$$||\mathfrak{X}(k\_i + T\_{db}) - \mathfrak{x}(k\_i + T\_{db})|| \prec\_{\succ} \mathbb{Z}\_{\succ} \,\forall \, T\_{db} \prec\_{\prec} T\_{\text{loc}}.\tag{11}$$

This means that although the trajectories *X*ˆ and *X* are close in the time interval [*ki*, *ki* + *The*], there is a small value *ζ* > 0, due to the error *E*(·) in the model representation. In addition, for shorter horizons of evolution *Tdb*, the difference between the values *x*ˆ(*ki* + *Tdb*) and *x*(*ki* + *Tdb*) at the end of the interval is limited by *ζ*, according to Equation (11). In practical terms: the shorter the horizons of evolution to be compensated, the lower the error in the compensated signal.

The previous statements support an important achievement owing to the ETDC reducing the value of network latencies; the compensated signals are closer to the real ones, hence they accomplish the reduction of the error.

Finally, the block diagram of Figure 5 includes the proposed ETDC into the power system control of the control center. The closed loop is built with the communication system feeding the control center, which, in turn, acts over the nonlinear power system (Equations (3)–(6)). The state estimator is also illustrated; and since the state estimator receives delayed measurements values, *y*(*t* − *τd*), it obtains delayed values of the states *x*ˆ(*t* − *τd*). With the incorporation of the database, the strategy leads to a kind of nonlinear memory controller [48,49].

**Figure 5.** ETDC + Model Predictive Control (MPC) scheme for time delayed Power Systems.

#### **4. Application Test**

*4.1. Test System and Scenarios*

Kundur's benchmark system was used to validate the approach [1]. Despite its small size, this test system performances well in real inter-area oscillations due to time-delays in a single channel; in this system, we can create a scenario with oscillations specifically provoked by time-delays in WAMS. The IEEE 14 bus system and NETS 39-Bus system could be used to validate multiple channel time-delay and to control multiple sources of oscillations in furtherworks. Kundur's test system has two coherent generation areas with four machines (Figure 6), each one with its corresponding governor and Automatic Voltage Regulator (AVR). Two tie-lines guarantee power interchange between both areas; in case of a tie-line tripping, the other one preserves the connectivity. Using the time-delay model from Section 2, the simulations for the communications of the monitoring loop were run with latencies varying from 100 ms to 500 ms [8]. During the monitoring process, a single PMU collected and transmitted data to the control center.

**Figure 6.** Kundur's test system with the control strategy.

As illustrated in Figure 7, the block diagram of the power system to be managed is a Multiple Input Single Output (MISO) representation, in that we have a power system with four inputs (supplementary signals sent by the control scheme to the four generators) and one output measured by the WAMS (inter-area power flow).

**Figure 7.** Multiple Input Single Output (MISO) representation of the power system.

In order to control the test system, the centralized scheme was employed with the proposed approach described in Section 3.2. As illustrated in Figure 6, the centralized controller receives the measure from the inter-area power flow, then it sends four supplementary control signals to G1, G2, G3, G4.

Two strong disturbances were simulated for the power system in a steady state. The first one consisted of a three-phase fault with a tie-line tripping; the inter-area oscillation modes took place in the test system. Then, the steady state was reached, and an additional level of higher stress was provoked with an abrupt change of power reference in the nontripped tie line. In Figure 8, the inter-area oscillation modes are shown, excited due to the three-phase fault; the figure shows power flow response in low frequency oscillations with and without Power System Stabilizer (PSS).

**Figure 8.** Inter-area oscillations in power flow after three-phase fault.

#### *4.2. Performance Comparison between Spb + Mpc and Etdc + Mpc*

Simulations were run with the same test system controlled by two different strategies: (a) the SPB + MPC and (b) the proposal of this paper ETDC + MPC. Both faced three different sequential conditions of operation: (1) initial steady state with a transferred power of 413 MW, (2) a three-phase failure at *t* = 1 s, (transient condition I) and (3) change of power reference with Δ*P* = +25 MW at *t* = 10 s (transient condition II), once the system returns to steady state.

In the case of SPB + MPC, the compensation scheme considers the arriving signal with its corresponding time delay to obtain the current states without using databases. Hence, it works as a memoryless scheme of compensation and control.

Using SPB + MPC (case a), and due to the failure with line tripping, the active power flow reached a dangerous overshoot of 13.8% at *t* = 2.5 s, with real value of 471 MW (Figure 9). Subsequently, SPB + MPC stabilized the power flow close to the initial pre-fault value in a time close to *t* = 6.2 s. With respect to the power system behavior following the change of reference (Δ*P* = +25 MW), the power flow reached a steady state with a new reference of 438 MW after undergoing a second overshoot of 2.66% (calculated with the new reference).

**Figure 9.** Comparative performance using SPB + MPC and the enhanced ETDC + MPC.

Secondly, using ETDC + MPC (case b), the overshoot was 8.4% at *t* = 2.5 s, with a real value of 447.6 MW (Figure 9). After the first overshoot, the ETDC + MPC reached a steady state *t* = 3.8 s. Then, once the reference was changed, the overshoot reached a value of 2.5% followed by the settling time at 15 s. Table 2 illustrates the values.


**Table 2.** Overshoot and Settling Times in the two Transient Conditions Introduced

Next, five different tests were performed with different changes of power reference to add more stress to the controller. The aforementioned test conditions (1)–(3) (Section 4.2) are kept for the sake of comparison. In all the cases, the overshoot after failure was less abrupt (8.9% variation close to 450 MW); then, the active power reached a steady state value close to the initial power reference (see Figure 10). The error after some seconds was less than 4 MW with a downward tendency as in the previous test. At time *t* = 10 s, Figure 10 depicts the behavior of the power flow in the face of reference changes. The five changes in the references and their respective errors are reported in Table 3. The approach can even manage changes in references with Δ*P* = 30 MW.

**Figure 10.** Power flow controlled by ETDC + MPC.



#### **5. Conclusions and Future Works**

The communication infrastructure in power systems based on PMUs, PDCs, SPDCs, protocols, and standards create a complex but useful monitoring system. Thus, WAMS, WAC, WAMC, and finally WAMPaC can be supported by that infrastructure.

The communication infrastructure has an inherent delay due to both the devices and the links, and this issue produces instability problems in the closed loop control strategy. The model of the total latency is not deterministic but stochastic, and the shape of the time delays in typical power communication systems is Gaussian.

Use of the database derived from the MUA concept yields a delayed signal preprocessing to reduce the maximum time delay and mean values. The resulting shape of time delays after using MUA is Weibull. This implies less effort for the time compensation strategies, and, especially, the reduction of latencies leads to better convergence and performance of both the time compensator and the MPC. Improvements achieved are backed up by the results.

The database introduced complies with IEC C.37.117.7, IEC 61850 and TCP/IP, which is the underlying path of the proposed memory controller. Hence, delays were faced as network latencies instead of dead time.

The MPC with the time compensation scheme increases the transfer capabilities in tie lines on the test system; but with the enhanced time delay compensator (ETDC + MPC), it is possible to reduce overshoots and dangerous power excursions. In fact, the achieved reduction of overshoot (almost 39%) implies less stress over the thermal limits and less risk of isolating due to the activation of protection relays.

Further works should examine the performance of the tool considering larger power systems, with several channels (each one with its own stochastic time delay behavior). It is also important to consider the time delay in the control signals during the sending procedure from the control center to generators.

**Author Contributions:** Conceptualization, A.M.-C., M.A.R., Y.B., N.H., and O.D.M.; methodology, A.M.-C., M.A.R., Y.B., N.H., and O.D.M.; formal analysis, A.M.-C., M.A.R., Y.B., N.H., and O.D.M.; investigation, A.M.-C., M.A.R., Y.B., N.H., and O.D.M.; resources, A.M.-C., M.A.R., Y.B., N.H., and O.D.M.; writing—original draft preparation, A.M.-C., M.A.R., Y.B., N.H., and O.D.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** The third author was supported by the Austrian Science Fund FWF (Grant M 2967).

**Acknowledgments:** The first author want to thank Vicerrectoria de Investigación, Innovación y Extensión from Universidad Tecnológica de Pereira for the support provided in this investigation. The fifth author want to thank to the Centro de Investigación y Desarrollo Científico de la Universidad Distrital Francisco José de Caldas under grant 1643-12-2020 associated with the project: "Desarrollo de una metodología de optimización para la gestión óptima de recursos energéticos distribuidos en redes de distribución de energía eléctrica."

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

#### **Abbreviations**


#### **References**


### *Article* **Leveraging a Genetic Algorithm for the Optimal Placement of Distributed Generation and the Need for Energy Management Strategies Using a Fuzzy Inference System**

**Sunny Katyara 1,\*,†, Muhammad Fawad Shaikh 1,†, Shoaib Shaikh 1, Zahid Hussain Khand 1, Lukasz Staszewski 2, Veer Bhan 1, Abdul Majeed 1, Madad Ali Shah 1,\* and Leonowicz Zbigniew 2,\***


**Abstract:** With the rising load demand and power losses, the equipment in the utility network often operates close to its marginal limits, creating a dire need for the installation of new Distributed Generators (DGs). Their proper placement is one of the prerequisites for fully achieving the benefits; otherwise, this may result in the worsening of their performance. This could even lead to further deterioration if an effective Energy Management System (EMS) is not installed. Firstly, addressing these issues, this research exploits a Genetic Algorithm (GA) for the proper placement of new DGs in a distribution system. This approach is based on the system losses, voltage profiles, and phase angle jump variations. Secondly, the energy management models are designed using a fuzzy inference system. The models are then analyzed under heavy loading and fault conditions. This research is conducted on a six bus radial test system in a simulated environment together with a real-time Power Hardware-In-the-Loop (PHIL) setup. It is concluded that the optimal placement of a 3.33 MVA synchronous DG is near the load center, and the robustness of the proposed EMS is proven by mitigating the distinct contingencies within the approximately 2.5 cycles of the operating period.

**Keywords:** DG placement; evolutionary algorithms; energy management; fuzzy controller

#### **1. Introduction**

Notwithstanding the modernization of the existing power system, its operation, control, monitoring, protection, and communication are still challenging aspects to address. Further, the improper placement of the equipment responsible for the performance, safety, and security improvement (i.e., capacitor banks, Distributed Generators (DGs), protective relays, etc.) may result in increased power losses, power quality worsening, and ineffective coordination of the protection devices [1,2]. Amongst all the factors, the level of threat varies, but surely, the non-optimal location and sizing of DGs pose some of the most serious threats, not only to the utility, but also to the end-users. Apart from the fact that the DGs mostly rely on non-conventional energy sources and are environmentally friendly, their exponential growth may still lead to voltage instability, false tripping, power losses, short-circuit level increase, reverse power flow, and faster equipment degradation [3,4].

Prior to the installation of new DGs, many technical data, as well as the environmental and regulatory characteristics of the distribution system need to be analyzed. Amongst the many parameters, the key ones deciding the effectiveness of the DGs placed in the already existing networks are the voltage profiles, system losses, and power flows [5]. However, investigations into the behavior of the power system under normal and fault conditions

**Citation:** Katyara, S.; Shaikh, M.F.; Shaikh, S.; Khand, Z.H.; Staszewski, L.; Bhan, V.; Majeed, A.; Shah, M.A.; Zbigniew, L. Leveraging a Genetic Algorithm for the Optimal Placement of Distributed Generation and the Need for Energy Management Strategies Using a Fuzzy Inference System. *Electronics* **2021**, *10*, 172. https://doi.org/ 10.3390/electronics10020172

Received: 14 December 2020 Accepted: 11 January 2021 Published: 14 January 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/).

require thorough load flow studies and contingency analysis. These affect the power system operation differently, and if the installed protection schemes do not function in a timely manner, the fault situation may result in either islanding or even complete blackout [6,7]. Therefore, to alleviate the adverse effects of different contingencies with the existence of DGs in the network, designing a proper Energy Management System (EMS) is highly required.

The EMS is an optimal control strategy, designed to regulate the energy flow in the network based on the network characteristics, as shown in Figure 1, wherein the sources are the group of existing energy providers in the network, storage represents the energy preserved during the off-load periods, loads are scheduled as pre-defined from the load curves and also dynamically integrated on run-time, and optimal control indicates the series of actions taken to ensure the optimal energy flow and regulation. The EMS provides promising functionalities to regulate the power system instabilities and contingencies within the previously defined constraints [8,9]. Furthermore, the EMS can manage the load profile of the power system following the available energy sources and thus minimizes unnecessary energy usage, extra operational costs, and the prevailing safety issues. An effective EMS makes a significant difference in the power system operation and efficiency, after the proper placement of DGs, by mitigating the undesirable situations, i.e., network unbalance conditions, system faults, islanding, etc. [10,11].

**Figure 1.** General sketch of the energy management system for the optimal allocation of resources in accordance with the network conditions.

Proper placement of DGs and the use of different energy management strategies in the distribution system have been well studied in the literature [12–15], but the close relationship between the two optimization problems, i.e., optimal DG placement and energy management, has not been investigated under different network conditions. In this regard, an analytical approach was proposed in [16] for the proper placement of DGs in a radial network with the aim of minimizing the total power loss without exploiting admittance matrices. The method is computationally promising and robust for a single DG, but its accuracy and performance are compromised for multiple DGs in more complex utility networks. Similarly, a loss sensitivity factor together with the meta-heuristic technique was discussed in [17] for optimal sizing and siting of new DGs sequentially. This suggested approach, however, uses a multi-dimensional cost function for the search algorithm, but is slow and computationally expensive for a large network. Therefore, an efficient and modular algorithm for large power systems was discussed in [18]. The suggested idea exploits quadratic programming to identify and select the optimal position and size of the DG based on the active loss minimization, power balance compensation, and voltage limits' satisfaction. The algorithm uses a passive optimization and controller, which limit its application to networks with the least penetration of DGs and a lack of an effective EMS. To address the issue of energy management in micro-grids with environmental uncertainties related to properly installed DGs, a framework was presented in [19] that uses a fuzzy prediction model as an inference to predict the dynamic characteristics and uncertainties of available energy sources. The method, however, exploits the notion of fuzzy logic to deal with the probabilistic nature of network uncertainties, but still lacks an active controller to make decisions in the transient conditions. Hence, active controller schemes were presented in [20,21] that make use of a fuzzy inference system for battery management and fault classification. However, their application is limited to contingency detection and regulation, and this motivates us to extend the benefits of the fuzzy controller for power system energy management as well.

To the best of our knowledge, there is no single framework available that initially applies a path search algorithm to optimally place the new DGs using the key parameters of the network highlighted earlier and then under different network conditions, exploiting the supervised learning approach to realize the energy management strategies to lessen the adverse effects during distinct contingency scenarios. Overall, the key contributions of this work are (1) using a GA for the proper placement of new DGs using three critical system parameters, i.e., power loss, voltage profile, and phase angle jump, (2) designing the energy management system using a fuzzy controller with 12 inference rules, (3) testing the proposed framework on a system against its performance at different load and fault conditions, and finally, (4) validating the effectiveness and robustness of the proposed approach) it is compared with three other state-of-the-art techniques, i.e., Tabu Search (TS), Artificial Bee Colony (ABC), and ACO.

The subsequent sections of this work are organized as follows: Section 2 presents the proposed methodology and problem formulation for distinct network conditions. Section 3 examines the results achieved with the application of the proposed framework under different case scenarios. Finally, Section 4 gives the final conclusions and remarks on possible extensions of the presented work.

#### **2. Research Methodology**

The test system used to experimentally evaluate the performance of the proposed framework is shown in Figure 2. It consists of 132 kV grid stations supplying a 11 kV distribution feeder through a 26 MVA, 132/11 kV transformer. The feeder energizes different loads, i.e., industrial, commercial, and residential, rated at 1.1 MVA, 2.0 MVA, and 2.5 MVA with power factors of 0.94, 0.9, and 0.86, respectively. The residential load is connected through a 10 MVA, 11/0.4 kV step-down transformer. A synchronous generator (DG) of 3.33 MVA at a power factor of 0.953 is installed in the distribution network using a transformer of 8 MVA, 0.4/11 kV at distinct locations, determined by the search algorithm, as marked by the respective buses in Figure 2.

**Figure 2.** One line diagram of the test system.

However, in this research, a radial system is considered to analyze the performance of the proposed framework owing to the nature and characteristics of existing feeders in distribution networks. However, the proposed framework can also be applied to mesh networks, having the benefits of ensuring the reliability and continuity of supply under the contingency condition in contrast to radial systems with minor modifications. The network characteristics determined and the load flow analysis carried out in subsequent sections for the radial system in Figure 2 need to be changed according to [22].

#### *2.1. Network Characteristics*

Based on the same voltage regulation of the utility network and the new DG, the magnitude of the voltage sag at the point of connection in Figure 2 can be calculated using Equation (1) [23].

$$V\_{\text{sag}} = V\_N - (\frac{Z\_N}{Z\_{\text{DG}}}) \times I\_F \tag{1}$$

where *Vsag* is the voltage sag due to system contingencies as reported in Figure 3, *VN* and *ZN* are the voltage and impedance of the utility network, respectively, *ZDG* is the impedance of the installed DG system, and *IF* is the magnitude of the fault current. The voltage sag eventually results in a phase angle jump and that is determined by Equation (2), with *XN*, *RN*, *XDG*, and *RDG* representing the reactances and resistances of the utility network and installed DG, respectively.

$$
\Delta\theta = \tan^{-1}(\frac{X\_N}{R\_N}) - \tan^{-1}(\frac{X\_N + X\_{DG}}{R\_N + R\_{DG}}) \tag{2}
$$

**Figure 3.** Different system contingencies and associated voltage sag estimations. (**a**) Normal condition, (**b**) fault condition at the utility bus, (**c**) fault condition for the transmission network near the utility, and (**d**) fault condition for the transmission network near the DG.

If *XN RN* <sup>=</sup> *XDG RDG* , it is a so-called zero phase angle jump condition. The jump in angle occurs when the X/R ratio of the utility network and DG system are mismatched during the system operation. Thus, it is desirable to have the least phase angle jump in the voltage to ensure the maximum contribution of the DG system in the network. With the maximum contribution of the DG system, the total system losses occurring are governed by Equation (3) [24], with *PL* and *QL* representing active and reactive line losses, respectively, i the respective bus number, and *IN* and *IDG* the network and DG currents, respectively.

$$P\text{:} + jQ\_{l} = \left(I\text{N} + I\_{DG}\right)^{2} \times \left[\left(R\text{N} + R\_{DG}\right) + j\left(X\text{N} + X\_{DG}\right)\right] \tag{3}$$

#### *2.2. Distributed Load Flow Algorithm*

A high R/X ratio, unbalanced loading, and the distributed nature of utility networks make some load flow techniques such as Gauss–Seidel, Newton–Raphson, etc., inefficient [25]. Hence, specialized algorithms such as the Backward/Forward Sweep (BFS) method are required for load flow analysis of radial distribution networks. Such techniques are based on Kirchhoff's Current Law (KCL), which defines the current injections into the network as Equation (4) [26].

$$I\_{\dot{l}}^{\dot{j}} = (\frac{P\_{\dot{l}}^{\dot{j}} + jQ\_{\dot{l}}^{J}}{V\_{\dot{i}}^{\dot{j}}}) \tag{4}$$

where *Ii j* , *Vi j* , *Pi j* , and *Qi <sup>j</sup>* represent the current, voltage, and active and reactive power, respectively, at the *i th* bus during the *j th* iteration. Applying KCL to the test system in Figure 2 results in the Bus Injection to Branch Current (BIBC) matrix in Equation (5) [26]:

$$
\begin{bmatrix} B\_A \\ B\_B \\ B\_C \\ B\_D \\ B\_D \\ -B\_E \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 & -1 & 1 \\ 0 & 1 & 1 & -1 & 1 \\ 0 & 0 & 1 & -1 & 1 \\ 0 & 0 & 0 & -1 & 1 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} I\_A \\ I\_B \\ I\_C \\ I\_D \\ I\_E \end{bmatrix} \tag{5}
$$

The current variations at all the buses due to either load changes or faults causing corresponding voltage changes are defined by the Branch Current to Bus Voltage (BCBV) matrix in Equation (6) [26].

$$
\begin{bmatrix} V\_A \\ V\_A \\ V\_A \\ V\_A \\ V\_A \end{bmatrix} - \begin{bmatrix} V\_B \\ V\_C \\ V\_D \\ V\_E \\ -V\_F \end{bmatrix} = \begin{bmatrix} Z\_{AB} & 0 & 0 & 0 & 0 \\ Z\_{AB} & Z\_{BC} & 0 & 0 & 0 \\ Z\_{AB} & Z\_{BC} & Z\_{CD} & 0 & 0 \\ Z\_{AB} & Z\_{BC} & Z\_{CD} & Z\_{DE} & 0 \\ Z\_{AB} & Z\_{BC} & Z\_{CD} & 0 & Z\_{DF} \end{bmatrix} \begin{bmatrix} B\_A \\ B\_B \\ B\_C \\ B\_D \\ B\_D \end{bmatrix} \tag{6}
$$

#### *2.3. Problem Formulation*

The first objective of this research is to find the optimal location and size of a new DG in the utility network, which reduces the overall system losses and improves the voltage profile. Therefore, the objective function of this problem can be formulated as Equation (7),

$$F(X\_{\rm DG}, P\_{\rm DG}, Q\_{\rm DG}) = \min(\gamma\_1 V\_{\rm agg} + \gamma\_2 S\_L + \gamma\_3 \Delta \theta) \tag{7}$$

where ∑<sup>3</sup> *<sup>i</sup> γ<sup>i</sup>* = 1 and *γ* ∈ [0, 1] is the weighted coefficient. The optimization problem defined in Equation (7), with its members defined in Equations (1)–(3), has equality, inequality, and bound constraints. The equality constraints are explained using Equation (8), which states that the sum of the utility power (*SN*) and DG power (*SDG*) should be equal to the sum of the total system load (*SLoad*) and losses (*SL*) in order to maintain the balance of power and ensure the system stability. However, the load profile considered in Equation (8), which in this case is a combination of industrial, commercial, and residential entities with a cumulative capacity of 5.6 MVA at different power factors, is

assumed to be fluctuating at a steady rate from 2.5 MW to 5.0 MW within the scheduled time frame.

$$S\_N + S\_{DG} = S\_{Load} + S\_L \tag{8}$$

With the successful integration of the DG with the utility network, the system losses need to be lower than the allowed thermal limits of the lines. Therefore, the X/R ratio of the new DG ( *XDG RDG* ) should be less than the cumulative X/R ratio of the load and utility ( *XL RL* <sup>+</sup> *XN RN* ), satisfying the phase angle jump condition, as described by the inequality constraint in Equation (9).

$$\frac{X\_{DG}}{R\_{DG}} < \frac{X\_L}{R\_L} + \frac{X\_N}{R\_N} \tag{9}$$

Further, it is assumed that the location of the new DG (*XDG*) is near the load center, so the iteration of the GA always starts from Bus-B (*XBus*−*B*) and ends at Bus-E (*XBus*−*E*), as defined by Equation (10).

$$X\_{\text{Bus}-B} \le X\_{DG} \le X\_{\text{Bus}-E} \tag{10}$$

Moreover, the size of the new DG (*SDG*) may be less than or equal to the total connected load (*SLoad*), but should be always greater than the system losses (*SL*), as explained by Equation (11).

$$S\_L < S\_{DG} \le S\_{L \text{and}} \tag{11}$$

The voltage at all the buses (*VBus*) should be within the defined lower (*VLow*) and upper (*VHigh*) tolerance limits of ±10%, which define the bound constraint using Equation (12) together with Equations (10) and (11) on the objective function in Equation (7).

$$V\_{Low} \leq V\_{Bus} \leq V\_{High} \tag{12}$$

As a part of the optimization problem, the financial constraints also need to defined for the optimal placement of new DGs and the possible return in terms of loss reduction. The capital cost (*Cc*) in \$/h upon installing a new DG is defined by Equation (13):

$$\mathcal{L}\_c = \mathfrak{a}\_1 \mathcal{S}\_{DG}{}^2 + \mathfrak{a}\_2 \mathcal{S}\_{DG} + \mathfrak{a}\_3 \tag{13}$$

where *α*1, *α*2, and *α*<sup>3</sup> are the cost coefficients, and their values not only depend on the size and nature of the incoming DG, but also the characteristics of the utility network under investigation. In this research, their values are chosen as 0.1, 0.23, and 0.34, respectively. Based on these values, the cost of installing a given synchronous DG of size 3.33 MVA is about 2.125 \$/h. Hence, the daily return (*R*) achieved in \$ on the loss reduction after an optimal integration of DG is determined by Equation (14):

$$R = \Delta P\_L \times E\_R \times T\_D \tag{14}$$

where Δ*PL* is the change in the active power loss of the network, *ER* is the tariff rate of supplied energy, and *TD* is the time duration of DG operation. The values of *ER* and *TD* selected for this research are 0.015 \$/kWh and 24 h, respectively.

#### *2.4. Genetic Algorithm*

The Genetic Algorithm (GA) is a biologically-inspired method based on Darwin's principle, which evaluates the best possible set of solutions for the fitness of human beings [27]. The main reason for using GA for our application is its parallel search for points from the population. Therefore, it cannot be trapped into a local optimum like conventional techniques, which search for a single point in each iteration. The GA is a probabilistic approach rather than a deterministic and does not involve any derivatives or auxiliary data, but uses fitness parameters to search for the optimal solution.

The GA outputs different chromosomes as shown in Figure 4 for the optimal location and size of the DG based on the constraints of the objective function in Equation (7) for maximizing the voltage profile of the system and minimizing the power losses. Evaluating the objective function using two operators, mutation and crossover, the new set of chromosomes is generated. The crossover operator is used to find the best possible parameter space, and the mutation operator guards the resultant information such that it is encrypted. The stopping criteria for GA are based on two conditions, i.e., either the value of the objective function calculated from the new set of chromosomes is less than the pre-defined error or the maximum number of iterations for the system has been reached. In this research, the crossover and mutation operators (C and M) are assigned probabilities of 0.7 and 0.2, respectively. The algorithm is initialized with a set of 15 chromosomes for 36 iterations, and the final set of chromosomes in Figure 4 defines the best possible location and size of the new DG, obtained with the optimal solution of the objective function in Equation (7).

**Figure 4.** Final set of chromosomes for the optimal location and size of the new DG determined with the application of the GA.

#### *2.5. Fuzzy Inference System*

A Fuzzy Inference System (FIS) is based on if-then conditions to make approximations of complex nonlinear functions, representing the trends of network variables. The FIS mainly consists of five major functionalities for exploiting qualitative features of human reasoning and decisions in terms of data sets without considering their quantitative aspects in particular, as shown in Figure 5, where the fuzzification module transforms the numerical values of the system variables, i.e., current, voltage, and power, into fuzzy values by leveraging a knowledge base having pre-defined rules with the respective correspondence of the variables defined using membership functions. Such fuzzy values are given as the input to the decision making unit, which acts as an inference engine to generate switching sequences according to the network conditions. The resultant switching sequences are de-fuzzified using information from the knowledge base, to make them compatible with the tripping operation of appropriate breaker.

**Figure 5.** Proposed fuzzy inference system for effective energy management strategies in utility networks.

The input variables to the FIS in this research use the Gaussian membership function, which is defined by Equation (15):

$$f\_{i,j}(\mathbf{x}\_i) = \exp\{-\frac{1}{2}(\frac{\mathbf{x}\_i - \mu\_j}{\sigma\_j})^2\} \tag{15}$$

where *xi* represents the system variables and *μ<sup>j</sup>* and *σ<sup>j</sup>* are the mean and variance of the Gaussian function, respectively. Further, the set of rules is defined considering the first order Sugeno formulation, and the corresponding output is thus given by Equation (16) [28].

$$y = \frac{\sum\_{m=1}^{N} \tau\_m (rV\_p + sI\_p + tP\_{load} + uP\_o + v)}{\sum\_{m=1}^{N} \tau\_m} \tag{16}$$

where *N* is the total number of rules developed, which in this case is 12. *Vp*, *Ip*, *Pload*, and *Po* are the voltage profile, system current, load demand, and cumulative power output of the sources, respectively. *r*, *s*, *t*, *u*, and *v* are the parameters of the inference engine, and *τ<sup>m</sup>* is the triggering instant of the respective rule.

The proposed framework for the optimal placement of new DGs and effective energy management under normal and contingency conditions is summarized in Algorithm 1.


In Algorithm 1, the GA and FIS are leveraged together in a unified framework to not only increase the benefits of integrating new DGs, but also to regulate the power flow under different network conditions to optimally meet the load demands. The input to the framework is the voltage profile, which includes variations in its magnitude (*Vsag*) and phase angle (Δ*θ*) and the system losses (*SL*), and the output is the desired switching profile. For all the input variables of the test network in Figure 2 determined using distributed load flow algorithms using Equations (4)–(6), if their values are less than or equal to the predefined norms, the GA computes the optimal location and size of the incoming DG using Equation (7) provided all the constraints in Equations (8)–(12) are satisfied; otherwise, the GA output is discarded, and the loop repeats until it achieves the desired outcome. Once the optimal location and size of the new DG is determined, then different contingencies are simulated similar to real-time conditions, i.e., load deviations, islanding, faults, etc. Under such scenarios, the cumulative supply from the DGs and grid sources is checked against the desired load profile and losses to generate controlled switching sequences using the FIS. Abnormality is detected using the current profile of the system, and if it is found, the FIS either trips the associated breakers or regulates the energy flow to minimize the adverse effects of the given contingency. Conversely, if the system operates in the

normal condition given that the sum of the supply from the DGs and grid is equal to the sum of the load demand and system losses, the FIS remains inactive.

#### **3. Results and Discussion**

In the proposed framework, the environment is initially created in Simulink, as a first step to test the idea, and it is then validated on a Power Hardware-In-the-Loop (PHIL) setup in real time as a proof of concept for practical results, as shown in Figure 6. In Figure 6, the power system simulator replicates the characteristics of the utility network defined in Figure 2. The PXI platform simulates the response of the DG technology, while the grid control server implements the optimization techniques (FIS, GA, etc.) to regulate the system operation and performance, and the communication system simulator is used to develop a communication path between different interfaces. Further, it uses Phasor Measurement Units (PMUs) that measure the magnitudes of the voltage, current, and phase angle jump. The results presented in the following subsections are the final outcomes from the PHIL setup in Figure 6.

**Figure 6.** Power Hardware-In-the-Loop (PHIL) setup for DG placement and energy management in the utility network under normal and contingency conditions.

#### *3.1. Optimal Location and Size of the DG*

The installation of a new DG however has positive impacts on the network performance, thereby reducing the power losses and improving the voltage profile. However, based on the optimal location and size of the DG, the characteristics of the utility network change accordingly. In order to evaluate the performance of the test network in Figure 2 against the power losses, voltage sag, and Phase Angle Jump (PAJ), the following three distinct scenarios are considered.

#### 3.1.1. Normal Condition

Under the normal condition, the integration of the DG improves the system performance as shown in Figure 7. The power loss at Bus-C beforehand is about 154.654 kW, as shown in Figure 7a, and reduces to 103.789 kW when the DG is connected at Bus-E near the load center, which gives an instant return of approximately \$0.793 per hour. Due to the radial nature of the test network in Figure 2, the voltage drop however should increase, as we move away from the sources. However, due to the presence of the DG, it is still under the permissible limits of ±10%, as illustrated in Figure 7b. Moreover, the value of the PAJ varies with the deviations in the combined X/R ratio of the feeder and DG with respect to the source, and its minimum value occurs at Bus-E, as indicated in Figure 7c. Based on all such network characteristics, the best location of the new DG during the normal condition is found to be at Bus-E near the load center with the optimal size of 3.1735 MW

and 1.136 MVAr, determined using the GA, as shown in Figure 7d. It is evident from Figure 7d that the network characteristics intersect at Bus-E after 30 iterations, specifying the optimal location and size of the new DG.

**Figure 7.** Characteristics of the system under the normal condition for proper placement and sizing of the new DG: (**a**) power losses at different buses, (**b**) voltage profile of the system, (**c**) Phase Angle Jump (PAJ) variations, and (**d**) GA outcome over 30 iterations.

#### 3.1.2. Fault Condition

With the inception of symmetrical fault in the network, a huge amount of current starts to flow. Under such conditions, the DG should not be operated, otherwise it will contribute to the fault current and may even not only harm the network, but also itself. The isolation of the DG during fault conditions depends on its dedicated protection scheme, and if it fails to operate, this results in the DG continuing to supply power, which is hazardous for the network personnel. For fault conditions, if the fault occurs near the source, the amount of power loss, that is 278.93 kW, is higher than that occurring near the load center at Bus-G, i.e., 195.75 kW, as shown in Figure 8a, which gives a savings of approximately \$ 1.248 per hour. It can be seen from Figure 8a that there is not a big difference between the losses at Bus-G and Bus-E. Further, the voltage limits are also violated at both, and among all, the best voltage profile is maintained at Bus-E, i.e., 0.7812 p.u., as illustrated in Figure 8b. Moreover, the PAJ excursions, shown in Figure 8c, are highest at Bus-C and lowest at Bus-E, i.e., 73.7509 radians. In view of such system characteristics, the optimal location of the DG is determined to be at Bus-E with a size of 3.1735 MW and 1.009 MVAr. However, during the fault condition, the desired solution using GA is obtained after 32 iterations, when the network characteristics intersect each other, which in this case again is at Bus-E, as illustrated in Figure 8d.

**Figure 8.** System performance under fault condition for the optimal location and size of the new DG: (**a**) power losses at different system buses, (**b**) system voltage profile, (**c**) the trend of PAJ at various buses, and (**d**) GA output over 32 iterations.

#### 3.1.3. Islanding Condition

During the islanding condition, a power imbalance occurs owing to the fact that the DG alone is unable to supply all three types of connected loads, i.e., industrial, commercial, and residential, as shown Figure 2. Under such a scenario, the power loss in the system is low (with a reduction of about 26.707 kW, which gives a return of \$0.4 per hour) because a lesser amount of current flows, as shown in Figure 9a, but unfortunately, the voltage profile is worse, violating the allowable tolerance limits due to the extra loading on the DG, as illustrated in Figure 9b. Further, the PAJ variations are least at Bus-C under such a condition, as presented in Figure 9c. Due to the network characteristics, a compromise decision is made to decide the best possible location and size of the new DG. However, the amount of power losses is least and the voltage profile is better at Bus-E; on the other hand, the PAJ deviations are small at Bus-C. Therefore, the best location during the islanding found using GA is at Bus-D with a size of 3.1735 MW and 1.009 MVAR, as shown in Figure 9d. It is evident from Figure 9d that the desired results are obtained after 35 successful iterations of the GA.

**Figure 9.** System profile during the islanding condition for the optimal location and size of the new DG: (**a**) power losses at different buses, (**b**) voltage profile of the system, (**c**) PAJ variations at different buses, and (**d**) GA output over 35 iterations.

#### *3.2. Energy Management System*

The performance of the utility network during the fault and islanding conditions is extremely compromised if corrective measures are not taken in a timely and efficient manner. However, even with the proper placement and size of the new DG, such adverse effects diminish, but still prevail in the system for a long time if proper strategies are not designed. Further, the reliability and robustness of the system against the fault and islanding conditions are lost and thus require designing an adaptive and efficient EMS to deal with them effectively, with the aim of improving the system performance. The energy management strategies proposed, designed, and validated under normal and contingency states are presented in Figure 10. The FIS is used for generating the different switching schemes, as shown in Figure 11 for the proposed strategies in Figure 10.

**Figure 10.** Energy management strategies for different operating conditions: (**a**) normal state, (**b**) fault condition, (**c**) balanced islanding condition, and (**d**) imbalanced islanding condition.

**Figure 11.** Switching patterns generated using the fuzzy inference system for circuit breakers under different operating conditions.

#### 3.2.1. Normal Condition

Under the normal condition, when all the network constraints are within the predefined limits and the system is operating efficiently, the proper placement of the DG reduces the system losses and improves the voltage profile. The energy management strategy designed for such a network condition is presented in Figure 10a. In this scenario, the protection schemes of the DG and the main supply are inactive, and the energy breaker is responsible for energy management under abnormal conditions, while the demand breaker is used to meet the increased load demands during the critical situations. Both of these breakers are disconnected during the normal condition. In the normal state, the main supply and DG collectively meet the power demands of end-users, as shown in Figure 11, with both the energy and demand breakers being switched off.

#### 3.2.2. Fault Condition

When the faults occur in the system either at the transmission or at the distribution side, the protection schemes of the mains and DG need to function in timely manner and thus isolate the sources. Under this condition, the energy generated by the DG may be stored for later use when the faults are removed, and this necessitates using an Energy Storage System (ESS). The energy management strategy designed to deal with different fault conditions is proposed in Figure 10b. In this condition, the energy breaker remains closed, and the demand breaker is open until a fault is present in the system. With the fault occurring near the load center at 0.1 s in Figure 12, the fuzzy logic controller instantly detects it in Figure 11 due to the abrupt changes in the network current and trips the main and DG circuit breakers, while the energy breaker remains closed to store the DG's energy. When the fault is cleared at 0.2 s, the main and DG breakers get closed after a 1.5 cycle delay, caused by the fuzzy logic controller and circuit breaker operating time sequences, as shown in Figure 13. In Figure 13, at 0.3 s, the network is restored to its normal state after the fault elimination. Further, at 0.35 s, the grid is disconnected, and the network enters into an islanding mode; thus, the power flow from the grid drops to approximately zero.

**Figure 12.** Current flows from different power system actors when fault occurs near the load center with the proposed energy management system using the fuzzy inference system. The dotted plots illustrate the short circuit current with no energy management strategy being active.

**Figure 13.** Profile of the power flow from the mains. At 0.3 s, the system returns to its normal state. At 0.35 s, the grid is disconnected, and the system enters the islanding condition, while the power flow from the grid drops approximately to zero.

#### 3.2.3. Islanding Condition

When the main supply to the network is lost, this results in islanding conditions, and the DG may be allowed to supply the load alone, if its output matches the energy demand. However, if a power mismatch occurs, the DG needs to be taken out of the system, and the reliability of the network to supply the load is thus lost. To address this problem, the energy management strategy is designed and discussed in Figure 10c. This scenario is called balanced islanding, which represents the condition that the cumulative energy of the DG and ESS are able to cope with the given load requirements, as shown in Figure 11. In Figure 11, the main breaker trips after 0.35 s; the grid supply is disconnected, and the network operates in the balanced islanding condition. Initially, the system loading is larger than the DG output, and the ESS switches on to meet the additional energy demand, as shown in Figure 14. In Figure 14, after 0.35 s, the system operates in islanding mode, with both the DG and ESS supplying the load, as illustrated in Figure 15. The close-up view of the voltage profile in Figure 14 confirms that the cumulative supply from the DG and ESS is more stable than the grid and DG together. This is due to the obvious reason that the main source is at distance from the load center and causes more power losses, while the ESS and DG are installed near the load premises.

**Figure 14.** Voltage profile at the DG bus under different system conditions. The voltage under the normal condition is 1 p.u., and with the fault inception it dips down to 0.52 p.u. After 0.35 s, the system is in islanding mode with both the DG and battery system supplying the load. After 0.45 s, the load is increased and results in a voltage collapse.

During the imbalance islanding in Figure 10d, when the cumulative power of the ESS and DG is unable to meet the load demand, the DG needs to be disconnected from the system using its dedicated protection scheme. However, the ESS, having the fewer stability issues as compared to the DG system, continues to supply energy to emergency and critical loads, i.e., street lights, hospitals, etc., via its direct link. It is evident from Figure 11 that when the load on the distribution side is increased after 45 s in Figure 15, it causes unbalanced islanding and huge voltage collapse in Figure 14. Therefore, the DG breaker trips at 49 s while the ESS continues to supply the sensitive loads.

**Figure 15.** DG output under different system conditions. Until 0.35 s, a load of 5000 kW is shared equally among the mains and DG. At 0.35, the mains are tripped, and the system enters the islanding mode with the load greater than the DG, and thus, the ESS is switched in, to tackle the energy difference. At 0.45 s, the load is further increased, which causes the power imbalance with the DG's output constantly decreasing, which represents its being out of synchronism.

#### *3.3. Comparative Analysis*

To validate the performance of the proposed framework, it is compared with other existing approaches in Table 1. In Table 1, the Tabu Search (TS) algorithm, which is commonly used for evaluating the combinatorial optimization task, is exploited for the optimal placement of the DG in [29], based on improving the system voltage and reducing the line losses under a uniformly distributed load profile. This search algorithm has a higher convergence rate and hence takes less processing time to reach the desired results within fewer iterations. On the other hand, the Artificial Bee Colony (ABC) algorithm, used for the optimal sizing and location of the DG in [30], takes a longer time to converge and is also computationally expensive because it is based on the intuitive foraging behavior of honey bees. However, the Ant Colony Optimization (ACO) algorithm, inspired by the behavior of ants of reaching the target while following the shortest path, was used in [31] for the proper placement of new DGs. This algorithm has a compromising performance in terms of reducing the voltage deviations; otherwise, it is better than ABC. Overall, the suggested technique is not only robust against system abnormalities using the FIS, but it also tries to maximize the system performance, thereby reducing line losses and voltage variations (sag and phase angle jump) with the optimal placement of the DG using the GA. Further, the proposed framework is also computationally efficient and converges in a reasonable time to the desired outcomes.

**Table 1.** Comparative analysis for the optimal placement of the DG and energy management control. TS, Tabu Search; ABC, Artificial Bee Colony.


NA—Not Applicable; loss reduction (%)—decrease in the percentage of existing line losses with the integration of each new DG; voltage deviation (p.u.)—the ability to maintain the voltage profile within the pre-defined IEEE regulation limits, i.e., ±5%; number of iterations steps taken by the search algorithm to reach the final outcome; energy imbalance (%)—exploiting all the available energy sources to meet the load demand effectively; detection period (cycles)—operating duration of switching-sensing elements to detect the abnormality in the system; computational time (s)—processing resources consumed by the respective technique to reach the desired end goal.

#### **4. Conclusions**

This research proposed a framework that in the first steps exploited the genetic algorithm in order to determine the optimal placement and sizing of the distributed generators in the utility network under distinct system conditions. The GA together with load flow analysis made decisions on the basis of three critical parameters of the network: power losses, voltage profile, and phase angle jump. Under all investigated system conditions (normal operation, fault, and islanding), the best possible location was always decided to be near the load center, at Bus-E, with the optimal size of 3.33 MVA, in accordance with the system constraints. Even though the proper placement and sizing of the newly installed DG were not guaranteed, the excellent performance of the investigated power system—especially under the fault and islanding conditions—thus make it necessary to design a proper energy management system.

All the energy management strategies, under all the investigated system conditions, were designed using a fuzzy inference system. Amongst all proposed strategies, it was observed that the FIS with the proper membership functions and rules implemented was able to correctly detect, monitor, and regulate the abnormalities in a way that allowed the performance of the network to be optimized and the energy to be stored for emergency use. The switching patterns, generated by fuzzy controllers, were used to operate all four different circuit breakers (the main one, DG, energy, and demand breakers) sequentially, according to the network characteristics—determined through a load flow study. Eventually, in order to validate the effectiveness and robustness of the proposed approach against abnormalities, it was compared with other existing state-of-the-art methods, and we found that it integrated new DGs optimally and also regulated the energy flow according to the network conditions.

A possible extension, to the above presented research, is to use the Markov decision process for the optimum location and sizing of mixed (inverter- and non-inverter-based) DGs in a complex distribution network involving the combination of radial and mesh topologies. Furthermore, for a autonomous and adaptive energy management system, deep neural networks together with the forest of trees approach can be applied to deal with the environmental and network uncertainties and the dynamic nature of PVs or wind-based DG systems at run-time under severe network contingencies.

**Author Contributions:** The major contributions of all the authors are summarized as: conceptualization—S.K.; methodology—S.K. and M.F.S.; software—S.K. and M.F.S.; validation— S.K., F.S., S.S., A.M., and Z.H.K.; formal analysis—S.K., A.M., and V.B.; investigation—S.K. and L.S.; resources—Z.H.K. and L.Z.; data curation—Z.H.K. and M.A.S.; writing, original draft preparation— S.K., L.S., and S.A.S.; writing, review and editing—L.Z. and M.A.S.; visualization—Z.H.K.; supervision—L.S. and L.Z.; project administration—L.Z.; funding acquisition—L.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Acknowledgments:** The authors are thankful to Sukkur IBA University, Pakistan, for providing state-of-the-art facilities to conduct this research. Additionally, the first author is also grateful to Jan Izykowski from Wroclaw University of Science and Technology, Poland, for his guidance and support during the Master's studies.

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

#### **References**


### *Article* **A Hybrid Approach Based on SOCP and the Discrete Version of the SCA for Optimal Placement and Sizing DGs in AC Distribution Networks**

**Oscar Danilo Montoya 1,2, Alexander Molina-Cabrera 3, Harold R. Chamorro 4,\*, Lazaro Alvarado-Barrios <sup>5</sup> and Edwin Rivas-Trujillo <sup>1</sup>**


**Abstract:** This paper deals with the problem of the optimal placement and sizing of distributed generators (DGs) in alternating current (AC) distribution networks by proposing a hybrid master– slave optimization procedure. In the master stage, the discrete version of the sine–cosine algorithm (SCA) determines the optimal location of the DGs, i.e., the nodes where these must be located, by using an integer codification. In the slave stage, the problem of the optimal sizing of the DGs is solved through the implementation of the second-order cone programming (SOCP) equivalent model to obtain solutions for the resulting optimal power flow problem. As the main advantage, the proposed approach allows converting the original mixed-integer nonlinear programming formulation into a mixed-integer SOCP equivalent. That is, each combination of nodes provided by the master level SCA algorithm to locate distributed generators brings an optimal solution in terms of its sizing; since SOCP is a convex optimization model that ensures the global optimum finding. Numerical validations of the proposed hybrid SCA-SOCP to optimal placement and sizing of DGs in AC distribution networks show its capacity to find global optimal solutions. Some classical distribution networks (33 and 69 nodes) were tested, and some comparisons were made using reported results from literature. In addition, simulation cases with unity and variable power factor are made, including the possibility of locating photovoltaic sources considering daily load and generation curves. All the simulations were carried out in the MATLAB software using the CVX optimization tool.

**Keywords:** distributed generation; mixed-integer nonlinear programming; optimal power flow; second-cone programming; discrete-sine cosine algorithm; metaheuristic optimization

#### **1. Introduction**

Electrical distribution networks are entrusted with providing electricity services to the end users in medium- and low-voltage level in rural or urban areas [1]. These grids are typically operated with a radial configuration to reduce investment, maintenance and operative costs [2]. However, the radial configuration produces higher power losses in contrast to meshed configurations; also, the nodal voltage rapidly worsens, as the nodes are far from the substation [3]. To mitigate these higher power losses, the literature proposes multiple approaches to know: (i) optimal placement of shunt capacitors [4], (ii) optimal reconfiguration of the distribution grid [5], (iii) optimal selection/substitution of the calibers of the conductors [6,7], (iv) optimal placement and sizing distributed generators [8–10], among others. Each one of these approaches allow dealing with power losses minimization; nevertheless, the most effective approach for dealing with this power loss corresponds

**Citation:** Montoya, O.D.; Molina-Cabrera, A.; Chamorro, H.R.; Alvarado-Barrios, L.; Rivas-Trujillo, E. A Hybrid Approach Based on SOCP and the Discrete Version of the SCA for Optimal Placement and Sizing DGs in AC Distribution Networks. *Electronics* **2021**, *10*, 26. https://dx.doi. org/10.3390/electronics10010026

Received: 16 November 2020 Accepted: 22 December 2020 Published: 27 December 2020

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

**Copyright:** © 2020 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/).

to the optimal placement and sizing of DGs since reductions higher than 50% have been reported for this methodology [11].

The optimal placement and sizing of DGs in electric distribution networks is a complex and large-scale mixed-integer nonlinear programming (MINLP) problem. This MINLP structure of the optimization problem complicates the possibility of finding the global optimal solution due to the non-convexity shape of the solution space [12]. For this reason, in this research, we propose a combination of a metaheuristic approach with a second-order cone programming (SOCP) formulation to address this problem with excellent numerical performance as will be presented in the results section.

Due to the importance of having mathematical optimization in distribution systems analysis, here, we propose a new hybrid optimization approach based on the discrete version of the sine–cosine algorithm, i.e., (DSCA) added to the SOCP formulation to solve the exact mixed-integer nonlinear programming (MINLP) formulation of the problem of the optimal location and sizing of DGs in AC distribution networks [13]. This hybrid optimization approach called DSCA-SOCP is motivated by the following facts: (i) the exact MINLP structure makes it impossible to find the global optimal solution for this problem with the current optimization approaches even using metaheuristic; this situation occurs since the studied problem contains binary variables regarding the placement of the DGs and the continuous part associated with their sizing, which is formulated as an optimal power flow problem being non-convex due to the presence of trigonometric functions in its formulation where it is not possible to ensure global solution with nonconvex methods [14,15]. The union of both problems (integer and nonlinear continuous) increases the possibility of branch and bound methods or metaheuristics to be stuck in local optimal solutions [16]; and (ii) the conventional metaheuristic approaches to solve the MINLP problem deals with the optimal power flow problems using controlled random procedures [8], which are inadequate approaches (they do not guarantee the global optimal solution); in opposition, the convex optimization allows to find it with duality zero gap [17].

Based on the aforementioned problems with conventional metaheuristic approaches, we propose a hybrid DSCA-SOCP programming to solve the studied problem using a master–slave optimization strategy, where the master stage is entrusted with determining the subset of nodes where DGs will be located, and the slave stage solves the resulting optimal power flow problem to determine their optimal sizes. The main advantage of the proposed approach is that the SOCP programming ensures the global optimal solution for each nodal combination provided by the DSCA [18], which implies that if the best subset of nodes is identified by the master stage, the global optimal solution for the problem of the optimal placement and sizing of DGs in AC distribution networks will be guaranteed (this will be confirmed in the results section) [19].

The problem of the optimal placement and sizing of distributed generation in AC distribution networks to minimize active power losses in all the branches of the grid has been largely studied in the last two decades [20]. Most of the proposed approaches in literature work with master–slave algorithms based on metaheuristic optimization techniques [8]. Some of the recent approaches in this field of study are listed in Table 1.

The common denominator of these approaches is that these references work with hybrid master–slave optimization approaches to solve the exact MINLP model in two stages, i.e., a discrete part of the algorithm is entrusted with determining the location of the DGs and the continuous part deals with the dimensioning problem via optimal power flow analysis [21]. However, no evidence about the combination of the convex optimization approach for the continuous part and the discrete sine–cosine algorithm for the integer part has been found after the revision of the state-of-the-art, and this gap has been exploited in this paper as an opportunity of research.


**Table 1.** Recent optimization methods for optimal placement and sizing distributed generators (DGs) in alternating current (AC) distribution networks.

> **Remark 1.** *In the revision of the state-of-the-art, only the methodologies called MINLP proposed in [9] and GAMS presented in [12] work with the exact model of the problem by implementing branch and bound in conjunction with interior point methods to solve the problem. However, due to the non-convexities of the solution space, these are stuck in local optimums.*

> To avoid being stuck in local optimum solutions, our approach combines the efficiency of conic programming with easily implementable metaheuristic to find the global optimal solution of the problem using a master–slave optimization approach. The main advantage of the SOCP is that if the combination of the nodes where DGs will be located is fixed, the optimal sizing provided by the SOCP approach remains equal (repeatability property), which is not ensured with conventional metaheuristics used for optimal power flow analysis.

> Based on the review of the state-of-the-art presented in the previous section, the main contributions of our proposal can be summarized as follows:


It is worth mentioning that the proposed optimization approach deals with the optimal placement and sizing of DGS in AC distribution networks considering the load peak conditions by assuming that the distributed generators are fully dispatchable as recommended in [9]. In addition, no considerations are made regarding the total distributed generation since we are interested in finding the best possible reduction in the active power losses in the distribution network without penetration limitations. Finally, we consider the possibility of installing three distributed generators since this is the most common assumption in literature [32]. In addition, three simulations cases are analyzed: (i) the

optimal location and sizing of the DGs considering unity power factor, (ii) variable power factor, and (iii) daily load and photovoltaic solar curves.

The remainder of this document is organized as follows: Section 2 presents the exact mixed-integer nonlinear problem formulation of the optimal location and sizing of DGs in AC distribution networks with radial structure. Section 3 presents the proposed hybrid optimization methodology with master–slave structure, where the master slave is entrusted with solving the location problem by implementing the discrete version of the sine–cosine algorithm, and the slave stage is entrusted with determining the optimal sizes of the DGs by using a SOCP formulation. Section 4 presents the main features of the test feeders which are composed of 33 and 69 nodes, with radial structure and operated with 12.66 kV at the substation node. Section 5 presents the numerical achievements of the proposed optimization approach regarding the optimal location and sizing of DGs with their corresponding analysis and discussion. Section 6 shows the main concluding remarks as well as some possible future works derived from this research.

#### **2. MINLP Formulation**

The problem of the optimal location and sizing of distributed generation in AC distribution networks can be formulated as a mixed-integer nonlinear programming (MINLP) problem. The objective function of this problem corresponds to the minimization of the active power losses in the distribution network, which is subjected to a set of nonlinear constraints regarding active and reactive power balance equations, device capabilities and voltage regulation bounds, among others. Here, we present the MINLP formulation in the complex domain in order to simplify the proposed optimization approach that will be presented in Section 3. The complete MINLP model is presented below.

Objective function: The objective function that represents the problem of the optimal placement and sizing of DGs in AC distribution networks corresponds to the total power losses caused by the current flow in all the branches of the network. This objective function is formulated as presented in Equation (1).

$$\min p\_{\text{loss}} = \text{real}\left\{ \sum\_{i \in \mathcal{N}} \sum\_{j \in \mathcal{N}} \mathbb{V}\_i^\star \mathbb{V}\_{ij} \mathbb{V}\_j \right\},\tag{1}$$

where *<sup>p</sup>*loss is the objective function value, V*<sup>i</sup>* and V*<sup>j</sup>* are the voltage values (magnitude and angle) in the nodes *<sup>i</sup>* and *<sup>j</sup>*, respectively; Y*ij* is the complex admittance value of the nodal admittance matrix that relates nodes *i* and *j*. Note that N represents the set that contains all the nodes of the network, and (·) represents the complex conjugate operator applied to the argument.

Set of constraints: The set of constraints that intervene in the problem of the optimal placement and sizing of DGs in AC distribution networks are described as follows:

$$\mathbb{S}\_i^{s,\star} + \mathbb{S}\_i^{d\underline{g},\star} - \mathbb{S}\_i^{d,\star} = \mathbb{V}\_i^{\star} \sum\_{j \in \mathcal{N}} \mathbb{V}\_{i\bar{j}} \mathbb{V}\_{j\prime} \quad \{i \in \mathcal{N}\},\tag{2}$$

where S*s*,- *<sup>i</sup>* is the apparent power generation in the slack node connected at bus *<sup>i</sup>*, <sup>S</sup>*dg*,- *i* corresponds to the apparent power generation provided by the DG connected at node *i*, and S*d*,- *<sup>i</sup>* represents the apparent power consumption at node *i*.

Expression (3) is associated to the voltage regulation bounds in all the nodes of the network.

$$\|\|\mathbf{V}\_i - \mathbf{1}\|\le\gamma, \; \forall i \in \mathcal{N}, \tag{3}$$

where *γ* is the maximum deviation given by the regulatory policies, which is usually between 0.05 pu and 0.10 pu. Note that in the case of the substation, V*<sup>i</sup>* = <sup>1</sup> + *<sup>j</sup>*0 pu.

The capacity of the existing and newly distributed generators is upper and lower bounded as follows:

$$
\underline{S\_i^s} \le \mathbb{S}\_i^s \le \overline{S\_i^s}, \forall i \in \mathcal{N}, \tag{4}
$$

$$
\underline{\chi\_i} \underline{\mathbb{S}^{\otimes d, \text{new}}} \le \mathbb{S}\_i^{d, \emptyset} \le \underline{\chi\_i} \overline{\mathbb{S}^{\otimes d, \text{new}}}, \; \forall i \in \mathcal{N}, \tag{5}
$$

where

$$
\infty\_i \in \{0, 1\}, \ \forall i \in \mathcal{N}, \tag{6}
$$

which denotes the binary variable of the problem, which has a value of 1 if a DG is installed at node *i* or 0. There is a limit to the number of DGs that can be installed in the system, which is given by (7),

$$\sum\_{k \in \mathcal{N}} \mathbf{x}\_i \le N\_{\text{DGs}} \tag{7}$$

where *N*DGs is the total number of distributed generators available for installation in the AC distribution network.

**Remark 2.** *The structure of the optimization model (1) to (7) exhibits a nonlinear non-convex structure with the presence of binary variables regarding the location of the DGs in a particular node of the grid. However, the nonlinear structure of the power balance equations in (2) is the most challenging constraint since it does not guarantee the global optimum finding even if all the binary variable combinations are explored.*

Figure 1 summarizes the main characteristics of the MINLP model that represents the problem of the optimal placement and sizing of DGs in AC radial distribution networks.

Convex Equations (1), (3)–(5) and (7) *xi* ∈ {0, 1} Binary Non-convex Equation (2) MINLP

**Figure 1.** Characterization of the optimization model.

To address the nonlinear part of the optimization model described in Figure 1, we propose the reformulation of the nonlinear part of the model (i.e., power balance equations) into a second-order cone equivalent, while the binary part of the model is addressed through a metaheuristic approach as is presented in the following section.

#### **3. Proposed Hybrid Optimization Approach**

To solve the problem of the optimal placement and sizing of DGs in AC distribution networks, we propose a hybrid master–slave optimization algorithm. The master stage employs the metaheuristic sine–cosine algorithm (SCA) to solve the binary problem, i.e., the location of the distributed generators on the grid. In the slave stage the optimal power flow problem is reformulated as a second-order cone programming (SOCP) in order to guarantee the global optimum finding for each nodal combination providing for the SCA.

#### *3.1. Slave Stage: SOCP Approach*

The SOCP approach corresponds to a branch of the convex optimization where conic constraints allow for the reformulation of products between variables in order to transform nonlinear optimization problems into convex ones [18]. In the case of the optimal power flow analysis, the SOCP formulation permits to find the global optimal solution with zero gap when this is compared to the exact nonlinear programming power flow formulation [17]. Here, the SOCP formulation is presented to address the problem of the optimal sizing of DGs supposing that their locations have been previously informed by the master stage. To obtain the SOCP model, let us define a new auxiliary variable as follows

$$
\Psi\_{ij} = \Psi\_i^\* \Psi\_{j'} \tag{8}
$$

where if we multiply in both sides for V- *ij*, we have

$$\left\|\left|\mathbb{V}\_{ij}\right\|\right\|^2 = \left\|\left|\mathbb{V}\_i\right\|^2 \left\|\mathbb{V}\_j\right\|\right\|^2,\tag{9}$$

Now, if we define a new vector of *<sup>U</sup>* with entries *vi* <sup>=</sup> V*i*<sup>2</sup> , then we reach the following result

$$\left\|\left|\mathbf{V}\_{ij}\right\|\right\|^2 = v\_i v\_j. \tag{10}$$

which can be rewritten as follows

$$\begin{array}{c|c} \left|| \mathbb{V}\_{ij} \right||^2 = & u\_i u\_{j\prime} \\ \left|| \mathbb{V}\_{ij} \right||^2 = & \frac{1}{4} (u\_i + u\_j)^2 - \frac{1}{4} (v\_i - v\_j)^2, \\ \left|| \mathbb{V}\_{ij} \right||^2 + \frac{1}{4} (v\_i - v\_j)^2 = & \frac{1}{4} (v\_i + v\_j)^2, \\ \left|| \mathbb{V}\_{ij} \right|| \mathbb{V}\_{ij} \left|| \right|| = & v\_i + v\_j. \end{array} \tag{11}$$

Note that Equation (11) is still a non-convex equality constraint, however, as recommended in [18], this can be relaxed as a second-order constraint by replacing the equality symbol by an inequality one as presented below:

$$\left| \left| \left| \begin{matrix} 2\mathbb{V}\_{ij} \\ v\_i - v\_j \end{matrix} \right| \right| \le |v\_i + v\_j|. \tag{12}$$

Now, to rewrite the continuous part of the studied problem, let us substitute (8) into (1) and (2), which produces the following linear objective function and constraint, respectively.

$$\text{min}\,p\_{\text{loss}} = \text{real}\left\{ \sum\_{i \in \mathcal{N}} \sum\_{j \in \mathcal{N}} \mathbb{1}\_{ij} \mathbb{V}\_{ij} \right\},\tag{13}$$

$$\mathbb{E}\_i^{s,\star} + \mathbb{E}\_i^{d,\star} - \mathbb{E}\_i^{d,\star} = \sum\_{j \in \mathcal{N}} \mathbb{I}\_{ij} \mathbb{V}\_{ij\prime} \quad \{i \in \mathcal{N}\},\tag{14}$$

**Remark 3.** *The SOCP reformulation allows reaching the global optimal solution of the optimal power flow problem associated with the optimal sizing of the DGs, since the resulting optimization model is essentially linear with an only conic constraint.*

Note that the characteristics of the studied optimization model depicted in Figure 1 can be redefine by eliminating the non-convex constraint based on the proposed SOCP formulation as presented in Figure 2.

```
Convex Equations
  (3)–(5), (7), (8)
  and (12)–(14)
    xi ∈ {0, 1}
     Binary
  MI-SOCP
```
**Figure 2.** Mixed-integer second-order cone programming (SOCP) equivalent model for the problem of the optimal location and sizing of distributed generators in distribution networks.

Note that the SOCP approximation is given as a function of V*ij* and *vi* instead of the voltages *Vi*. Notwithstanding, it is possible to recover the original voltages by the following two-step procedure: First, the voltage magnitude is computed as *Vi* <sup>=</sup> <sup>√</sup>*vi*. This value exists, and it is real since *ui* ≥ 0. Second, the angle of the voltages is calculated from *<sup>θ</sup>ij* = ang(V*ij*) in a forward iteration, starting from *<sup>θ</sup>*<sup>1</sup> = 0. Therefore, a power flow calculation is not required after the optimization problem is solved.

#### *3.2. Master Stage: Discrete SCA*

The master stage is entrusted with solving the integer part of the optimization problem, i.e., to define the location of all the DGs. Here, we adopt the discrete version of the sine– cosine algorithm, which works with a reduced population by using an integer codification to represent the optimization problem [21].

The SCA is an optimization technique that works with a population which evolves by using trigonometric functions and variable radius in order to explore and exploit the solution space [33]. This optimization algorithm has been employed to solve different continuous domain problems, such as optimal power flow in power and distribution systems [34,35], parameter estimation in photovoltaic modules [36], optimal design of bend photonic crystal waveguides [37], and general solution of nonlinear non-convex optimization problems [38] among others. The main aspects of the implementation of the discrete SCA are described in the following subsections.

#### Initial Population

The SCA is a metaheuristic optimization technique that works with an initial population that is evolving through the iterative procedure by sine and cosine rule. The structure of the initial population for the proposed SCA is defined as follows

$$N^t = \begin{bmatrix} n\_{11} & n\_{12} & \cdots & n\_{1N\_{\text{DGs}}} \\ n\_{21} & n\_{22} & \cdots & n\_{2N\_{\text{DGs}}} \\ \vdots & \vdots & \ddots & \vdots \\ n\_{M1} & n\_{M2} & \cdots & n\_{MN\_{\text{DGs}}} \end{bmatrix} \tag{15}$$

where *t* is the iterative counter, which is fixed as zero for the initial population, and *M* is the number of individuals in the population. Remember that *N*DGs represents the number of DGs available for installation.

Note that each element inside of the initial population is created as follows:

$$n\_{ij} = \text{round}(2 + \text{rand}(1)(n - 2))\tag{16}$$

where *n* is the total number of nodes in the AC distribution network. Observe that the function round(·) takes the near integer part of the number and rand is a random number between 0 and 1 generated with a normal distribution. It is worth mentioning that node 1 is not considered in the population since it corresponds to the slack node. In addition, this codification guarantees the feasibility in the integer part of the solution space.

**Remark 4.** *To maintain the feasibility of the solution space during the generation of the initial population we ensure that each one of the components of the individual N<sup>t</sup> <sup>i</sup> is different to the remainder components, i.e., nij* = *nik*, ∀*k* = 1, 2, ..., *NDGs*, *and k* = *j.*

#### *3.3. Fitness Function Evaluation*

The SCA evolves through the solution space typically using a modification of the objective function named fitness function [39]. This helps deal with possible infeasibilties of the decision variables [40]. However, due to the continuous part for the problem is formulated as a SOCP model; most of the constraints are directly fulfilled during the solution procedure via interior point methods. In this sense, the structure of the fitness function selected in this research takes the same form of the objective function. Note that this function is evaluated for each individual in the population, i.e., *p*loss *Nt i* , in order to identify the best individual in the current population. This individual is called *N<sup>t</sup>* best. Observe that in this research the best individual corresponds is the one who has the lower objective function value.

#### *3.4. Evolution of the Population*

The evolution of the of the population in the SCA algorithm is governed by trigonometric functions with a simple evolution rule as presented in Algorithm 1. Note that this evolution strategy takes the probability of 50% to evolve with sine or cosine trigonometric function (see *r*<sup>1</sup> parameter). In addition, *r*<sup>2</sup> controls the effect of the iteration counter in the modification of the population by presenting a linear decreasing rule; *r*<sup>3</sup> allows the evaluation of the sine or cosine function in all the points of the unitary circle, and *r*<sup>4</sup> introduces the importance of the best current individual in the evolution of the individual *Nt <sup>i</sup>* to generate the next population.

#### *3.5. Stopping Criterion*

To finalize the searching procedure of the discrete version of the SCA, one of the following two conditions must be satisfied.


#### *3.6. Proposed Master–Slave Optimization Algorithm*

The proposed master–slave optimization strategy to solve the problem of the optimal location and sizing of DGs in AC distribution networks based on the hybridization of the discrete version of the sine–cosine algorithm and the SOCP reformulation is summarized in Algorithm 2.

**Algorithm 1:** Evolution steps in the sine–cosine algorithm (SCA).

```
Result: Evolution of the Individuals in the Population
i = 1;
while i ≤ M do
   r1 = rand, r2 = 1 − 1
                         tmax ;
   r3 = 2πrand, r4 = rand;
   if r1 ≤ 1
           2 then
       Yi = Nt
               i + r2 sin(r3)

                            r4Nt
                                 best − Nt
                                         i

                                          ;
   else
       Yi = Nt
               i + r2 cos(r3)

                            r4Nt
                                 best − Nt
                                          i

                                           ;
   end
   for j = 1 : NDGs do
       if 
           Yij < 2 || Yij > n

                                  then
           Yij = round(2 + rand(1)(n − 2));
       end
       if 
           Yij < 2 || Yij > n

                                  then
           Yij = round(2 + rand(1)(n − 2));
       end
       Evaluate the objective function value for the potential individual, i.e., ploss(Yi);
   end
   if ploss(Yi) < ploss
                       Nt
                         i

                            then
       Nt+1
         i = Yi;
   end
end
```
**Algorithm 2:** Proposed master–slave optimization approach.

**Result:** Optimal location and sizing of DGs Define the AC grid parameters; Define *t*max, *k*max, *M* and make *t* = 0 and *k* = 0; **while** *t* ≤ *t*max **do if** *t* = 1 **then** Create the initial population, i.e., *N<sup>t</sup>* ; Evaluate the fitness function of each individual, i.e., *p*loss *Nt i* ; Select the best current solution individual, i.e., *N<sup>t</sup>* best; **end while** *i* ≤ *M* **do** Apply the evolution strategy defined in Algorithm 1 to update the current population, i.e., to obtain *Nt*+<sup>1</sup> *<sup>i</sup>* ; **end if** *N<sup>t</sup> best* <sup>=</sup> *<sup>N</sup>t*+<sup>1</sup> *best* **then** k = k+1; **else** k = 0; **end if** *t* ≥ *t*max || *k* ≥ *k*max **then** Report the best solution of the current population, i.e., *N<sup>t</sup>* best and solves the SOCP for it to determine the optimal sizes of the DGs. **end end**

> **Remark 5.** *Since the proposed hybrid SCA-SCOP depends on a metahueristic search in the master stage, statistical evaluation is required to determine its efficiency regarding the optimal solution finding capabilities. Here, we adopt* 100 *consecutive evaluations to the determine the general*

*distribution of the solution findings by using maximum, minimum, mean and standard deviation indicators [21].*

#### **4. Test Feeders**

The computational validation of the proposed master–slave hybrid optimization algorithm to the optimal location and sizing of DGs in AC distribution is made in two classical distribution networks tests: 33 and 69 nodes. These grids works 12.66 kV at substation. The electrical connection between nodes in these test feeders are presented in Figures 3 and 4, respectively, while its parametric information can be consulted in [12]. It is worth mentioning that these test feeders are considered urban distribution networks that fed industrial users modeled as constant power consumption [8].

**Figure 3.** Electrical connection of nodes in the 33 node test feeder.

For both test feeders we consider as recommended in [21] the possibility of locating three distributed generators which will be sized at the peak load condition, we considered the voltage and power base values of 12.66 kV and 1000 kW, respectively. In addition, for the 33-node test feeder each DG was limited from 300 kW to 1200 kW, while for the 69-node test feeder these bounds were relaxed from 0 kW to 2000 kW, respectively.

#### **5. Computational Validation**

This section presents the computational validation of the proposed hybrid optimization approach based on the discrete version of the sine–cosine algorithm and the second-order cone programming model to deal with the problem of the optimal placement and sizing of distributed generators in AC distribution networks. We implement the proposed solution methodology on a personal computer AMD Ryzen 7 3700U, 2.3 GHz, 16 GB RAM with 64-bits Windows 10 Home Single Language using the MATLAB programming environment.

To compare the proposed hybrid optimization algorithm regarding objective function performance, we selected multiple metaheuristic optimization techniques reported in literature. These methodologies have been listed in Table 1. In the implementation of the proposed DSCA-SOCP approach, we have considered 50 iterations and a population of four individuals; in addition, 100 consecutive evaluations are made to validate the efficiency of the algorithm to reach the optimal solution and calculate the average processing time. Note that these parameters were found after multiple simulations that have allowed to identify an adequate trade-off between simulation times and the quality of the final solution.

#### *5.1. Numerical Validation Considering Unity Power Factor*

5.1.1. Results in the 33-Node Test Feeder

Table 2 reports the optimal placement and sizing of the distributed generators located in the 33-node test feeder after applying the proposed hybrid DSCA-SOCP (see last row) as well as the comparison with the literature reports.

**Table 2.** Optimal location and sizing of DGs in the 33-node test feeder for the proposed and comparative approaches.


The results in Table 2 illustrate that:


It is worth mentioning that the results in Table 2 show that some methods identify the best optimal nodes for optimal locating DGs (see the AHA and the MINLP methods), however, due to the non-convexities in the dimensioning stage, i.e., optimal power flow, these methods present sub-optimal solutions since the nonlinear search approach (in some cases continuous metaheuristics) is stuck in local optimums. This situation does not occur at least with our proposal since each potential location for generators is optimally solved via SOCP which guarantees the optimal finding based on its convex structure. This implies that if we evaluate the same combination of nodes multiple times the optimal sizes of the DGs will be equal for each one of the evaluations (optimal solution), which confirms the efficiency of the convex optimization, i.e., SOCP, in power systems analysis.

#### 5.1.2. Results in the 69-Node Test Feeder

The numerical behavior of the proposed DSCA-SOCP method for the 69-node test feeder is reported in Table 3 (see last row), where it is compared with multiple literature reports.

**Table 3.** Optimal location and sizing of DGs in the 69-node test feeder for the proposed and comparative approaches.


The numerical values in Table 3 help conclude that:


#### 5.1.3. Additional Comments

For both test feeders it is important to mention that: (i) the proposed optimization method reaches the solution of the optimal problem of placement and sizing of DGs in AC distribution networks in the 33-node test feeder after 350 s of simulation, and in the case of the 69-node test feeder, this processing time was about 580 s; (ii) after 100 consecutive evaluations in both test feeders, the proposed DSCA-SOCP approach finds with the 30% of effectiveness in the 33-node test feeder and 20% in the case of the 69-node test system; and (iii) the differences between the best and the worst solution in both test feeders are about 2 kW, which implies that most of these solutions are indeed better than the current literature solutions presented in Tables 2 and 3.

Regarding voltage profiles, it is important to highlight that the minimum voltage regulation in the 33-node test feeder is 9.62% and in the 69-node test feeder is about 9.08%

previous to the optimal location of the DGs; however, after solving the MISOCP model with the proposed DSCA-SOCP approach, these regulations have improved until 3.13% and 2.10 % (note that the best possible regulation in a distribution is 0%, which implies that percentages close to zero are high-quality solutions). These results confirm the effectiveness of including DGs in AC distribution networks for improving voltage profiles since these are close to 1.00 pu in contrast to the base case.

It is worth motioning that, numerically speaking, the proposed DSCA-SOCP is equivalent to the CBGA-VSA approach reported in [21]; however, note that the main difference between both methods is associated with the continuous part of the MINLP model, i.e., the sizing of the DGs, since our approach solves these using an exact optimization method based on convex optimization, which implies that the sizes of the DGs are optimal; nevertheless, in the case of the VSA approach, this optimal property cannot be ensured due to the heuristic nature of this algorithm.

#### *5.2. Numerical Validation Considering Variable Power Factor*

To verify the effectiveness of the proposed hybrid DSCA-SOCP approach to determine the optimal location and sizing of DGs in radial distribution networks, here we consider the possibility of installing from 1 to 3 DGs, leaving free the total amount of reactive power injection as recommended in [9]. Tables 4 and 5 present the optimal solutions reported in literature for the improved analytical (IA) method, the particle swarm optimization (PSO) and the exact MINLP approach, all of which have been reported in [9] for the 33 and 69-node test feeders.

**Table 4.** Optimal location and sizing of the DGs considering variable power factor capabilities in the 33-node test feeder.




From results in Tables 4 and 5 it is possible to observe that:


It is worth mentioning that the proposed DSCA-SOCP approach allows to reach the best optimal solutions compared to the comparative methods even if the location of the generators is the same as can be seen in Tables 4 and 5, since this hybrid approach ensures the optimal solution finding of the OPF problem associated with the sizing of the DGs by using a SOCP formulation, which is not the case with the PSO and IA algorithms. However, in the case of the MINLP approach, we can observe that the results presented by this method in the 33- and 69-node test feeders are comparable with the proposed DSCA-SOCP approach, and the difference in some decimals can be attributed to precision errors between both methodologies.

To verify that under the peak load condition all the voltage profiles in both test feeders fulfill their bounds, these are depicted in Figure 5. In this picture it is possible to observe that, in the case of the of the 33-node test feeder (see Figure 5a), when the distributed generation with reactive power capabilities is installed in the network, all the voltages increase and overpass 0.95 pu, which implies that the voltage regulation in this network is about 4.20% with one and two DGs and less than 1.00% in the case of the three DGs. In the case of the 69-bus test feeder (see Figure 5b), when distributed generators are located considered reactive power injections, we can observe that for one DG the regulation of the grid is about 2.00% caused by voltage drops in nodes 66 to 69, while for the two and three DGs the voltage regulation is lower than 1.00%.

It is worth mentioning that for both test feeders, when two or three DGs are used, all the voltage profile are very close to the substation voltage, which causes the line voltage drops to be very small, producing low power losses as can be observed in Tables 4 and 5.

#### *5.3. Optimal Location of Renewable Energy Sources*

To observe the effectiveness and robustness of the proposed approach to deal with renewable energy resources and variable load profiles, here, we study the problem of the optimal location of renewable energy resources in radial distribution networks. To do so, we consider that in the 69-node test feeder the possibility of installing three photovoltaic distributed generators considering a daily generation and load curves. These curves are depicted in Figure 6.

In this simulation scenario, the proposed DSCA-SOCP is compared with the largescale nonlinear optimization package widely known as GAMS and the MINLP solves BONMIN, COUENNE and DICOPT. The results of this comparison is reported in Table 6.

**Figure 5.** Voltage profile behavior in the 33- and 69-node test feeders when DGs with active and reactive power capabilities are installed: (**a**) 33-bus test feeder and (**b**) 69-bus test feeder.

**Figure 6.** Daily behavior of the demand and solar photovoltaic generation.

**Table 6.** Optimal location and sizing of the DGs considering variable power factor capabilities in the 33-node test feeder.


The results in Table 6 demonstrate that: (i) with the location of three photovoltaic sources the proposed approach, i.e., the DSCA-SOCP approach, reduces the daily energy loss per day to about 919.1112 kWh/day, i.e., 34.47%; while the best GAMS approach using the COUENNE solver finds a reduction of 23.84%. These solutions demonstrate that the MINLP solvers in GAMS are stuck in local optimal solution in comparison with the optimal solution found by the DSCA-SOCP and (ii) in all the solutions reported in Table 6 nodes higher than 60 show the high power injection regarding photovoltaic penetration, and it can be observed that these nodes are more sensitive to active power injections when compared with the remainder of buses.

#### **6. Conclusions and Future Works**

The problem of the optimal location and sizing of DGs in AC distribution networks was explored in this research from the point of view of the hybrid optimization by proposing a master–slave optimization algorithm. The original MINLP model was rewritten as a MISOCP problem, where the master stage was entrusted with determining the optimal location of the DGS (i.e., discrete optimization problem), while the slave stage is entrusted with solving the sizing problem, i.e., the optimal power flow problem. The master stage was addressed with a new formulation of the sine–cosine algorithm in its discrete form, while the slave stage was formulated as a SOCP problem. The main advantage of using convex optimization for the optimal sizing of the DGs is that this approach guarantees global optimal solution for each nodal combination provided in the master stage.

Numerical simulations demonstrate that the proposed hybrid DSCA-SOCP approach allowed reaching the global optimal solution for both test feeders, which implies power loss reductions to about 65.50% and 69.15% for the 33- and 69-node test feeders, respectively. It was possible to establish that those solutions are indeed the global optimal ones for the test feeders considered since an exhaustive approach was made, i.e., the evaluation of the complete solution space: this has been demonstrated.

Evaluations considering active and reactive power in the distributed generation for both test feeders demonstrates that apparent power injections improve the grid performance by reducing grid power losses more than 90% for two or three distributed generators, with voltage regulation lower than 1.00% in the case of installing three distributed generators. In addition, the possibility of installing photovoltaic generation considering daily production and demand curves was tested in the 69-bus test feeder for the DSCA-SOCP approach and MINLP solvers available in GAMS, where it was observed that the proposed approach allows reducing daily energy losses by about 34.47%, while GAMS solvers are stuck in local optimal solutions with reductions lower than 25%, which demonstrates the efficiency of the proposed optimization for installing renewable energy resources in AC distribution networks.

Regarding processing times, both test feeders have been solved using less than 600 s. The time consumed for our approach illustrates the efficiency to solve the complex MINLP formulation by using an MISOCP equivalent with capabilities of optimal finding after 100 consecutive evaluations.

Lastly, the following researches can be derived from this proposal: (i) the application of the proposed MISOCP model to the problem of voltage stability improvement in distribution networks by including renewable distribution generation; (ii) the solution of the MISOCP model with branch and bound methods to guarantee the global optimum finding without requiring consecutive evaluations and statistical tests; and (iii) to propose a MISOCP formulation for the problem of the optimal location and selection of battery energy storage systems and distributed generators in AC distribution networks, including devices' costs during the planning horizon.

**Author Contributions:** Conceptualization, methodology, software, and writing—review and editing, O.D.M., A.M.-C., H.R.C., L.A.-B. and E.R.-T. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported in part by the Laboratorio de Simulación Hardware-in-the-loop para Sistemas Ciberfísicos under Grant TEC2016-80242-P (AEI/FEDER), in part by the Spanish Ministry of Economy and Competitiveness under Grant DPI2016-75294-C2-2-R.

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

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** No new data were created or analyzed in this study. Data sharing is not applicable to this article.

**Acknowledgments:** This work was supported in part by the Centro de Investigación y Desarrollo Científico de la Universidad Distrital Francisco José de Caldas under grant 1643-12-2020 associated with the project: "Desarrollo de una metodología de optimización para la gestión óptima de recursos energéticos distribuidos en redes de distribución de energía eléctrica." and in part by the Dirección de Investigaciones de la Universidad Tecnológica de Bolívar under grant PS2020002 associated with the project: "Ubicación óptima de bancos de capacitores de paso fijo en redes eléctricas de distribución para reducción de costos y pérdidas de energía: Aplicación de métodos exactos y metaheurísticos."

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

#### **References**


*Article*
