Smart Distribution Systems: Methodologies, Real-time Platforms and Testing Methods

### **Chapter 3**

## Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution Systems

*Ulises Tovar Ramírez, José Horacio Tovar Hernández and Guillermo Gutiérrez Alcaraz*

### **Abstract**

A significant challenge is to design strategies to minimize electrical losses in smart distribution systems while observing voltage and feeder loading constraints. Unfortunately, few studies have solved the problem of simultaneously coordinating already installed capacitors banks with network reconfiguration problems. This book chapter presents two methodologies for solving the reconfiguration and reactive power compensation dispatch. Both methodologies are formulated as two-stage solve reconfiguration and reactive power compensation problems with the characteristic of having acceptable computational efficiency and loss reduction close to the optimal solution. In the first stage, network reconfiguration is carried out to discriminate radial configurations that do not satisfy voltage and overload restrictions. In the second stage, a reactive power compensation dispatch is applied to each feasible network configuration by connecting capacitor blocks successively until all available reactive capacity has been used or until a specified loss tolerance has been reached. Finally, switching each capacitor block is carried out using voltage linear sensitivities related to shunt reactive compensation to make a relatively low computational work during the process.

**Keywords:** distribution systems, capacitor switching, network reconfiguration, reactive power compensation, volt/VAr control

### **1. Introduction**

During the last decades, the great growth in technologies of computers, microprocessors, telecommunications, incorporation of distributed generation (DG) and electronic equipment as ac/dc converters and flexible ac transmission systems (FACTS) at the distribution level has led to opportunities for an advanced supervising and control of electric energy delivery systems (distribution systems), particularly in distribution network automatization, but at the same time, it presents new challenges for

accomplishing with the main objective of improving the automatization, control, and efficiency of real-life distribution systems, converging into the infrastructure named smart distribution center. Therefore, almost all the efforts have comprehensively investigated the optimal distribution reconfiguration problem [1].

Distribution systems mainly consist of transformers, several feeders composed of line sections, switches, diverse DG systems, and consumer loads.

In existing distribution systems, global loss minimization is a common objective function because of its high impact on their economic efficiency, and it may be basically carried out in two stages, which are as follows—(i) through feeder reconfiguration by opening or closing switching devices and (ii) reactive power compensation by capacitor bank commutations.

### **1.1 Distribution system reconfiguration**

Distribution system reconfiguration is useful for either planning or real-time control to change the electrical conditions of primary supply feeders to reach, in some sense, an optimal operation point [2]. Reconfiguration is a process for modifying the topological structure of distribution feeders by changing the open/close status of sectional switches and feeder sections to find the minimum loss topology, maintaining voltages between their low and high limits simultaneously, and its radial structure, that is, there is only one path between two points in the same feeder [3]. Sectional switches and feeder sections will be named as switches throughout this chapter.

Many feeders are interconnected to the distribution system keeping a radial structure, which is maintained by properly controlling the status of the associated switches, which are classified as normally open or closed. These switches operate under a feeder fault condition to change their statuses to isolate the faulted feeder section and enable load transferences between adjacent feeders to redistribute current flows without any restriction violation [4]. A smart distribution center supports this process mainly with supervisory and control infrastructure, which helps raise the reliability and efficiency of electricity supplied to the final consumer [5].

Almost all feeders have a mix of industrial, commercial, and residential loads, which, through 24 h, show diverse load variations so that their peak load values occur at different moments. In this sense, reconfiguration permits to transfer of loads to a relatively lesser loaded feeder with the benefit of better voltage regulation and lower electrical losses; also, at the same, it increments security margins and quality of energy supplied [2]. Furthermore, under emergency conditions due to a short circuit in some distribution system points, an important goal is to minimize the close/open switching operations to reduce the load-restoration period. In both situations, the distribution system topology should remain radial [6].

From the above discussion, it is obvious that loss minimization implicitly includes operative cost reductions in the distribution system [7]. Hence, almost of reconfiguration methods have electric loss reduction as the main goal. Furthermore, distribution system reconfiguration is a combinatorial problem involving many open/ close switch operations for real-life distribution systems [8]. In fact, a small 33-bus distribution system, and considering that each feeder section has a switch in its extremes, the open/close commutations are 435,897. Then, the development of reconfiguration methods must contain the next features [2]:

• Capacity for estimating loss changes resulting from the reconfiguration process, involving minimal computational work.

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

• There must be a useful criterion to avoid irrelevant switching actions to reduce the searching space and increment the problem solution efficiency.

Researchers have studied the distribution system reconfiguration problem during the last five decades, developing and using different solution methods. Some of the most reported are the next kind of approaches [9]:


Heuristic methods (HM) are the most attractive because of their relative simplicity and suitability for operating in real-time environments; however, they do not always obtain the optimal global reconfiguration. This drawback is overridden by metaheuristic methods (MM), but they are more complicated in formulation with larger execution time requirements than HM. Therefore, many MM have been developed using ideas of nature behavior [9], which could be based on genetic algorithms [2], particle swarm optimization [3, 10, 11], tabu search [12, 13], simulated annealing [13–15], variable scaling hybrid differential algorithm [16], ant colony [17, 18], plant growth simulation [19, 20], bacterial foraging [21], gray wolf [22], salp swarm [23], symbiotic organism search, hybrid cuckoo search [24], harmony search [25], and binary gravitational search [26], among others. On the other hand, mathematical optimization algorithms solve the reconfiguration problem by using conventional optimization techniques, for example, OPF by Bender Decomposition [8], mixedinteger convex programming [27, 28], convex models [29], mixed-integer linear programming [30], and mixed-integer second-order cone programming [31].

Nowadays, with the proliferation of photovoltaic systems, many distribution systems could integrate distributed generation (DG), storage systems, and power electronics (STATCOM), so they have to be included in the reconfiguration formulation problem as in Refs. [11, 20, 24, 32–35].

Furthermore, in some papers, multi-objective formulation problems are considered. In this sense, formulations include loss minimization and some other function, such as voltage profile enhancement [20, 36–40], load balancing [19, 38, 41, 42], branch current overloads [38], operation cost reduction [43], reliability [32, 44, 45], and outage costs [46].

### **1.2 Reactive power compensation dispatch**

As pointed out before, reactive power compensation (RPC) dispatch is the second way of reducing distribution system electrical losses, so a common objective function is electrical loss minimization either at the planning or operation stage. Furthermore, this objective function is nonlinear and convex, permitting its reduction by sequential commutation of capacitor banks to find one point where its value is minimal until the next capacitor bank commutation causes an electrical loss increment again [47].

It is important to note that the joint application of reconfiguration and RPC strategies allows for obtaining lower losses than either separated so that methods that have been developed involve both strategies [17, 48].

From the planning perspective, loss minimization may be reached by solving an optimal reconfiguration and allocation capacitor problem [33, 34, 49–53], which is combinatorial and nonlinear, so its solution has been proposed by using heuristic methods, metaheuristic methods, and mathematical optimization methods [54].

On the other hand, in an operation environment, loss minimization may be achieved by solving a loss minimization problem by joint reconfiguration and RPC dispatch, which is carried out with capacitor banks already installed with the capacity to be managed from the distribution control center [55]. However, due to the emerging concept of distribution control centers, solutions methods involving reconfiguration and RPC dispatch in real-time are few [54] and are based on ordinal optimization theory [56], parallel metaheuristic [57], multiagent system [55], analytical partitioning method [58], modified binary gray wolf [35], and robust optimization model [59].

This chapter presents two methodologies for solving the reconfiguration and RPC dispatch. Both methodologies are formulated as two-stage reconfiguration and RPC dispatch problems. In the first stage, network reconfiguration is carried out to find a set of feasible radial configurations with the lowest losses, satisfying voltage, and overload restrictions. In the second stage, an RPC dispatch is applied to each feasible network configuration by connecting capacitor blocks successively until all available reactive capacity has been used or a specified loss tolerance has been reached. Finally, analysis of switching each capacitor block is carried out using voltage/shunt reactive compensation linear sensitivities to make a relatively low computational work during the process.

### **2. Network reconfiguration and reactive power compensation formulation problems**

This section describes the methodology proposals for reconfiguration and RPC dispatch. Firstly, considerations for modeling and problem formulation are defined, bearing in mind the electrical loss minimization as the objective function, subject to various restrictions observed during the overall solution process.

To develop the problem formulation, it is necessary to make the next considerations, which are as follows—(i) a three-phase distribution system is operating under phase balance so that the network model is defined by the positive sequence circuit of its components; (ii) the distribution system may be supplied by one or more substations; (iii) RPC dispatch is realized by already installed capacitor banks and they can be commutated remotely from the distribution control center; (iv) capacitor banks only have either a commercial capacity of 300, 600, or 900 kVAr.

### **2.1 Problem formulation**

The problem of electrical loss minimization in distribution systems considering reconfiguration and RPC dispatch can be formulated as follows:

$$\text{Min } P\_{\text{loss}} = \sum\_{k \in F\_B} \frac{r\_k}{r\_k^2 + \varkappa\_k^2} \left( V\_i^2 + V\_m^2 - 2 \, V\_i \, V\_m \cos \left( \theta\_i - \theta\_m \right) \right) \tag{1}$$

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

$$\text{S.to } P\_{Gi} - P\_{Di} - V\_i \sum\_{m \in i} V\_m Y\_{im} \cos \left(\theta\_i - \theta\_m - \gamma\_{im} \right) = \mathbf{0}, \quad \forall i \in N \tag{2}$$

$$Q\_{Gi} - Q\_{Di} - V\_i \sum\_{m \in i} V\_m Y\_{im} \sin \left(\theta\_i - \theta\_m - \gamma\_{im} \right) = \mathbf{0}, \quad \forall i \in \mathcal{N} \tag{3}$$

$$V\_i^{\text{Min}} \le V\_i \le V\_i^{\text{Max}}, \quad \forall i \in N \tag{4}$$

$$S\_k \le S\_k^{\text{Max}}, \quad \forall k \in F\_B \tag{5}$$

$$\mathbb{S}\_{out,t} \le \mathbb{S}\_{out,t}^{\text{Max}}, \quad \forall t \in T\_S \tag{6}$$

$$0 \le b\_{\varepsilon} \le b\_{\varepsilon}^{\text{Max}}, \quad \forall \varepsilon \in \mathcal{N}\_{\mathbb{C}} \tag{7}$$

$$|F\_B| = |N| - \mathbf{1} \tag{8}$$

$$\left\{ (i\_1, m\_1) \cup (i\_2, m\_2) \cdots \cup (i\_{|F\_B|}, m\_{|F\_B|}) \right\} = \mathcal{N} \tag{9}$$

where *bc* represents a capacitor bank susceptance, *FB* is the feeder section set, *rk* and *xk* are the series resistance and reactance of the *kth* feeder section, respectively. *Sk* is the apparent power flowing on the *kth* feeder section and *SMax <sup>k</sup>* is the rating of the *kth* feeder section*, TS* is the set of supply transformers in the distribution system. *Vi* and *θ<sup>i</sup>* are the voltage magnitude and angle of complex voltage *Vi* at bus *i,* and *VMax <sup>i</sup>* , *VMin <sup>i</sup>* are the maximum and minimum voltage magnitudes at bus *i*, respectively. *Yim* and *γim* are the magnitude and angle of the complex nodal admittance associating busses *i* and *m*.

The objective function (1) accounts for the distribution system losses. The decision variables are the voltage magnitudes and angles of complex nodal voltages because their values define the losses at each feeder section. These decision variables are to be modified using reconfiguration and RPC dispatch.

Constraints (2) and (3) are the active (*P*) and reactive power (*Q*) balances at each bus *i* ∈ *N* . Constraint (4) considers that all nodal voltage magnitudes should remain within limits. Constraint (5) takes care of apparent power flow that does not reach a value above its maximum limit through each feeder section. Because load transfers are possible when the distribution system is being reconfigured, constraint (6) is necessary for imposing a maximum limit, *SMax out*,*<sup>t</sup>*, to the apparent power flow, *Sout*,*<sup>t</sup>*, from the supply substation transformer *t* to distribution feeders. Constraint (7) refers to every capacitor bank *c* of the set *NC*, denoted in terms of its susceptance; it may have a zero value when disconnected and connected by one or more steps (blocks) until it reaches its maximum value *b*max *<sup>c</sup>* . Finally, constraints (8) and (9) refer to guarantee radiality and maximum spanning tree of the network, which are based on the concept of set cardinality, Constraint (8) indicates that cardinality of *FB*, j j *FB* , should be equal to the cardinality of *N*, j j *N* , minus 1, while Constraint (9) guarantees that the radial network is a spanning tree, due that the left-hand set should be equal to *N*.

This general formulation is cast as a nonlinear and combinatorial problem. It can be solved by heuristic, metaheuristic, mathematic optimization, and combinations of those mentioned above. In general, a power flow should be realized at each solution step. Then, it is important that solution methods can find the optimal configuration rapidly to reduce the number of power flow simulations and computing time. Also, computational efficiency can be improved if the power flow algorithm is efficient, like those developed for solving radial distribution power flows [54]. However, these algorithms are not useful for the proposal presented in this chapter due to sensitivity calculations.

### **2.2 Power flow and sensitivity calculations**

Because sensitivity calculations are straightforward from the linearized power flow model solved in each iteration of the Newton–Raphson (NR) method, this is the algorithm used for the methodologies developed for solving the reconfiguration and RPC dispatch to minimize electrical distribution losses.

Equation sets (2) and (3) represent the power flow problem, which is solved iteratively applying the NR method by formulating and solving the next linear equation set expressed in the compact form [60]:

$$
\begin{bmatrix}
\Delta P\\\\ \Delta Q
\end{bmatrix}^{(l)} = \begin{bmatrix}
\frac{\partial P}{\partial \theta} & \frac{\partial P}{\partial V}V\\ \frac{\partial Q}{\partial \theta} & \frac{\partial Q}{\partial V}V
\end{bmatrix}^{(l)} \begin{bmatrix}
\Delta \theta\\\\ \Delta V
\end{bmatrix}^{(l)} \tag{10}
$$

Once solved (10), nodal voltage angles and magnitudes are updated as follows:

$$
\theta\_i^{(l+1)} = \theta\_i^{(l)} + \Delta \theta\_i^{(l)}, \ \forall i \in \mathcal{N} \tag{11}
$$

$$\mathbf{V}\_{i}^{(l+1)} = \mathbf{V}\_{i}^{(l)} + [\Delta \mathbf{V}\_{i} / \mathbf{V}\_{i}]^{(l)} \mathbf{V}\_{i}^{(l)} \,\,\forall i \in \mathbf{N} \tag{12}$$

where *l* is the iteration number, this process continues until a convergence tolerance is accomplished. In Eq. (10), the partial-derivative matrix is the Jacobian matrix and should be calculated at iteration *<sup>l</sup>*. Let *<sup>θ</sup>*ð Þ *base <sup>V</sup>*ð Þ *base* � �*<sup>T</sup>* , the power flow problem solution once that iterative process has been finished, where *T* indicates transposed. This vector solution represents the electrical system base case state, that is, the operating point defined by load, supply, electric network power flows, and losses. For sensitivity calculations, it is known as the base case. Suppose that this equilibrium point is perturbed with the commutation of a capacitor bank *c* installed at bus *j*, denoted by Δ*bcj*. Therefore, changes in the state vector can be calculated by constructing the next linear equation set [61]:

$$
\begin{bmatrix}
\frac{\partial P}{\partial \theta} & \frac{\partial P}{\partial V} \\
\end{bmatrix}
\begin{bmatrix}
\frac{\Delta \theta}{\Delta b\_c} \\
\Delta b\_c \\
\end{bmatrix} = -\begin{bmatrix}
0 \\ \vdots \\ 0 \\ -V\_j^2 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \tag{13}
$$

The only nonzero entry in the right-hand vector indicates that capacitor bank *c* is connected at bus *j*. Vector Δ*θ=*Δ*bcj* Δ*V=*Δ*bcj* � �*<sup>T</sup>* is known as the relative sensitivity vector between the state base case vector *<sup>θ</sup>*ð Þ *base <sup>V</sup>*ð Þ *base* � �*<sup>T</sup>* and the perturbation scalar value Δ*bcj*. The Jacobian matrix in Eq. (13) may be taken from Eq. (10) formed,

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

ordered, and factorized in the last NR iteration, but noting that submatrices ½ � ð Þ *<sup>∂</sup>P=∂<sup>V</sup> <sup>V</sup>* and ½ � ð Þ *<sup>∂</sup>Q=∂<sup>V</sup> <sup>V</sup>* in Eq. (10) are divided by their corresponding *<sup>V</sup>*. After the sensitivity calculations, a new state vector can be obtained, by using the next equations, once that Δ*bcj* has been defined in terms of kVAr:

$$
\theta\_i^{(new)} = \theta\_i^{(base)} + \left(\Delta\theta\_i / \Delta b\_{cj}\right) \Delta b\_{cj}, \quad \forall i \in \mathcal{N} \tag{14}
$$

$$V\_i^{(new)} = V\_i^{(base)} + \left(\Delta V\_i / \Delta b\_{cj}\right) \Delta b\_{cj}, \quad \forall i \in \mathcal{N} \tag{15}$$

With these new values, power flows and distribution losses are recalculated to know if the capacitor block Δ*bcj* connection causes a decrease or increase in the objective function, that is, total distribution system losses. If the distribution system has installed a set of capacitor banks, denoted as {*bc*1, … , *bcNc*}, Eq. (13) should be solved each time one capacitor bank or block is connected, which seems to be a high computational work; however, the Jacobian matrix in this equation remains constant and factored, so that, each solution of Eq. (13) requires only a forward and a backward substitution process, which represent much lower computational effort than the one related with a complete power flow calculation.

A flow chart of the power flow algorithm based on the NR method is shown in **Figure 1**, while sensitivity calculation is shown in **Figure 2**.

Notes about the **Figure 1**:


$$P\_{im} = \begin{bmatrix} V\_i \begin{bmatrix} V\_i \ \mathbf{g}\_{im} \ \end{bmatrix} \ - \ \ V\_m \begin{bmatrix} \rho\_{im} \ \cos \ \begin{pmatrix} \theta\_i \ - & \theta\_m - \rho\_{im} \end{pmatrix} \end{bmatrix} \tag{16}$$

$$P\_{mi} = \; V\_m \left[ V\_m \; g\_{im} - \; V\_i \; y\_{im} \; \cos \left( \theta\_m - \; \theta\_i - \rho\_{im} \right) \right] \tag{17}$$

where complex series admittance of feeder section connecting nodes *i* and *m* is calculated in rectangular and polar coordinates by Eqs. (18) and (19), respectively.

$$\overline{y}\_{im} = \mathbf{g}\_{im} + jb\_{im} = \frac{r\_{im}}{r\_{im}^2 + \varkappa\_{im}^2} + j\frac{\varkappa\_{im}}{r\_{im}^2 + \varkappa\_{im}^2} \tag{18}$$

### **Figure 1.**

*Flow chart for solving power flow problems by Newton Raphson method.*

$$\overline{y}\_{im} = y\_{im} \angle \rho\_{im}; \; y\_{im} \sqrt{\mathbf{g}\_{im}^2 + \mathbf{b}\_{im}^2}; \; \rho\_{im} = \tan^{-1}(b\_{im}/\mathbf{g}\_{im}) \tag{19}$$

Active power losses through the feeder section connecting nodes *i* and *m* are calculated by Eqs. (16) and (17), which, after some algebraic operations, are expressed as:

$$P\_{loss,i-m} = \mathbf{g}\_{im} \left[ V\_i^2 + V\_m^2 - 2V\_i V\_m \cos \left( \theta\_i - \theta\_m \right) \right] \tag{20}$$

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

**Figure 2.** *Flow chart for sensitivity evaluations of capacitor bank connections.*


### *2.2.1 Sensitivity Evaluation to Find the Maximum Loss Reduction*

By using the power flow solution obtained by the NR algorithm, sensitivities for capacitor bank connections may be calculated straightforwardly. RPC dispatch assumes that the already installed capacitor banks have initially disconnected one, two, three, or more blocks. A power flow is performed to determine the initial distribution losses. After, capacitor blocks will be connected successively. The process calculates sensitivities for each block connection evaluating the new state distribution system, power flows, and distribution losses. Once the first block pertaining to every one of the capacitors installed were connected, their corresponding distribution losses were ranked from the lowest to the highest. The capacitor block associated with the first position is added to a connected set of capacitor blocks. Then, a new power flow is carried out to refresh the Jacobian matrix to continue the sensitivities calculation to evaluate the connection of the next capacitor block remaining as disconnected in each node where capacitors exist in the distribution system. This procedure is carried out until no more capacitor blocks are disconnected or optimal distribution losses are found. The flow chart of **Figure 2** resumes this procedure, where *nc* = j j *NC* , that is, the number of capacitor banks.

To observe the behavior of distribution losses with capacitor bank connections, **Figure 3** shows a distribution feeder whose section parameters are all equal on a per unit basis: *r* = 0.1 and *x* = 0.07 over a base of 10 MVA and 13.8 kV. Node 0 is the supply point with no load, while all the other nodes have a uniform load of 120 kW and 60 kVAr.

The analysis was realized by simulating the connection of a capacitor bank in nodes 1 through 12 to find the optimum capacitor bank and its location. For the sake of clarity, **Figure 4** shows the results only for nodes 7, 8, and 9, which showed lower losses. Note that distribution losses were plotted from 300 kVAr to 750 kVAr, with a linear distribution loss reduction up to 480 kVAr capacitor bank connection in the three nodes, where node 9 presents the lowest distribution losses. After this point, distribution losses become more nonlinear until reaching a minimum value of around 116.5 kW with 620 kVAr in node 9, 116.0 kW with 660 kVAr in node 8, and 116.4 kW with 680 kVAr in node 7. From this analysis, important concluding remarks are as follows—(i) the node with the initial lowest distribution losses could not be the same when the minimum is found after capacitor connections are performed; (ii) minimum loss values reached with capacitor connections are very close to each other, and the same occurs with their kVAr capacities, which are very similar; (iii) the block capacitor connection effect is steadily decreasing over distribution losses until it arrives at a

**Figure 3.** *Distribution system with equal section parameters and uniform load.*

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

**Figure 4.** *Distribution electrical losses versus capacitor bank connection.*

practically zero value, and after this point, the effect tends to be negative; (iv) lately, it can be considered that the optimal distribution losses can be found with an error below of 1 kW, so that, this tolerance is used as stopping criterium for both methodologies explained next.

### **3. Methodologies**

Formulations proposed in Refs. [5, 47] solve the network reconfiguration problem in distribution systems following a similar strategy. First, the initial radial distribution system is converted to a meshed network by closing all the system switches; then one switch is opened according to the lowest apparent power flow criterion. Once this action is finished, the next switch with the lowest apparent flow is opened, and so on. This process continues until the resulting configuration is completely radial, and its graph is a spanning tree. This algorithm can find the optimal or suboptimal reconfiguration, that is., with the lowest or almost lowest distribution of electrical losses. An alternative strategy consists in looking for the two or more reconfigurations whose switches cause the lower distribution losses instead of searching for only one reconfiguration at each step. This will lead to a feasible reconfiguration set. Furthermore, as explained before, the resultant distribution losses may be further reduced with the application of RPC dispatch to those reconfigurations obtained before, which have minor losses and are very close to each other, as in the example described above. Thus, once the reconfiguration process has finished (Stage 1), the result is a feasible reconfiguration set containing a reduced reconfiguration alternative number, which passes through the RPC dispatch procedure for obtaining the optimal loss reconfiguration (Stage 2).

### **3.1 Feasible reconfiguration search algorithm**

The basic algorithm developed in Ref. [5] looks for only one reconfiguration, which, almost in all cases, yields the one with the lowest distribution losses. In this chapter, this algorithm is modified for searching various reconfigurations based on the selection of the two switches having the least apparent power flow through them.

With a view to clarifying explanation, consider that every distribution system, for simplicity, is operated as a radial network and supplies all the electricity consumers.

In general, distribution systems can be represented by graphs. For example, the distribution system has a radial configuration if there is only one path between the supply and load points. Furthermore, for making possible the optimal operation with the least electrical losses, distribution systems have normally open switches, which can be closed when some operational condition change causes electrical losses to increase significantly, and the same number of normally closed switches should be opened for maintaining distribution system radiality providing that there is not any node isolated from the rest.

Let us assume that switches can be opened or closed from the distribution control center, so the distribution electrical network topology may be updated depending on the prevailing operational conditions in the distribution system.

In terms of graph theory, a graph is formed by branches and links, which connect vertices (nodes), so that if the latter are separated from the graph, the result is a graph with only one trajectory between any two nodes in the graph and the same occurs with a radial distribution system.

An assumption can be made—normally closed switches can be considered branches, while normally open switches are regarded as links. Defining the branch number as *B*, link number as *L*, and the extreme points of every switch as nodes, whose number is *M*, therefore, the tree graph has *M* � 1 = *B* branches [62]. Also, it is called a connected tree graph or spanning tree if this graph includes all radial distribution system nodes. Networks whose graphs are not tree graphs but contain all their nodes, that is, they do not have isolated nodes. Therefore, they are just connected graphs, as in the case where one or more of the normally open switches are closed, creating a meshed distribution system.

With the graph information and using a breadth-first search algorithm (BFA), the search process for finding the feasible reconfiguration set (FRS) is described as follows.

The BFA organizes its search in levels by opening some of the normally closed switches from the base case. **Figure 5** illustrates this procedure.

The procedure begins at level 0 with no open switches, denoted as the set *OS* = {}. Therefore, considering the two switches, *S*<sup>1</sup> and *S*2, with the lowest apparent power flow, the first level is formed with the sets: *OS* = {*S*1, *S*2}, *FR*ð Þ<sup>1</sup> <sup>1</sup> ={*S*1}, *FR*ð Þ<sup>1</sup> <sup>2</sup> = {*S*2}, which are used for the level 2, giving the next sets: *OS* = {*S*1, *S*2, *S*3, *S*4}, *FR*ð Þ<sup>2</sup> <sup>1</sup> = {*S*1, *S*3}, *FR*ð Þ<sup>2</sup> <sup>2</sup> = {*S*1, *<sup>S</sup>*4}, *FR*ð Þ<sup>2</sup> <sup>3</sup> = {*S*2, *<sup>S</sup>*5}, *FR*ð Þ<sup>2</sup> <sup>4</sup> = {*S*2, *S*6}, and so on. The number of levels is *L*, so that, at the last level, *OS* = {*S*1, … , *SR*}, where *R* is the number of open switches at this level.

On the other hand, the construction of feasible reconfigurations, which have only open switches, is carried out with the progress informing *FR*ð Þ<sup>1</sup> <sup>1</sup> , *FR*ð Þ<sup>1</sup> <sup>2</sup> , *FR*ð Þ<sup>2</sup> <sup>1</sup> , *FR*ð Þ<sup>2</sup> <sup>2</sup> , *FR*ð Þ<sup>2</sup> 3 , … , etc. The number of reconfigurations created by brute force is 2*<sup>L</sup>* , but any violation in either constraint (4)–(6), (8), (9), or by the existence of similar reconfigurations during the searching process, may reduce this number substantially at the end of stage 1.

### **3.2 Methodology 1**

The proposal of Methodology 1 is built upon the method described in Refs. [47, 63] to obtain the compensation scheme. This proposal aims to obtain an accurate solution

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

**Figure 5.** *Flow chart for finding the feasible reconfiguration set.*

similar to other methods but tries to maintain a reasonable computational efficiency to be used as a tool for the operation of electrical distribution systems. This proposal looks for the optimal reconfiguration by performing two stages, where the first is related to the search of the FRS using the process illustrated in **Figure 5**. In contrast, the second one realizes the RPC dispatch considering the FRS. The steps of stages 1 and 2 in Methodology 1 are described below.

Stage 1. Determination of a feasible configuration set.


Stage 2. Reactive power compensation dispatch.

As pointed out before, a node where there is capacitor block(s) installed is consider a feasible system node; also, only capacitor blocks of 300, 600, or 900 kVAr are considered for the RPC dispatch, which is carried out following the next steps:


*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*


### **3.3 Methodology 2**

Methodology 1 may be improved, without affecting its accuracy, by considering for the first and subsequent intermediate levels of the decision-making tree, a limit of no more than 10 possible reconfigurations for reducing computational work in the last levels, because, at that levels, they have less influence over distribution loss reductions when selecting different combinations. In addition, the configurations resulting from this process must have lower losses and be close to each other to be taken into account as feasible reconfigurations at Stage 2.

With the above considerations, by making some changes to Methodology 1, Methodology 2 resulted, whose description is as follows.

The experience gained working with Methodology 1 is that, at the first level, considering only two switches with the lower apparent power flow may lead to suboptimal results when the reconfiguration process finishes. Therefore, in level 1, Methodology 2 includes five switches with the lowest apparent power flow. From this point, Methodology 2 continues normally since computational efficiency degrades if this criterion prevails in the next levels.

On the other hand, to improve the computational efficiency of the first stage, the search space at each level is limited so that the decision-making tree does not grow excessively (which happens if there are many link switches).

Furthermore, an additional computational efficiency improvement is disregarding, from the second level and the next ones, those reconfigurations that do not accomplish a tolerance margin of 3%, based on the difference in losses between the reconfiguration with the lowest losses and all other reconfigurations obtained in the correspondent level.

Finally, in Stage 2, of Methodology 2, investigating the connection of capacitor blocks by sensitivity calculations instead of using the complete power flow algorithm may improve the computational efficiency without losing accuracy.

Performing the previous modifications to Methodology 1, the steps of each stage of methodology 2 are defined as follows.

Stage 1. Determination of a set of feasible reconfigurations.


Stage 2. Reactive power compensation dispatch.

Under the same considerations of Stage 2 of Methodology 1, the RPC dispatch is carried out following the next steps:


*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

### **4. Numerical examples**

This section reports numerical examples from two case studies. The proposed methodologies are first applied to the IEEE 16-bus system for illustrative purposes. This benchmark is useful to analyze comprehensively the effects of the novel modeling aspects featured by the proposed methods. Subsequently, the performance of both methodologies on the Taiwan Power Company distribution system is investigated.

### **4.1 IEEE 16-bus distribution system**

In addition to being widely used in the literature, the IEEE 16-node distribution system has a reactive compensation scheme, so it is ideal for observing the behavior of algorithms that perform reconfiguration and RPC dispatch for distribution systems. This system is a three-phase distribution system with three feeders, 16 nodes, 13 load points, 13 normally closed switches, and 3 normally opened switches, and the operation nominal voltage is 12.66 kV. **Figure 6** shows the corresponding single line diagram, where switches S14, S15, and S16 define the initial operative condition of this system. Suppose that the load pattern changes so that nodal voltage and angle profiles are modified, causing distribution losses that may not be optimal with the actual configuration and RPC dispatch.

A set of feasible reconfigurations are obtained at Stage 1. Then, the solution with the lowest losses and the resultant RPC dispatch with capacitor banks is obtained at Stage 2.

First, the three normally open switches are closed; thus, a meshed network is formed. Then, there are three meshes in the system, so the same number of switches must be opened for the system to be radial again. Therefore, the decision-making tree consists of three levels. For level 1, the two switches, S7 and S16, are selected because they have the lowest apparent power flow through them. After, a power flow is

**Figure 6.** *IEEE 16-node distribution system.*

carried out for switches S7, and S16 opened separately, and the next two switches with the lowest apparent power flow are selected.

**Figure 7** illustrates the feasible reconfiguration selection process. Note that losses were increasing from the top level to the bottom level. This is due to meshed networks presenting lower losses than radial networks. However, between the five feasible reconfigurations in level 3, *FR*ð Þ<sup>3</sup> <sup>4</sup> = {S7, S16, S8}, presents the lowest distribution losses, 466.1 kW, which is to be the first candidate to obtain the optimal value at the end of Stage 2 because of the distribution losses given by the other feasible reconfigurations.

On the other hand, three repeated options are eliminated (alternatives with dotted lines), one of them at level 2. Therefore, there is no reason why it must be investigated at lower levels. At the process ending, only five feasible reconfigurations passed to Stage 2.

The resulting reconfiguration options make up a set of feasible configurations, as shown in **Table 1**.

Other methodologies applied to this example selected a reconfiguration with the lowest losses open switches S7, S16, and S8 (FR1), which presents the lowest loss value of 468.33 kW. Therefore, Methodology 1 includes this optimal solution among feasible reconfigurations. Then, stage 2 is applied to know the final losses with RPC dispatch to the five feasible reconfigurations.

For this system, to apply Methodology 2, the five switches with the lowest apparent power flow are selected to be the decision-making tree first level, S7, S16, S4, S8, and S1. The distribution losses obtained with switches S7 and S16 open are less than those obtained when opening the other ones. Therefore, these two switches are selected to begin the decision-making tree and continue the reconfiguration process. The set of feasible reconfigurations is shown in **Table 2**.

Unlike the feasible reconfigurations obtained by Methodology 1, only two configurations resulted from applying Methodology 2. This is because, when considering a tolerance margin of 3%, as indicated in the last step of Stage 1, configurations whose difference in distribution losses concerning the lowest losses obtained is more than 3%, that is, 14.049 kW, are eliminated from the feasible reconfiguration set. The only

**Figure 7.** *Generation of feasible reconfigurations by levels for the system of Figure 4.*

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*


### **Table 1.**

*Feasible reconfigurations obtained (first stage) using methodology 1.*


### **Table 2.**

*Feasible configurations found using methodology 2.*


### **Table 3.**

*Results of stage 2 applying both methodologies.*

feasible reconfiguration that complies with this tolerance is the one corresponding to the opening of switches S7, S4, and S8, which corresponds to the FR3 when applying Methodology 1.

The total reactive capacity compensation defined for the original system is 11.4 MVAr. Therefore, 11.4 MVAr will also be used as a limit for the RPC dispatch or until the loss reduction is less than 1 kW. Each capacitor block is 300 kVAr. Hence, 38 blocks can be used to cover the total reactive capacity. The results are shown in **Table 3**.

As can be noted, with reconfiguration FR1, the minimum losses are obtained before and after performing the RPC dispatch. In addition, it is observed that the higher the losses before starting Stage 2 tend to be reduced the more when applying for reactive compensation. However, this fails to change the result of the combination of reconfiguration and RPC dispatch with minimal losses.

The initial loss difference without connected capacitors between FR2 and FR5 configurations is 6.3 kW or 1.003% over FR2. Therefore, if these two reconfigurations changed positions and FR5 obtained lower losses than FR2 with the capacitors connected, it means that a difference of approximately 1% between the reconfiguration of lower losses and the other feasible reconfigurations is not enough to guarantee that the positions according to lower losses remain the same at the end of Stage 2. In addition, the difference between the losses of the FR2 and FR3

*Smart Grids Technology and Applications*


### **Table 4.**

*Resulting RPC dispatch (MVAr) scheme: IEEE 16-bus system.*

configurations before applying the RPC dispatch is only 0.8 kW, and after applying it, the difference results in 8.3 kW.

The solution to the problem of reconfiguration and RPC dispatch for this case is to use FR1 with the RPC dispatch scheme shown in **Table 4**.

From **Table 4**, it can be observed that the difference between methodologies is minimal both in the RPC dispatch scheme and in the final losses. This means that it is adequate to replace the power flow simulations with sensitivity calculations when evaluating losses with the connection of each block of the capacitor complete set.

Methodology 1 determines a different location of capacitor banks than Methodology 2, but the same amount of reactive compensation (11.4 MVAr) is used.

**Figure 8** depicts the voltage magnitudes resulting from the base case and Methodologies 1 and 2. Note that, in general, the voltage profile is elevated with respect base case. This is because values of 1 p.u. for nodes 1, 2, and 3 are supply points (see **Figure 6**), and their voltages always are constant. On the other hand, nodes 8, 10, and 11 present the lowest values around 0.97 p.u. and below, whereas the highest voltage magnitude values are presented in nodes 12, 13, 14, 15, and 16. This is because these nodes initially have capacitors connected with higher capacities than those obtained with the RPC dispatch. This situation illustrates that it is better for distribution loss reduction to have deployed capacitor banks in various nodes instead of concentrating them in a few nodes. Finally, it is worth observing the voltage magnitude scale in the vertical axis, and it can be seen that the voltage magnitude differences shown are relatively small.

### **4.2 Taiwan power company distribution system**

The Taiwan Power Company (TPC) distribution system is a three-phase system, 11.4 kV, 11 feeders, 83 normally closed switches, and 13 normally open tie switches. **Figure 9** depicts the network diagram; dotted lines represent normally open tie switches.

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

**Figure 8.** *IEEE 16-bus distribution system voltage magnitudes.*

As there are 13 tie-lines, 13 levels for the decision-making tree determine the feasible configurations. With Methodology 1, only the investigation in the last level resulted in 682 feasible reconfigurations. Performing this number of power flow simulations only at the last level's decision-making tree is not convenient for finding FRS. Moreover, for distribution systems with many switches, the efficiency of the proposed methodologies could be similar or even worse than that of almost metaheuristic methods normally used for planning. This is why only 10 configurations with the lower distribution losses are selected, as pointed out before for Stage 1 of both methodologies. Keeping in mind this feature, the result for the current distribution system is shown in **Table 5**, after Stage 1 was realized.

The FRS obtained by Methodology 1 is almost completely different from that resulting from Methodology 2; only three FRs are equal: FR2-FR2, FR5-FR6, and FR9- FR10 defined by methodologies 1 and 2, respectively. Also, the configuration with the minor losses of Methodology 1 reports lower losses than that of Methodology 2. This is because, during the process, the combination of open switches that leads to the configuration of lower losses for Methodology 1 is eliminated when using Methodology 2, since at one level, the limit of 10 possible combinations is exceeded, and that option has higher losses than the 10 with which the process is continued. Despite this, configurations with similar losses were determined since the lowest loss FR obtained by Methodology 1 is 587.2 kW. The one obtained by Methodology 2 is 588.0 kW (the difference is only 0.8 kW or 0.18%). Finally, note that all 10 FRs cause a decrease in electrical losses compared with FR0, denoted as Base.

On the other hand, the combinations formed in the decision-making tree (from the first level to the last) using Methodology 1 are 1135. In the case of Methodology 2, there are only 160 combinations. Because a power flow simulation must be performed for each combination, the difference in computational work between both

### **Figure 9.** *TPC distribution system.*

methodologies applied to the TPC distribution system is too great (975 power flows). However, in general, it may be compensated because there is a small difference between the accuracy of both methods.

The effect of connecting capacitors to each feasible configuration in terms of total distribution losses is reported in **Table 6**. It should be noted that methodologies 1 and 2 *Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*


### **Table 5.**

*Ten feasible configurations with the lowest distribution losses (kW).*


### **Table 6.**

*Distribution losses (kW) and rank with the RPC dispatch for the 10 FRs.*


### **Table 7.**

*Resulting RPC dispatch (MVAr) scheme: TPC distribution system.*

reached practically the minimum electrical loss level with a difference of only 0.1 kW, but, as pointed out before, Methodology 2 is much more efficient than Methodology 1.

The RPC dispatch scheme with Methodology 1 obtained the lowest distribution losses using FR4, whereas Methodology 2 applied RPC dispatch to FR3. Both solutions are reported in **Table 7**. Note that total electrical distribution losses decreased from 587.2 kW without RPC dispatch to 437.2 kW with RPC dispatch applying Methodology 1, that is, a reduction of 150 kW or 25.54%.

**Figure 10** depicts the voltage profile for the initial configuration and the proposed methodologies. It can be noticed that the results obtained by the proposed methodologies are quite similar. Both methodologies find a better voltage profile since the minimum voltage is 0.9642, p.u. whereas in the base case, it reaches 0.9466 p.u.

**Figure 10.** *TPC distribution system voltage magnitudes.*

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

### **5. Conclusions**

Applying reconfiguration and RPC dispatch with capacitor banks simultaneously, even when different formulations are used to solve both problems, allows for a greater reduction in electrical distribution losses. Furthermore, if reconfiguration and RPC dispatch are executed sequentially, the optimal solution may be obtained.

The operation of electrical distribution systems with already installed reactive compensation requires an RPC dispatch to reduce electric losses or improve voltage profiles. Therefore, only nodes with already connected capacitors should be considered for the study. In this regard, the efficiency of the proposed methodologies is increased due to the fact that the search space is reduced and with it the number of necessary operations.

Sensitivity analysis instead of power flow increases the computational efficiency to calculate changes in capacitive compensation.

Both methodologies are a competitive option for distribution loss optimization because of their relatively low computational work. Also, Methodology 2 has higher computational efficiency and accuracy comparable with Methodology 1.

From the results of Stage 1 with the two distribution systems analyzed, it is convenient to limit the FRS to 10 or fewer and consider only those that meet a 3% tolerance with respect to that of lower losses, since only those that report the lowest losses are most likely to be part of the solution at the end of the capacitive compensation process.

When RPC dispatch is performed, a minimum tolerance margin is defined to reduce losses for planning or operational decisions on the distribution system to increase computational efficiency. This loss reduction margin (which also improves the voltage profile of the system in general) must justify the investment made in the capacitor banks and in their connection to the busses that require it.

### **Acknowledgements**

This work was supported by the Tecnologico Nacional de México under Project 13322.21-P.

*Smart Grids Technology and Applications*

### **Author details**

Ulises Tovar Ramírez<sup>1</sup> , José Horacio Tovar Hernández<sup>2</sup> and Guillermo Gutiérrez Alcaraz2 \*

1 National Energy Control Center, Mexico City, Mexico

2 National Tehcnological Institute of Mexico/I.T. Morelia, Morelia, Mich, México

\*Address all correspondence to: guillermo.ga@morelia.tecnm.mx

© 2022 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

### **References**

[1] Civanlar S, Grainger JJ, Yin H, Lee SSH. Distribution feeder reconfiguration for loss reduction. IEEE Transactions on Power Delivery. 1988;**3**:1217-1223. DOI: 10.1109/61.193906

[2] Braz HD, de Souza BA. Distribution network reconfiguration using genetic algorithms with sequential encoding: Subtractive and additive approaches. IEEE Transactions on Power Systems. 2011;**26**:582-593. DOI: 10.1109/ TPWRS.2010.2059051

[3] Wu W-C, Tsai M-S. Application of enhanced integer coded particle swarm optimization for distribution system feeder reconfiguration. IEEE Transactions on Power Delivery. 2011; **26**:1591-1599. DOI: 10.1109/TPWRS. 2010.2094212

[4] Bouchard DE, Salama MMA, Chikhani AY. Algorithms for distribution feeder reconfiguration. In: 1996 Canadian Conference on Electrical and Computer Engineering. London: IEEE; 1996. pp. 794-797. DOI: 10.1109/ CCECE.1996.548272

[5] Shirmohammadi D, Wayne HH. Reconfiguration of electric distribution networks for resistive line losses reduction. IEEE Transactions on Power Delivery. 1989;**4**:1492-1498. DOI: 10.1109/61.25637

[6] Pahwa A. Role of distribution automation in restoration of distribution systems after emergencies. Power Engineering Society Summer Meeting. 2001;**2001**:1-2. DOI: 10.1109/PESS. 2001.970136

[7] Khodr HM, Martínez CJ, Matos MA. Distribution systems reconfiguration based on OPF using benders decomposition. IEEE Transactions on

Power Delivery. 2009;**24**:2166-2176. DOI: 10.1109/TPWRD.2009.2027510

[8] Mishra S, Das D, Paul S. A comprehensive review on power distribution network reconfiguration. Energy Systems. 2017;**8**:227-284. DOI: 10.1007/s12667-016-0195-7

[9] Zin AAM, Ferdavani AK, Khairuddin AB, Naeini MM. Reconfiguration of radial electrical distribution network through minimum-current circularupdating-mechanism method. IEEE Transactions on Power Systems. 2012;**27**: 968-974. DOI: 10.1109/TPWRS. 2011.2174258

[10] Syahputra R, Robandi I, Ashari M. Reconfiguration of distribution network with distributed energy resources integration using PSO algorithm. Telkomnika. 2015;**13**:759-766. DOI: 10.12928/telkomnika.v13i3.1790

[11] Thakur T. Application of tabu-search algorithm for network reconfiguration in radial distribution system. In: 2006 International Conference on Power Electronic, Drives and Energy Systems. London: IEEE; 2006. pp. 1-4. DOI: 10.1109/PEDES.2006.344305

[12] de Andrade BAR, Ferreira NR. Simulated annealing and tabu search applied on network reconfiguration in distribution systems. In: 2018 Simposio Brasileiro de Sistemas Eletricos (SBSE) IEEE: London; 2018. pp. 1-6. DOI: 10.1109/SBSE.2018.8395757.

[13] Cheng HC, Kou CC. Network reconfiguration in distribution systems using simulated annealing. Electric Power Systems Research. 1990;**29**: 239-246. DOI: 10.1016/0378-7796(94) 90018-3

[14] Jeon YJ, Kim JC, Kim JO, Shin JR, Lee KY. An efficient simulated annealing algorithm for network reconfiguration in large-scale distribution systems. IEEE Transactions on Power Delivery. 2002; **17**:1070-1078. DOI: 10.1109/TPWRD. 2002.803823

[15] Chiou J-P, Chang C-F, Su C-T. Variable scaling hybrid differential evolution for solving network reconfiguration of distribution systems. IEEE Transactions on Power Systems. 2005;**20**:668-674. DOI: 10.1109/ TPWRS.2005.846096

[16] Chang C-F. Reconfiguration and capacitor placement for loss reduction of distribution systems by ant colony search algorithm. IEEE Transactions on Power Systems. 2008;**23**:1747-1755. DOI: 10.1109/TPWRS.2008.2002169

[17] Abdelaziz AY, Elkhodary SM, Osama RA. Distribution networks reconfiguration for loss reduction using the Hyper Cube Ant Colony Optimization. In: The 2011 International Conference on Computer Engineering & Systems. London: IEEE; 2011. pp. 79-84. DOI: 10.1109/ICCES.2011.6141016

[18] Rama Rao PVV, Sivanagaraju S. Radial distribution network reconfiguration for loss reduction and load balancing using plant growth simulation algorithm. International Journal on Electrical Engineering and Informatics. 2010;**2**:266-277

[19] Rajaram R, Satish Kumar K, Rajasekar N. Power system reconfiguration in a radial distribution network for reducing losses and to improve voltage profile using modified plant growth simulation algorithm with distributed generation (DG). Energy Reports. 2015;**1**:116-122. DOI: 10.1016/j. egyr.2015.03.002

[20] Mam M, Leena G, Saxena NS. Distribution network reconfiguration for power loss minimization using bacterial foraging optimization algorithm. International Journal of Engineering and Manufacturing. 2016;**2**:18-32. DOI: 10.5815/ijem.2016.02.03

[21] Reddy AS, Reddy MD, Reddy MSK. Network reconfiguration of distribution system for loss reduction using GWO algorithm. International Journal of Electrical and Computer Engineering (IJECE). 2017;**7**(6):3226-3234. DOI: 10.11591/ijece.v7i6.pp3226-3234

[22] Yodphet D, Onlam A, Siritaratiwat A, Khunkitti P. Electrical distribution system reconfiguration for power loss reduction by the Salp Swarm algorithm. International Journal of Smart Grid and Clean Energy. 2019;**8**:156-163. DOI: 10.12720/sgce.8.2.156-163

[23] Duong TL, Nguyen TT. Network reconfiguration for an electric distribution system with distributed generators based on symbiotic organism search. Engineering, Technology & Applied Science Research. 2019;**9**:4925- 4932. DOI: 10.48084/etasr.3166

[24] Zubairu FA, Jibril Y, Abubakar AS. Optimal reconfiguration of power distribution network for loss reduction using hybrid cuckoo search algorithm and particle swarm optimization. Journal of Science Technology and Education. 2021;**9**:1-10

[25] Rao RS, Narasimham SVL, Raju MR, Rao AS. Optimal network reconfiguration of large-scale distribution system using harmony search algorithm. IEEE Transactions on Power Systems. 2011;**26**:1080-1088. DOI: 10.1109/TPWRS.2010.2076839

[26] Esmaeilian HR, Fadaeinedjad R, Attari SM. Distribution network

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

reconfiguration to reduce losses and enhance reliability using binary gravitational search algorithm. In: 22nd International Conference on Electricity Distribution (CIRED 2013). London: IEEE; 2013. pp. 1-4. DOI: 10.1049/ cp.2013.0703

[27] Jabr RA, Singh R, Pal BC. Minimum loss network reconfiguration using mixed-integer convex programming. IEEE Transactions on Power Systems. 2012;**27**:1106-1115. DOI: 10.1109/ TPWRS.2011.2180406

[28] Taylor JA, Hover FS. Convex models of distribution system reconfiguration. IEEE Transactions on Power Systems. 2012;**27**:1407-1413. DOI: 10.1109/ TPWRS.2012.2184307

[29] Novoselnik B, Bolfec M, Bošković M, Baotić M. Electrical power distribution system reconfiguration: Case study of a real-life grid in Croatia. International Federation of Automatic Control (IFAC). 2017;**50**:61-66. DOI: 10.1016/j. ifacol.2017.08.011

[30] Mahdavi M, Romero R. Reconfiguration of radial distribution systems: An efficient mathematical model. IEEE Latin America Transactions. 2021;**19**:1172-1181. DOI: 0000-0002-0454-5484

[31] Amanulla B, Chakrabarti S, Singh SN. Reconfiguration of power distribution systems considering reliability and power loss. IEEE Transactions on Power Delivery. 2012; **27**:918-926. DOI: 10.1109/ TPWRD.2011.2179950

[32] Salau AO, Gebru YW, Bitew D. Optimal network reconfiguration for power loss and voltage profile enhancement in distribution systems. Heliyon. 2020;**6**:1-8. DOI: 10.1016/j. eliyon.2020.e04233

[33] Biswas PP, Suganthan PN, Amaratunga GAJ. Distribution network reconfiguration together with distributed generator and shunt capacitor allocation for loss minimization. IEEE Congress on Evolutionary Computation (CEC). 2018; **2018**:1-7. DOI: 10.1109/CEC.2018. 8477894

[34] Pamshetti VB, Singh S, Singh SP. Combined impact of network reconfiguration and volt-VAR control devices on energy savings in the presence of distributed generation. IEEE Systems Journal. 2020;**14**:995-1006. DOI: 10.1109/JSYST.2019.2928139

[35] Li P, Zhang C, Wu Z, Xu Y, Hu M, Dong Z. Distributed adaptive robust voltage/VAR control with network partition in active distribution networks. IEEE Transactions on Smart Grid. 2020; **11**:2245-2256. DOI: 10.1109/TSG.2019. 2950120

[36] Landeros A, Koziel S, Abdel-Fattah MF. Distribution network reconfiguration using feasibilitypreserving evolutionary optimization. Journal of Modern Power Systems and Clean Energy. 2019;**7**:589-598. DOI: 10.1017/s40565-018-0480-7

[37] Kanase AB, Gengaje SR. Reconfiguration of electrical distribution network using artificial neural network. International Journal of Advanced Research in Engineering and Technology (IJARET). 2018;**9**:119-128

[38] Oloulade A, Imano AM, Fifatin X, Vianou A, Tamadaho H, Badarou R. Multi-objective optimization of the safe operation on the electrical distribution system by placing D-FACTS and network reconfiguration. Journal of Power and Energy Engineering. 2019;**7**: 94-113. DOI: 10.4236/jpee.2019.79007

[39] Pandey GP, Mali B, Shrestha A, Singh A, Jha AK. Performance enhancement of radial distribution system via network reconfiguration: A case study of urban city in Nepal. Journal of Renewable Energy, Electrical, and Computer Engineering. 2021;**1**:1-11. DOI: 10.29103/jreece.v1i1.3455

[40] Kahouli O, Alsaif H, Bouteraa Y, Ali NB, Chaabene M. Power system reconfiguration in distribution network for improving reliability using genetic algorithm and particle swarm optimization. Applied Sciences. 2021;**11**: 1-15. DOI: 10.3390/app11073092

[41] Zhou Q, Shirmohammadi D, Liu WH. Distribution feeder reconfiguration for service restoration and load balancing. IEEE Transactions on Power Systems. 1997;**12**(2):724-729. DOI: 10.1109/59.589664

[42] Zhou Q, Shirmohammadi D, Edwin Liu WH. Distribution feeder reconfiguration for operation cost reduction. IEEE Transactions on Power Systems. 1997;**12**:730-735. DOI: 10.1109/ 59.589665

[43] Ding F, Loparo KA. A simple heuristic method for smart distribution system reconfiguration. IEEE Energytech. 2012;**1**:6. DOI: 10.1109/ EnergyTech.2012.6304698

[44] Nuhanović A, Hivziefendić J, Hadžimehmedović A. Distribution network reconfiguration considering power losses and outages costs using genetic algorithm. Journal of Electrical Engineering. 2013;**64**:265-271. DOI: 10.2478/jee-2013-0039

[45] Atmaca E, Ersoz D. Testing ordinal optimization approach in power distribution system control. IEEE/PES Transmission and Distribution

Conference and Exposition. 2008;**2008**: 1-5. DOI: 10.1109/TDC.2008.4517078

[46] The T. T, Ngoc DV, Anh NT. Distribution network reconfiguration for power loss reduction and voltage profile improvement using chaotic stochastic fractal search algorithm. Complexity. 2020;**2020**:1-15. DOI: 10.1155/2020/ 2353901

[47] Baran ME, Wu FF. Network reconfiguration in distribution systems for loss reduction and load balancing. IEEE Transactions on Power Delivery. 1989;**4**:1401-1407. DOI: 10.1109/ 61.25627

[48] Bakken D, Iniewski K. Smart Grids*:* Clouds, Communications, Open Source, and Automation, Chapter: Expert Systems Application for The Reconfiguration of Electric Distribution Systems. USA: CRC Press, Taylor and Francis Group; 2014. pp. 359-373

[49] Devabalaji KR, Imran AM, Yuvaraj T, Ravi K. Power loss minimization in radial distribution system, 2015 international conference on alternative energy in developing countries and emerging economies. Energy Procedia. 2015;**79**:917-923. DOI: 10.1016/j. egypro.2015.11.587

[50] Essa MB, Alnabi LA, Dhaher AK. Distribution power loss minimization via optimal sizing and placement of shunt capacitor and distributed generator with network reconfiguration. Telkomnika. 2015;**19**:759-766. DOI: 10.12928/ telkomnika.v19i3.15223

[51] Abdelaziz AY, Ali ES, Abd Elazim SM. Optimal sizing and locations of capacitors in radial distribution systems via flower pollination optimization algorithm and power loss index modified cultural algorithm. International Journal of Advanced Research in Engineering

*Network Reconfiguration and Reactive Power Compensation Dispatch in Smart Distribution… DOI: http://dx.doi.org/10.5772/intechopen.102820*

and Technology (IJARET). 2016;**19**:610- 618. DOI: 10.1016/j.jestch.2015.09.002

[52] Selim A, Kamel S, Jurado F. Power losses and energy cost minimization using shunt capacitors installation in distribution systems. In: 2019 10th International Renewable Energy Congress (IREC 2019). London: IEEE; 2019. pp. 1-6. DOI: 10.1109/ IREC.2019.8754607

[53] Kamel S, Selim A, Jurado F, Yu J, Xie K, Wu T. Capacitor allocation in distribution systems using fuzzy loss sensitivity factor with sine cosine algorithm. IEEE PES Innovative Smart Grid Technologies Asia. 2019;**2019**:1276- 1281. DOI: 10.1109/ISGT-Asia.2019. 8881794

[54] William H. Kersting. Distribution System Modeling and Analysis. Second ed. Boca Raton, Florida, United States: CRC Press, Taylor & Francis Group; 2007. ISBN: 0-8493-5806-X

[55] Kleinberg MR, Miu K, Segal N, Lehmann H, Figura TR. A partitioning method for distributed capacitor control of electric power distribution systems. IEEETtransactions on Power Systems. 2014;**29**:637-644. DOI: 10.1109/ TPWRS.2013.2281764

[56] Mori H, Komatsu Y. A parallel meta-heuristic method for distribution network loss reduction with network reconfiguration and capacitor control. Transmission & Distribution Conference & Exposition: Asia and Pacific. 2009; **2009**:1-4. DOI: 10.1109/TD-ASIA.2009. 5356970

[57] Elkhatib ME, Shatshat RE, Salama MMA. Decentralized reactive power control for advanced distribution automation systems. IEEE Transactions on Smart Grid. 2012;**3**:1482-1490. DOI: 10.1109/TSG.2012.2197833

[58] Haldar V, Chakraborty N. Power loss minimization by optimal capacitor placement in radial distribution using modified cultural algorithm. International Transactions on Electrical Energy Systems. 2015;**25**:54-71. DOI: 10.1002/etep.1820

[59] Mahdavi M, Alhelou HH, Hatziargyriou ND, Jurado F. Reconfiguration of electric power distribution systems: Comprehensive review and classification. IEEE Access. 2021;**9**:118502-118527. DOI: 10.1109/ ACCESS.2021.3107475

[60] Tinney WF, Hart CE. Power flow solution by Newton's method. IEEE Transactions On Power Apparatus And Systems. 1967;**86**:1449-1460. DOI: 10.1109/TPAS.1967.291823

[61] Peschon J, Piercy DS, Tinney WF, Tveit OJ. Sensitivity in power systems. IEEE Transactions On Power Apparatus And Systems. 1967;**86**:1687-1696. DOI: 10.1109/TPAS.1968.292130

[62] Robin J. Wilson, Introduction to Graph Theory. Fourth ed. Edinburgh Gate, Harlow, Essex England: Addison Weley Longman Limited; 1996

[63] Rong Z, Xiyuan P, Jinliang H, Xinfu S. Reconfiguration and capacitor placement for loss reduction of distribution system. In: 2002 IEEE Region 10 Conference on Computers, Communications, Control and Power Engineering. TENCOM'02. Proceedings. Vol. 3. London: IEEE; 2002. pp. 1945-1949

### **Chapter 4**

## Advances and Prospects in Distributed Generation Sources Digital Twins Design

*Ivan Todorović and Ivana Isakov*

### **Abstract**

Power electronics devices are highly dynamic and nonlinear systems governed by complex control algorithms. In addition, power electronics converters must demonstrate high reliability and must be safe to operate, although in some applications they condition dangerously high power levels. Therefore, the development, evaluation and deployment of these systems traditionally had to be meticulously conducted, using specialized tools and approaches. With the proliferation of power electronics devices into the domain of power systems, in form of distributed generation sources, the mentioned tools and approaches had to evolve further. Consequently, a wide range of representations of the addressed systems within various digital platforms is nowadays at disposal of researchers and engineers. These representations, designated as digital twins, facilitate, and sometimes simply make possible, expeditious development and comprehensive evaluation of increasingly complex power electronics-based systems. This chapter catalogues the most important digital twin types, explicates their advantages and disadvantages and addresses their applicability. Hence, it could be regarded as a set of guidelines on how to choose appropriate digital twin type and digital twinning platform for some particular research and engineering problem. Also, details on how digital twins of distributed generation sources will be created and utilized in near future are provided.

**Keywords:** digital twin, hardware in the loop, real-time simulation, power system modeling, power hardware in the loop, cosimulation, distributed generation sources

### **1. Introduction**

The power electronics (PE) devices consist of semiconductor switches, some of which are controllable (transistors, thyristors, etc.), while some are uncontrollable (diodes). Since semiconductor switches themselves are nonlinear elements (voltage–current dependency of the switches is nonlinear), the resulting power converter is also a highly nonlinear device. Additionally, several important PE topologies consist of many semiconductor switches. Consequently, addressing the *hardware* of PE devices can be a difficult task.

On the other hand, since controllable semiconductor switches necessitate control algorithms to govern their operation, and with a goal to secure different types of efficient electric energy conditioning, i.e., conversion—from AC to DC, from DC to AC, etc., the PE converters require complex *software* structures to be implemented on dedicated microcontrollers. Moreover, as for other automated systems, here also all subsystems in a closed feedback loop must operate properly or device destruction can take place.

On system level, PE devices must demonstrate high levels of reliability since they are integral part in many critical systems (e.g. systems for electric energy production, electric vehicles) or because they are embedded in mass-produced devices (e.g. consumer electronics). They are also not easy to repair, and their failure leads to prolonged non-operation periods. Furthermore, strict safety standards must be satisfied before product commercialization, so that the safety of humans is not jeopardized even during catastrophic failures. Similarly, the operation of PE devices must not compromise the proper operation of other devices in their vicinity. This is especially difficult if a converter is used in high-power applications. Also, electromagnetic-interferences standards must be followed, which adds an additional layer of complexity to the PE design process.

Finally, the PE product development life cycle is affected by market dynamics and even PE devices must be designed and produced at an ever-increasing pace. In this context, seemingly the most meaningful trajectory from idea to an operational device is to synthesize a sketch of a device (hardware and software aspects) and immediately build a prototype. Every young engineer has tried this approach and has failed.

For these reasons, conceptualization, design, implementation, integration, and system verification of these multidomain devices must be conducted both systematically and rapidly [1]. While others depend mostly on the skill and experience of the developers and cannot be easily changed and improved, the system verification depends heavily on which tools are used and consequently can be done in a more or less optimized fashion.

The system verification should not be done on a prototype at the beginning of the product development process, as indicated previously, but rather at its end. Before that, verification of certain subsystems and features has to be conducted within safe and flexible environments. This is true for PE devices in general, but it is especially so for PE systems that are part of distributed generation sources (DGSs). In these systems, mistakes made during development processes are exceptionally expensive, time-consuming, and dangerous for equipment operators.

PE solutions' verification tools are numerous, but most of them are used to build a digital representation of the addressed system within a certain type of digital computer. Such representations are called either digital twins or simulation models, since they are built with simulation software. This migration of PE devices into the digital domain and usage of digital twins, although being an additional step, actually accelerate the development process. That is because conducting tests within software environments is completely safe, enables test automation, accelerates design errors identification and correction, allows for certain parts of the design or the whole design to be shared more easily among the researchers and engineers (facilitates cooperation), gives freedom to developers to risk more and try novel solutions, not worrying about making mistakes, etc. Hence, digital twinning has been an integral part of the development process of practically all PE device types, excluding only the simplest ones. Moreover, digital twinning has been in use essentially ever since

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

the rise of personal computers (PCs). Accordingly, there are many types of tools for digital twinning that have been developed over the years, each solving a specific set of design problems.

The following three sections give details on the three most important approaches for digital twin's generation and usage. The advantages and disadvantages of these approaches are given and when it is meaningful to use certain digital twinning tool is described. The digital twinning tools based on personal computers (offline simulation tools) are addressed in the second section. Those based on dedicated digital platforms (real-time simulation tools) are analyzed in the third section, while those considered emerging approaches are considered in the fourth section. The last section brings concluding remarks.

The following two statements should be noted. DGSs will be of particular interest in the remainder of the text because of their complexity and wide social, economic, and ecological importance. Still, most of the concepts and approaches provided in the text can be applied during the digital twinning processes of other power electronics devices. Also, models are never verbatim digital representations of physical systems, and some phenomena are always neglected or abstracted, but it is up to a developer to define how detailed the models will be.

### **2. Offline simulation platforms for DGSs digital twinning**

Ever since the inception of PE as a major electrical engineering field, it became obvious that it would be rather arduous to develop PE devices and examine their behavior analytically, particularly their transient behavior. The first platform that enabled accelerated development, especially the validation stage, was personal computers (PCs). Many simulation tools that could be used to build digital representations of DGSs and PE devices, in general, were developed during the eighties, quickly after personal computers became widely available. The fact that many of these tools are still in use today is a testimonial of their usefulness and efficacy.

Initially, to build a digital twin and use it as an investigative tool using the offline simulations approach, the researchers and engineers needed only a PC and a single software tool (simulation tool or engine). Nowadays, offline simulations can be conducted in a slightly more complicated way, but the PC, i.e., general-purpose device, is still the main platform.

Depending on what part of DGS is of particular interest and which operational domain of the device should be put under scrutiny, four main types of offline simulations can be used today:


Several simulation software can be used in either of these approaches, but the tool itself must be optimized and additionally set up, i.e., cannot be used interchangeably out of the box.

The noun before "in the loop" in the approaches' names generally (excluding MIL) designates which part of the system is modeled in more detail or which part of the system is a real device, i.e., device under test (DUT).

### **2.1 Model in the loop**

A digital twin of the addressed system always consists of digital representations of hardware (power stage) and software (control scheme) subsystems, correspondingly with real PE device. The power stage, or more precisely sensors' representations, provides the control scheme with the information about controlled variables, and the control scheme generates control signals for semiconductor and other active devices in the power stage. In the case of MIL, both power stage and control structures, governing the power stage, are implemented within the simulation tool using the blocks and elements that are native to the simulation tool. Hence, the digital twin consists only of the simulation model and the model is in the loop (is analyzed). The MIL approach corresponds to a traditional offline simulation. This environment consists of a PC with the installed simulation software, as indicated in **Figure 1**.

Since the power stage can be comprised of different PE devices, machines, power systems' parts, and electrochemical elements, the simulation tool must either have rich library elements or enable the user to develop his own parts using available blocks. Either way, a graphical user interface is used in modern simulation tools. This graphical representation is then compiled and run within the same software environment. The difference between the execution time, i.e., how much time is necessary for compilation and running of the model, and simulation time depends on model complexity and the PC performances. Since DGSs are complex, the execution time is significantly longer than simulation time (at least one order of magnitude). Once the execution is done, the developer can inspect the model's behavior and introduce changes if necessary.

Different simulation tools that enable the MIL approach focus on different aspects of DGSs. It is true that different software packages can be used to focus on more than one aspect of the DGSs, but they are usually optimized for one or maybe two layers of abstractions pertinent to DGSs. If semiconductor driver circuits, parasitic phenomena, and generally detailed simulation of solely PE devices (not the whole DGS) are necessary, the user can use several free (LTspice [2], Xyce [3]), and licensed (PSIM [4], PSpice [5], etc.) software tools. Alternatively, if the behavior of the complete DGS should be analyzed, the user again can choose between free (Typhoon HIL's VHIL [6]) and licensed (MATLAB/Simulink [7], PSIM, PLECS [8]) packages. Lastly, if the DGSs

**Figure 1.** *Offline simulation approach—Model in the loop.*

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

are to be integrated with the large power systems and jointly analyzed, users can employ several mature tools (PowerFactory [9], PSCAD [10], EMTP [11], etc.).

MIL approach was the first to be utilized to create DGSs digital twins and that pertinent simulation tools and have been in use for decades. From this stems the main advantage of MIL. MIL simulators have rich libraries, many readily available examples and developed user's communities. Consequently, it is both easy to start using these tools and to start new projects. Also, there are many plugins and add-ons that expand the software functionalities, albeit these additional features are not always free. Furthermore, MIL software is reliable. In addition, MIL in principle allows arbitrarily complex and detailed models to be implemented, at the price of slow model execution.

On the other hand, the MIL assumes utilization of PC—a general-purpose device that certainly is not optimized for running simulations software. In case when DGSs are analyzed, this results in long, sometimes impractical, execution times, especially if DGSs are integrated with a certain power system. Moreover, the MIL approach in many aspects gives crude information on how the real system is going to behave. If semiconductor phenomena are included in the model, for example, it becomes impractical to analyze wide power system dynamics. Alternatively, if large systems are analyzed, transient phenomena in PE devices are not captured properly. The most problematic aspect of MIL usage in this context is the estimation of how DGS control software will behave once deployed on the real device, i.e., microcontroller.

Consequently, the MIL approach is usually employed as the first stage in the DGS design verification process or when a singular feature is to be tested.

### **2.2 Software in the loop**

SIL approach is quite similar to the MIL approach. It is also based on a PC, and it consists of one software package, usually the same as in the case of MIL. The power stage can be the same in both cases. The same information is exchanged between the power stage and control scheme. Hence, it brings similar features, advantages, and disadvantages. Still, it has one crucial difference. As **Figure 2** suggests, the software is not implemented using the same elements that are used for building the hardware part of the digital twin.

The software is realized utilizing certain embedded language (usually C or C++) the same language that will be used to program the real microcontroller. Hence, SIL, besides providing a functional test of the control algorithm, enables the developer to gain insight into how the code is structured and organized, that is, it includes

semantic and syntactic checkups. Nowadays, embedded code compilers that must be invoked implicitly during model execution are available for most popular simulation packages [12].

### **2.3 Processor in the loop**

To investigate further control code features and behavior, the code developed in the simulation tool is not placed in the PC's memory, but it is downloaded to a real controller that shall be used in the final design. This approach is called "processor in the loop" (PIL) since the processor of the real controller is used. The embedded code compilers are again called during model execution. There has to be a communication line established between the controller and offline simulator (PC), so that relevant information between the power stage and control structures is exchanged, as in the previous two cases. The power stage developed in the simulator is again the same, and the model is executed usually significantly slower than in real time, because of the simulated power stage complexity. This implies that the control code execution on the microcontroller has to be slowed down (otherwise it could be run in real time) so that it is synchronized with the model execution.

In addition to advantages and disadvantages inherited from the SIL approach, the PIL approach allows control card memory and processor-time utilization to be examined. It should be noted that not all control card hardware peripherals are utilized and tested—most notably, pulse width modulation peripheral and analogto-digital conversion unit are not put under test. Additionally, PIL has a bottleneck in the number of DGSs that can be modeled simultaneously. Since one communication channel can be formed between the offline simulator and the controller board, the real controller can drive only one DGS. Also, the toolboxes necessary to utilize PIL are not available for many controllers, but only for flagship models (**Figure 3**) [13].

### **2.4 Controller model in the loop**

Controlled code execution and controller board's resources utilization can be studied in even more detail. For that, comprehensive behavioral models of microcontrollers can be developed. Although the idea is not new, only recently several microcontrollers' vendors have developed these models and made them available for usage on PC [14]. It should be emphasized that the controller model is usually executed on software different from simulation software, and these two software packages must communicate

**Figure 3.** *Offline simulation approach—Processor in the loop.*

*Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

### **Figure 4.**

*Offline simulation approach—Controller model in the loop.*

and exchange relevant information between the power stage (simulation tool) and control scheme (software dedicated to the simulation of the controller behavioral model). Hence, the controller model in the loop approach assumes usage of only PC (without any external hardware), as MIL and SIL (**Figure 4**).

The feature of the controller model in the loop approach is that developers can see exactly how the controller and implemented control code are going to behave once deployed on the real controller—how the memory is going to be utilized, will there be computational overload, how the latency will affect the system operation, etc. Also, the code embedded in the simulated controller model can be immediately deployed on the real controller, without any changes.

This main novelty of this approach, in the context of DGSs, is its main drawback. CMIL puts focus on the controller and control code implementation. Moreover, as for PIL, the setup is essentially limited to one controller and one DGS.

### **3. Real-time simulation platforms for DGSs digital twinning**

The proliferation of renewable energy sources and DGSs into the traditional power systems during the beginning of the twentieth century brought new development challenges. This amalgamation of the two fairly different domains of electrical engineering challenged the existing development and validation tools. PE devices and DGSs necessitate small simulation time steps (high simulation resolution) to capture properly dynamic phenomena associated with these systems. The power systems are by themselves large and complex and developers used offline simulation tools that tackled this problem by increasing simulation time steps—which was acceptable since all relevant phenomena in traditional power systems were characterized by long time constants. This translated to the possibility of setting essentially arbitrarily long simulation time when simulating power systems. Hence, to address properly these emerging systems, both small simulation time steps and long simulation times were necessary. This predicament was exacerbated further by the fact that tests had to be repeatedly conducted (considering different operating points, networks configurations, control functions, etc.). Consequently, the usage of traditional offline simulation tools for modeling power systems integrated with DGSs became impractical.

The main impediment was the platforms used to conduct traditional offline simulations—PCs. To enable more efficient and practical validation of DGSs integrated with power systems, new, dedicated, digital platforms had to be developed.

The first efforts went in the direction of paralleling many conventional processors [15]. Although this gave certain improvements (systems that are more complex indeed could have been addressed), the scalability, firmware complexity, and maintenance of such systems were impractical for commercial products.

The paradigmatic change happened with the introduction of field-programmable gate arrays (FPGA) platforms in the domain of DGSs simulations. They provide parallel computations and consequently enable a significant decrease in models' time execution.

Actually, not only that complex models' execution was accelerated, it became possible to run models in real time. Besides accelerating validation procedure, the usage of FPGA-based platforms enabled interaction of real-time executed models and real devices, in which cases the real device was a device under test (DUT), and the model was used to mimic sophisticated operating conditions, often found in power systems rich with DGSs.

Consequently, two real-time simulation approaches emerged:


Both approaches are based on real-time simulators (RTSs). RTSs are interfaced with either microcontroller running designed control schemes or with certain high power devices (e.g., inverter).

### **3.1 Controller hardware in the loop**

The most comprehensive microcontroller and control schemes operation analysis can be conducted using the C-HIL approach, especially if distribution networks or microgrids with many DGSs are considered. The real controllers, with control code that will be deployed in the field to drive DGSs, are used, and their interaction with the rest of the system can be examined considering phenomena pertinent to networks proliferated with DGSs. How precise are the test results depends only on how precise are the power stage models. It should be emphasized that the models' complexity, precision, and level of details are as good as in the case of offline simulator approaches, if not better. The power stage complexity does influence the simulation time steps, but modern RTS enables sub-1 μs time steps, even for complex power stages, which is sufficiently small for DGSs applications. Alternatively, C-HIL can be used to test the interaction of one converter and its surrounding subsystems (e.g., grid-connected converter with stiff grid, electric vehicle, etc.). Finally, this environment can be used to test the operation of the singular converter, such as an inverter in machine-driven applications. In other words, the same C-HIL platform can be used to analyze PE systems of almost arbitrary complexity.

Still, it should be said that the C-HIL is usually not intended to be used for testing semiconductor-devices-related phenomena, although there are no technical obstacles [16]. Actually, semiconductor devices are oftentimes modeled as ideal switches. The semiconductor-devices-related phenomena can be more meaningfully addressed using the MIL approach, utilizing free MIL software.

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

The C-HIL environment consists of real-time simulators, interface boards, and controllers. The outline of the C-HIL platform is given in **Figure 5a**. The RTSs are often denoted as emulators, as they emulate the behavior of certain power stages. The complexity of the power stage can range between singular and simple DC-DC converter (e.g., buck converter) to a distribution network of a small town with many DGSs included.

The power stages are defined on PC, using dedicated software, compiled and downloaded on emulators. Although emulators themselves are rather complex digital systems, their complexity and complexity of power stages are usually hidden from the user behind IO boards.

The interface board (IB in **Figure 5**) is used to adjust analog and digital signals exchanged between the emulator and the controller. The emulator sends analog signals that should be analogous to the signals that would be generated by the real sensors in the real power stage (currents, voltages, machine speed, etc.). These signals are adjusted using ordinary operational amplifiers circuits (AMP in **Figure 5a**). Then they are forwarded to the controller's analog inputs and analog-to-digital conversion units. This information about relevant power stage variables is used in the controller to synthesize new control and gating signals. Accordingly, the controller generates

digital, gating, signals for the converters' switches, found in the power stage. These signals are also adjusted using level shifters (LSH in **Figure 5a**). Then these signals are sent to the RTS's digital inputs. There, they result in turning on and off certain switches, resulting in circuit reconfiguration and adequate change in controlled variables. Hence, the feedback loop is closed. Analog and digital signals can be exchanged in the reversed fashion also, but those signal pathways are of secondary importance in most of the DGSs-related applications. Since operational amplifiers and level shifter circuits are simple, the whole interface boards are simple electronics circuits and can be quickly developed for any controller board.

Controller boards used in C-HIL, which is a DUT in this setup, can be arbitrarily chosen with the only limitation that they must have sufficient resources to run the control code that should secure necessary DGS's features.

The C-HIL setups enable the creation of comprehensive DGS' digital twins and high-fidelity testing procedures. The users are provided with reliable control code behavior testing results, without compromising either the equipment nor personnel. The fact that no high power devices are used makes this environment perfectly safe and equipment management is done without procedural hurdles. Since real-time tests execution is secured, the tests execution is significantly accelerated, in comparison to offline simulation approaches. Actually, if it was not for controller boards, the test could be done even faster than in real-time—the RTSs are sufficiently quick, but are "slowed down" so that they can be meaningfully interfaced with controller boards. Moreover, considering that both power stage and control code are run in a form of code on a specific platform (RTS for power stage and controller boards for control code), test automation is possible [17]. Complete testing procedures (with different operating points, control codes, network parameters, etc.) can be executed consecutively and with minimal personnel effort by running simple scripts, usually written using python. Finally, nowadays, the RTSs are affordable, and their price is comparable with MIL or SIL software licenses.

The only disadvantage of C-HIL usage to build DGSs digital twins and run tests on them is that it is not possible to examine the operation of high-power hardware components.

### **3.2 Power hardware in the loop**

P-HIL setup was proposed to address the shortcoming of the C-HIL approach—as an environment in which certain high-power devices can be tested in conjunction with an adequate digital twin. DUT can be anything from a simple protection device to a multilevel converter.

These setups could be meaningfully deployed in several situations. Firstly, in complex PE and DGSs systems, the system's parts are developed at different instances. Hence, to manage efficiently development and verification time, the functional subsystems can be tested before the whole setup is ready for integration and verification. Similarly, it is generally advisable to test parts of a complex system before operating on the complete system, since this facilitates design mistakes identification and decreases the possibility of catastrophic failures occurring during final tests. In these cases, the P-HIL can mimic the behavior of the still-to-beimplemented part of the addressed system. Secondly, when addressing high-power devices, the P-HIL environment is advantageous since it can be safer for verification than standard full-power prototypes—prompt termination of dangerous and faulty tests is inherently easier in a P-HIL setup. Thirdly, if the behavior of DGS's hardware

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

should be investigated against complex network conditions (e.g. protection device of a grid-connected converter in microgrids), the P-HIL is irreplaceable since tests on real networks would be either impossible or expensive and dangerous for both equipment and personnel.

The P-HIL platforms, depicted in **Figure 5b**, are conceptually similar to C-HIL counterparts, but have some specificities also. The RTS part of the setup can be the same emulator unit as in the C-HIL setup, but the model realized in the RTS is generally either passive network or active network with simplified (averaged) models of DGSs, since there are no controller boards controlling the DGSs' operation.

The interface cards are in this case significantly different. This is a consequence of the fact that DUT is a high-power device. Hence, to connect and exchange relevant data between the RTS and DUT, the interface board must contain, besides ordinary operational amplifiers circuits and digital-to-analog conversion units (DAC in **Figure 5b**), high-power amplification circuits (AMP in **Figure 5b**). AMP in **Figure 5a** and AMP in **Figure 5b** are not the same circuits. High-power amplification circuits are rather complex devices and can be based on switching amplifiers, linear amplifiers, synchronous machines, or multilevel converters [18]. It is evident that the amplification circuits can be as complex as DUT itself, and they are only a part of the interface board. Moreover, high-power amplification units inherently introduce signal propagation bandwidth limitation and latency. This can compromise experiments' precision and reliability and can cause stability issues. Mitigation of these issues is a topic of ongoing investigations [19]. The interface board, besides generating high power variables (currents, voltages, and mechanical variables), must adjust analog variables coming from DUT toward the RTS. For this, sensors and analog-to-digital conversion circuits must be implemented. This complicates the interface board further.

The power hardware, i.e., DUT, can be any piece of hardware pertaining to PE or DGS device whose operational characteristic shall be examined.

Consequently, the P-HIL offers a comprehensive analysis of how certain real pieces of hardware will behave once deployed in the field. It is a relatively safe environment, but since it does consist of high-power devices, the flexibility and ease of use of P-HIL are decreased in comparison to C-HIL setups. Moreover, interface boards' complexity limits to some extent the commercial attractiveness of P-HIL setups. Finally, although P-HIL setups are based on emulators and are easily reconfigurable, testing automation cannot be fully realized, and some manual interventions must be made during different experiments being executed consecutively.

### **4. Emerging platforms for DGSs digital twinning**

The C-HIL and P-HIL environments were until recently sufficient to meet all the digital twinning needs of engineers and researchers in the domain of DGSs. Several niches, but important, research and public sphere incentives have resulted in the development of advanced platforms for digital twinning. They are all based on C-HIL and P-HIL devices, but are conceptually somewhat different and bring several new features.

Currently, the following types of advanced digital twinning platforms are developed:


### **4.1 Cosimulation platforms**

The first cosimulation platform version is intended for the emulation of large power systems. MC-HILs consists of multiple interconnected hardware in the loop, i.e., RTS units. The RTS units usually are from the same vendor, but they can be from different suppliers, so that the advantages of different units can be put into practice. Moreover, the microcontroller units can be different if serving different purposes. For example, if microgrids with many DGSs are addressed and if both low-level and high-level control structures are implemented, such setup would be rather convenient. This cosimulation type is depicted in **Figure 6a**. It essentially brings the same advantages and disadvantages that the C-HIL approach brings. The only differences stem from the fact that large systems can be addressed and that the setup itself is more complex and consequently somewhat harder to manage. Still, since there are no high-power devices, MC-HILs setups are versatile and easily reconfigurable.

Modern RTSs consist of both the FPGA platform (used for power stage emulation) and digital signal processing, i.e., microcontroller-like, part. The latter can be used to implement different control functions, ranging from simple network reconfiguration functions to low-level, time-critical, PE-related control structures. Hence, the control algorithms that were.

previously implemented on the dedicated controller cards are now implemented on the same unit as emulated power stage—no external controller cards are necessary. The HILs setup is shown in **Figure 6b**. A mixture of MC-HILs and HILs setups can be used, also (control structures can be implemented both on dedicated controllers and the emulators).

The HILs configuration has a disadvantage in that the control code is not run on the separated controllers, and consequently the control code execution and the controller cannot be directly validated. Still, if this is not of primary interest, but rather an acceleration of control structures development and validation, particularly in the

**Figure 6.** *Cosimulation platforms—MC-HILs (a), HILs (b).*

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

context of large power systems, ease of use and environment's management simplicity render HILs a most meaningful platform in this regard.

The third cosimulation platform is a composite of C-HIL and P-HIL approaches. The representation of CP-HILs setups can be found in **Figure 7**. Such a framework could find application in cases when grid-connected inverter's hardware and software should be tested against realistic active grid operating conditions, for example. To test inverters' parallel operation, several inverters can be emulated on the RTS and driven by the dedicated controllers, while DUT would be connected to the same virtual point of common coupling. Such tests are as close as possible to tests executed on real, complete setup, whereas a test in real operating conditions would be unacceptably expensive, dangerous, and impractical, especially during the validation phase and particularly at high-power levels.

**Figure 7.** *Cosimulation platforms—CP-HILs.*

Since CP-HILs' environment consists of all parts and devices found both in C-HIL and P-HIL paradigms, CP-HILs inherit all advantages and disadvantages of those two approaches, but are also much more complicated to manage, especially if several different RTSs and controllers are used. Furthermore, CP-HILs setups tend to be expensive.

The fourth cosimulation concept represents an aggregation of geographically dispersed C-HIL, P-HIL, and CP-HILs systems. The setups are connected over a dedicated Internet connection, and the emulation data are exchanged over this connection so that the cumulative platforms' emulation data can be synthesized. Expectedly, the necessity of transferring data over large distances results in significant data latency. Hence, if the whole model is to be executed at the same time step, the step time must be significantly larger in comparison to one in the C-HIL approach. This problem can be somewhat mitigated if the model is partitioned in accordance with the geographical arrangement and different parts are executed at different time steps (or generally in a nonsynchronized manner). Then the latency would affect, i.e., artificially increase "data sampling" period of only those variables that are exchanged between the setups—the rest of the model's parts could be executed at a much faster pace, in compliance with local setups capabilities. If slowly changing variables are chosen, the data latency does not affect significantly model execution and the reliability and validity of the results.

The first meaningful situation for Geo-CP-HILs setup usage is when the most complicated models should be emulated and one C-HIL, P-HIL or CP-HILs setup would not suffice. Next, Geo-CP-HILs platforms are used when interested parties want to conduct joint tests, but the data privacy must be secured. In these setups, the parts of the model are not necessarily known and available to all parties conducting the tests. Only the exchanged data, found at the model's parts intersections, are available to more than one test participant (this can also be limited to two test participants). This is the case when power grids to be emulated cover multiple countries, or otherwise administratively, politically, or socially separated territories and entities that want to preserve the security of sensitive power system data. Moreover, Geo-CP-HILs are used when complex models should be merged and multiple model implementations are to be evaded. Only one test's participant implements a model only once and afterward shares it with other participants. This is particularly important if the participants are using different platforms—the porting of the model then would be particularly difficult. Establishing Geo-CP-HILs setups can be financially meaningful when the setup usage time can be sold to other parties, as in time-sharing financial constructs.

There evidently are applications in which these frameworks would be applicable. Actually, Geo-CP-HILs indeed are the universal digital twinning platform, but considering **Figure 8**, it becomes obvious that Geo-CP-HILs systems are extremely complex, hard to manage, and difficult to constitute. Consequently, only a handful of such setups can be found worldwide [20, 21].

### **4.2 Cloud emulation and simulation platforms**

At the beginning of the third decade of the twenty-first century, the technical and technological problems are not the biggest obstacles for wide DGSs' adoption in residential and industrial areas, but also generally in distribution and transmission networks. Software and hardware technologies pertinent to DGSs, excluding those applied to islanded microgrids, are mature and only incremental advancements are necessary. One of the biggest hurdles impeding further proliferation and "crossing the chasm" of the DGSs is related to how the general public *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

### **Figure 8.** *Cosimulation platforms—Geo-CP-HILs.*

perceives traditional grids and DGSs. The networks as they are operate reliably and efficiently and average resident and industrial entities are accustomed to how networks function. Moreover, DGSs are not technologies about which the average citizen is particularly knowledgeable. Hence, it may seem questionable why changing something that works well from the user standpoint. Especially since it should be replaced with a complex paradigm under which expensive renewable resources are used, energy storage systems are desirable, where third parties manage new assets so that they are (more) economically feasible and so that the system operates reliably.

The users must be provided with the best possible and palpable proof that the investment will be profitable and that the system will be reliable and safe. In order words, the investment in DGSs must be derisked.

For such tasks, the C-HIL platforms seem reasonable and promising. Using the C-HIL paradigm, comprehensive digital twins of the networks that should be upgraded with the DGSs can be made. Moreover, all control layers that will be deployed in a real network can be executed on a C-HIL setup. Consequently, using historical data (for solar irradiation, wind speed, load profiles, etc.) and other pertinent data within C-HIL digital twins, it becomes possible to quickly execute all kinds of technoeconomic studies. Such studies are the next best thing to data obtained from the real operating power system.

Still, the C-HIL setups are not as affordable so that they can be bought anytime certain party necessitates a power system case study. Moreover, they are intended to be operated by professionals.

Therefore, cloud emulation and cloud simulation platforms are being developed [22]. The primary objective is to "hide" the emulation and simulation tools behind the cloud services and enable electrical engineers, engineers from other engineering trades and non-engineering personnel to conduct tests. These platforms will provide automatic model generation (in accordance with data provided by users), compilation and execution of the models. Hence, the user will just have to provide the data defining the model, network topology, DGS installed power, historical data, etc., and will get the testing reports automatically. Consequently, cloud emulation and simulation platforms will act as black boxes for C-HIL or HILs setups from the user standpoint. It is important to note that third-party services, such as financial and energy-trading platforms, will be able to access the emulation and simulation tools.

There are two types of cloud services developed—cloud emulation and cloud simulation services.

**Figure 9.** *Cloud emulation (a) and cloud simulation (b) platforms.*

### *Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

The cloud emulation platforms are based on RTSs, i.e., C-HIL or HILs setups, and inherit their performance characteristics. The outline of this paradigm is shown in **Figure 9a**. Once again, an external controller can be used, as in C-HIL, but certain RTSs have sufficiently large resources to run in real-time control code also and thus eliminate the need for dedicated controllers. In the domain of cloud services, it is irrelevant what will be the control code implementation platform. This enables further improvement. Namely, since both power stage and control code are run (more precisely designed, compiled, and run) on the same platform, there are no technical obstacles why both parts of the digital twin would not be run even faster than real time. The state-of-the-art RTSs enable up to two times faster than real-time models execution for medium complexity models, such as a network with 10 nodes and an equal number of DGSs. For more complex and larger models, the acceleration is naturally smaller, and vice versa. It should be emphasized that the RTSs, and hence cloud emulation services, can be used to examine even transient phenomena (phenomena with time constants smaller than 1 ms).

Alternatively, if transient phenomena are not of importance, but steady-state and averaged network behavior, the digital twin can be created using simplified network and DGSs elements. This is suitable for implementation using simulation tools on PC or server devices. This organization is designated as cloud simulation platform. It is conceptually depicted in **Figure 9b**. Since the digital twin is simpler than the digital twin implemented on emulation platforms, the execution time is significantly shorter. Depending on the network size, the execution time can be more than a thousand times shorter than the real time. This enables simulation of one year of network's operation within one day or less.

Once completely functional, cloud emulation and simulation platforms will become an irreplaceable tool for emerging power systems operation examination and derisking.

### **5. Conclusion**

The power electronics, distributed generation sources, and power systems research and development processes are layered and complex, and there are a plethora of different tools that can be used to help engineers and researchers carry out their activities. Consequently, even the terminology can be confusing at times, and it is not always transparent which tools should be used during different development and validation phases for different applications.

This chapter gives an overview of platforms and paradigms that can be employed to create and utilize digital twins pertaining to mentioned systems. How digital twinning platforms are constituted and what are their main advantages and disadvantages is explicated. Also, details regarding the area of applicability are provided.

The chapter addresses traditional digital twinning platforms (model in the loop, software in the loop, etc.), real-time platforms (controller hardware in the loop and power hardware in the loop), and emerging platforms for simulation and emulation of advanced power systems proliferated with distributed generation sources.

### **Funding**

The research was funded by "Innovative scientific and artistic research from the FTS activity domain 451-03-9/2021-14/200156" project, financed by Serbian Ministry of Education, Science and Technological Development.

The authors would like to thank the European Commission and the partners of the European Horizon 2020 "CREATORS—CREATing cOmmunity eneRgy Systems" (https://www.creators4you.energy/) for their help and support. The CREATORS project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 957815.

### **Conflict of interest**

The authors declare no conflict of interest.

### **Author details**

Ivan Todorović\* and Ivana Isakov Faculty of Technical Sciences, University of Novi Sad, Novi Sad, Serbia

\*Address all correspondence to: ivan.todorovic@uns.ac.rs

© 2022 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

*Advances and Prospects in Distributed Generation Sources Digital Twins Design DOI: http://dx.doi.org/10.5772/intechopen.102703*

### **References**

[1] V-Model. Available from: https:// en.wikipedia.org/wiki/V-Model

[2] Analog Devices. LTspice. Available from: https://www.analog.com/en/ design-center/design-tools-andcalculators/ltspice-simulator.html

[3] Sandia National Laboratories. Xyce. Available from: https://xyce. sandia.gov/

[4] POWERSIM. PSIM. Available from: https://powersimtech.com/products/ psim/capabilities-applications/

[5] Cadence PCB solutions. PSpice. Available from: https://www.pspice.com/ solutions-and-technologies

[6] Typhoon HIL. VHIL. Available from: https://www.typhoon-hil.com/products/ virtual-hil-device/

[7] Matlab/Simulink. Available from: https://www.mathworks.com/products/ matlab-coder.html".

[8] Plexim. PLECS. Available from: https://www.plexim.com/products/ plecs

[9] DIgSILENT. PowerFactory. Available from: https://www.digsilent.de/en/ powerfactory.html

[10] PSCAD. PSCAD. Available from: https://www.pscad.com/

[11] EMTP. EMTP. Available from: https://www.emtp.com/products/emtp

[12] MathWorks. C compilers for Matlab. Available from: https://www.mathworks. com/support/requirements/supportedcompilers.html

[13] Infineon. Infineon PIL. Available from: https://www.mathworks.com/ products/connections/product\_detail/ infineon-tricore-microcontrollers.html

[14] Infineon. Virtualizer Development Kit. Available from: https://www.infineon.com/ cms/en/product/promopages/ virtualizer-development-kit/

[15] Opal-RT. ARTEMiS. Available from: https://www.opal-rt.com/solver/

[16] S. N. L. Typhoon HIL. VHIL-Xyce integration. Available from: https:// www.typhoon-hil.com/products/ xyce-integration/

[17] Typhoon HIL. HIL and Python scripting. Available from: https://www. typhoon-hil.com/documentation/ typhoon-hil-software-manual/concepts/ script\_editor.html

[18] Edrington CS, Steurer M, Langston J, El-Mezyani T, Schoder K. Role of power hardware in the loop in modeling and simulation for experimentation in power and energy systems. Proceedings of the IEEE. 2015;**103**(12):2401-2409. DOI: 10.1109/JPROC.2015.2460676

[19] Feng Z, Peña Alzola R, Seisopoulos P, Guillo Sansano E, Syed MH, Norman P, et al. A scheme to improve the stability and accuracy of power hardware-inthe-loop simulation. In: IECON 2020 the 46th Annual Conference of the IEEE Industrial Electronics Society, Singapore, Singapore, 18/10/20. Piscataway, N.J.: IEEE; 2020. pp. 5027-5032. DOI: 10.1109/ IECON43393.2020.9254407

[20] Essakiappan S et al. A multi-site networked hardware-in-the-loop

platform for evaluation of interoperability and distributed intelligence at grid-edge. IEEE Open Access Journal of Power and Energy. 2021;**8**:460-471. DOI: 10.1109/ OAJPE.2021.3103496

[21] Available from: http://www. eric-lab.eu/

[22] Available from: https://www. creators4you.energy/

## Section 3
