Integration of algorithmic and heuristic techniques for reactive power compensation in smart microgrids

. The paper characterizes the issues related to compensation of reactive power measures, which protect the smart microgrids from the loss of voltage stability. Slower forms of voltage instability are analyzed with power distribution simulations. The simulations represent the behavior of the system after preset shutdowns; P-U and Q-U charts are drawn to assess the voltage stability reserve in the given time. The purpose of the compensation is to decrease the reactive power transmission and the losses on the smart grid related to this power. This most often translates into introduction of new sources to achieve the established goal. This paper explains the algorithm for optimization of artificial measures of reactive power compensation with the use of decision trees, which are the primary method of induction education of machines due to their high effectiveness and the capability of a simple programming implementation.


Introduction
The proper management of reactive power distribution is a priority task of the operators of distribution systems due to the national energy security demands [1]. The purpose of compensation is usually to decrease reactive power transmissions and thus mitigating the transmission loses in the grid. This most often translates into the introduction of new sources (capacitor banks) to the grid/system to achieve the established goal. Consumers (loads in the form of reactors) of reactive power are not installed so often. It is the so-called artificial compensation of reactive power. In specific actual grid cases, at least some part of the effects obtained through artificial compensation of reactive power can be naturally created by the following: selection of the appropriate network system, proper usage of charging power (e.g. cables), use (control) of reactive power of synchronous machines (generators and motors). One special type of reactive power compensation is the follow-up compensation performed by non-linear consumers (e.g. steel works). The compensation of reactive power, including the installation of new sources (loads) and power control of all reactive power sources in the microgrid is performed as regulated by operating instructions and numerous papers. The methods defined in these documents allow determining the losses of power and energy, as well as the costs of power transmission over the grid before and after compensation. The actual mirogrid is complex, multinode and multi-voltage, hence the power losses depend on numerous factors: ˗ the network systems in use and the parameters of its elements; ˗ the transmitted active and reactive powers; ˗ the voltage levels maintained; ˗ the transformer voltage ratio regulation. This paper discusses an algorithm for optimization of artificial measures of reactive power compensation, which uses induction algorithms -decision trees [1]. The decision trees are the basic method of induction education of machines, which is due to the high effectiveness of this method and the capability of a simple programming implementation. This method of knowledge acquisition consists in an analysis of examples, where each example needs to be defined by a set of attributes and where each attribute can have different values. Knowledge discovery in databases is a process of discovery of new correlations, patterns and trends based on large data volumes stored in repositories; the process uses pattern recognition technologies. The critical stage of this process is data mining and the use of a proper algorithm to find the dependences and sequences in the prepared data set. The technique described here allows discovery of weak nodes in all possible microgrid configuration and grouping them in the so-called VCAs (Voltage Control Areas) on the basis of significant similarities in the post-contingency states [3].

Determination of Voltage Stability Reserve in Microgrid
In references concerning the subject being discussed [4,5], certain global trends can be identified regarding the determination of reactive power reserves and safe limits of node voltages in terms of voltage stability: ˗ the reactive power reserves and the permissible voltage limits are determined mainly to ensure safe performance of electrical power systems; ˗ the purpose of the reactive power reserve control in system management is to prevent voltage avalanches and to maintain the voltage changes in safe ranges; ˗ the main difficulties in modelling of electric power systems in relation to the subject under discussion apply to modelling of loads (consumers), which is why a conservative hypothesis on constant node power values is usually adopted.
The majority of electrical power systems of the world features systematic analyses of microgrid voltage stability by using power distribution software or programs for voltage optimization and reactive power distribution, as well as specialist stability testing software products. The analyses are performed annually, monthly, weekly and daily for a microgrid [11,12,14]. They use exact models of microgrid systems and less precise models of low voltage networks (where only those parts of distribution systems are modelled which have a significant impact on voltage changes. In most electrical power systems, generators are modelled with power unit transformers. The permissible operating point of a generator is determined for the operation requirements and based on the actual voltage value U on terminals and the active power P being generated; the determination method uses the formulas (1-3), whereas under normal operating conditions, the permissible operating point of the generator must account for the limitations due to the maximum permissible voltage on terminals. In the case of voltage stability investigations, especially for the operational control of a microgrid, it is recommended to model the generator more precisely [13,15,16].
The permissible reactive power value of the generator is not only conditioned by the permissible values of the stator winding current I max and of the rotor winding current i fmax , but also by the actual active power P and the bus voltage U. E max is the maximum emf value of the rotor, which corresponds to the maximum rotor winding current i fmax . If X d = X q , i.e. E q = e q , the permissible reactive power of the generator is calculated with the following dependency: where: U is the actual voltage (rms) on generator terminals; E qmax is the maximum emf value of the rotor, corresponds to the permissible rotor i fmax ; P is the present active power output of the generator.
The generator reactive power must respect the limitations which result from the permissible stator current value: Hence the permissible value of the power output from the generator to the microgrid must be the smaller of the two maximum values: In the short-term planning stage, the limits used are in the form of constant power values (Q max and Q min ), irrespective of the generator operating point defined by the power distribution. It is a conservative hypothesis which implies an additional, hidden voltage reserve which protects against a voltage collapse. The capacitor banks, including those with mechanical switching devices, and reactors should be modelled with respect to the relation of their power to the voltage square.
where: B is the shunt susceptance of the capacitor.

Reactive Power Compensation Measures
There are different ways to determine the reactive power reserves in the planning process. In most electrical power systems, a safe reactive power reserve is defined as the distance from the base operating point to the voltage avalanche point. The statistical analysis construes the voltage collapse point (VCP) as the point in which the convergence of the iteration process in the power distribution program ( Fig. 1) is lost after a small increase in the power of loads. Voltage collapse point can be traced from the current operating point (or base case) through repeated power flow solutions by increasing the load demand until the solution does not converge. The step-size for load increase is pivotal in getting an accurate "prediction" or "estimate" of the critical load. In the literature, theoretical point of losing voltage stability of a microgrid is commonly understood as the loss of convergence of an iterative process of solving node equations. This is a point in which two solutions close to zero converge, i.e. a determinant of the Jacobian matrix is close to zero. The point of voltage stability loss has a theoretical significance, as it corresponds with values of node voltages close to 0.8U n . In practice, the microgrid in which node voltages have values close to 0.8U n is not able to keep voltage stability.

Main contributing factors
Voltage stability is a problem associated with transfer of P and Q through a highly inductive network. There are six main contributing factors (key system attributes): ˗ Bus voltages; ˗ Interface active and reactive flows; ˗ Interface active and reactive losses; ˗ Reactive reserve for generator groups; ˗ Area active and reactive load, generation, reactive reserve, capacitors; ˗ Active and reactive bus through-flow.

Overall CVCAS Determination Procedures
The original contribution of the paper is to investigate and devise a methodology for identifying areas in smart microgrid that are prone to voltage instability (CVCA's) under particular operating conditions and contingencies (which were suitable for the planning environment) and to extend this concepts to be suitable for use in the online (operational) environment using an intelligent system framework -techniques such as decision trees, to predict the CVCAs and required reactive reserves from a given system condition without full computation. This is the justification for exploring the use of intelligent systems for use in on-line Dynamic Security Assessment (DSA) systems.
The proposed approach is based on a P-V curve method combined with modal analysis MA [7] and Decision Trees DTs [1,9]. The general approach is as follows: − a system operating space is defined based on a wide range of system load conditions, dispatch conditions, transactions (transfer scenarios) and contingencies; − using P-V curve methods, the system is pushed through every condition, under all contingencies until the voltage instability point (and hence stability margin) is found for each condition; − at the nose of P-V (i.e. instability) for each case perform MA to determine the critical mode of collapse as defined by a set of bus participation factors corresponding to the zero eigenvalue. This gives a CVCA for each condition studied; − the results of the MA are placed in a database for analysis. A clustering algorithm is used to compare bus participation factors for each case and group buses based on similarity in cases. This produces system CVCAs; − for each case, generator participation factors used to identify CVCA controlling generators; − the total reactive reserve requirements for each CVCA is determined from P-V analysis results; − The allocation of the required reactive reserve requirements amongst the controlling generators is determined using linear programming. The general approach is as follows: − identify CVCAs in a power system from a given online system snapshot using DTs and develop methods for predicting the required reserve; − The database developed above is extended to include different system attributes, i.e. system load and generation, power flows on the UHV lines, voltages at key system buses, generator status, etc.; − this database is populated with a large number of scenarios/contingencies. The information in the database is used to construct DTs (off-line) for each of the identified CVCAs using key system attributes; − in on-line application, the relevant attributes are extracted from a system snapshot (obtained in real time from PMUs), and dropped on DTs to determine which of the pre-determined (off-line) CVCAs exist in the present system condition. Similarly, the regression trees (RTs) is developed (off-line) to predict the required reactive power reserve in each CVCA; − a system snapshot obtained on-line (PMUs) can be dropped on each RTs corresponding the CVCAs that exist in the current system to determine the required reserve.
Online applications: − At this step, measurements from phasor measurement units (PMUs) are collected. It is assumed that the network is fully observable using PMUs measurements and state estimation [5]. Thus, the values of bus voltages, branches currents, and generators apparent powers are obtained continuously from PMUs measurements. Appling these measurements to the obtained DTs an online CVCA identification process is done, since classification process with a trained DT is so fast.

CVCAs identification algorithm
The following is a brief description of the proposed CVCAs identification algorithm. It is assumed that for a given contingency case, buses with high PFs including generator buses, form a CVCA. This suggests that each contingency case might produce its own VCA. In practice, however, large number of credible contingency cases generally will produce only a small number of CVCAs because several contingencies are usually related to the same CVCA.
The algorithm processes the sets of buses and generators corresponding to the PFs obtained from the MA for each system condition and contingency case. Then contingency cases are grouped together if their sets of bus PFs are similar. To carry out this contingency clustering process, first a 'base/seed' set of CVCA buses is selected. Then, all the other sets corresponding to different contingency cases are compared against this base set to determine if they are similar. Contingencies are clustered if their sets of bus PFs are similar. Finally, the algorithm identifies the sets of buses and generators that are common to all contingencies of each cluster. Those sets of buses and generators form the CVCAs of the power system.
Since each contingency case is unique, a better approach to select the set for further analysis (SFA) buses is to base it on the characteristics of each contingency. Generator terminal buses are PV type buses and thus are not included in the reduced Jacobian matrix (3). Therefore, PFs cannot be calculated for a generator terminal bus until the generator exhausts its reactive reserves, which is marked as a PQ-limited (PQL) bus, and it becomes a PQ type bus. The number of PQL buses, characteristic for each contingency, determines the selection of SFA buses. The selection for SFA buses includes all generators PQL buses and a subset of buses with the highest PFs. The pseudo-code for this step is as follows: − Set PFs_threshold=PFs_T For each contingency case i: − Determine X i =number of generators at their limit in contingency case i; − Select the buses with PFs >= PFs_T; − Denote the selected buses as set SFA i ; − Include the corresponding X i generator buses, if any, into SFA i ; End A SFAi set consists of: − buses with PFs >= PFs_T, selected for analysis; − X i generator buses that have exhausted their reactive reserves. The PFs range of the buses selected for analysis is [PF max , PF min ], where PF max is always 1 since the list of buses includes the bus with the highest PFs. PF min , varies for each contingency cases. Based on computational experience PFs_T=0.7 is used.

Measure of similarity between sets
First the numbers of buses in the base sets SFAx as well as the SFAs sets for all cases are counted. Then the elements of set-i (SFAi) are compared with the elements of the base set SFAx. The number of common elements C is counted and compared with the similarity threshold T. If the number of common elements C is greater than the threshold T, then set-i and the base set are considered being similar. The similarity threshold T is set as a percentage of the number of elements of in the largest set (set-i or the base set). If all elements of the smaller set (base or set-i) are included in the larger set then those sets are considered being similar. The pseudo code for checking sets similarities is as follows: The factor φ represents a similarity threshold. This similarity threshold is used to compute the threshold for common elements (T). The value of T depends not only of φ but also in the number of elements in the largest set. If the number of common elements C is equal to or greater than T, then the two sets being compared are considered to be similar. Based on computational experience φ = 0.5 is used. That means that two sets are similar only if the number of common elements is equal to or greater than 50% the number of elements of the largest set.

Decision Tree Procedure for Determining CVCA Types
Just the database is obtained, DTs are then trained offline to obtain the CVCAs classifications for applications in the next step. In the data set used for DTs, one attribute is named target attribute or goal attribute representing decisions for classification, regression or prediction, and the others are candidate attributes (describing predecision conditions). Splitting criteria is a fundamental part of any algorithm that constructs a DTs from a dataset is the method in which it selects attributes at each node of the tree. It may be better to place certain attributes higher up the tree in order to produce a short tree. Entropy is a measure that enables to compare attributes with each other and then be able to decide to put ones that split the data more purely higher up the tree. The entropy S of a dataset p, with respect to one attribute, in this case the target attribute, with the following calculation: where: where p i is the proportion of instances in the dataset that take the i th value of the target attribute.
This probability measure gives us an indication of how uncertain we are about the data. A base 2 for log is used. This represents how many bits we would need to use in order to specify what the class (value of the target attribute) is of a random instance.
The approach (Fig. 2&3) to constructing decision trees usually involves using greedy heuristics, Entropy reduction (8), that can over-fit the training data and can lead to poor accuracy in future predictions. Essentially involves growing the tree from a dataset until all possible leaf nodes have been reached and then removing particular sub-trees. When a snapshot is taken from the real-time system, the full on-line engine is started as usual. In parallel, the snapshot is first formatted into a "new object" to contain the attributes used in the CVCAs Database (DB). Next, the DB is searched using a nearest neighbor routine to ensure that the new object is within the scope of the DB; if it is not, the DT path is not used and conventional DSA is used. The new object is then "dropped" on all the decision trees and the CVCAs that are present are indicted, virtually instantaneously, as a "Yes" or "No" outcome of each of the decision trees. As the full DSA solution completes for all contingencies, the CVCA database is grown by adding new calculation results and the CVCA identification process can be updated at anytime as needed. Similarly, the DTs database is appended with the new objects and outcomes, and new DTs can be built at anytime. This process is critical to ensure the system "learns" over time.

Case study
The test considers 12-node smart microgrid system with the nominal voltage of 110kV (five nodes, others are distributive nodes of medium voltage, Fig. 4). It cooperates with the stiff voltage system at the level of 220 kV. These loads have tgφ not larger than 0.4. Four local generators cover most active and reactive power demand. The remaining part is taken off from higher voltage. Generators operate with a block transformer directly at the voltage level of 110 kV. The system of parallel elements has been adopted. It enables to verify system behavior at shut-offs of parallel connections. Considered EPS includes 12 nodes (N), 12 lines (L) and 10 transformers (T).
The steady state of the test system (Table I) has been calculated in four iterations of the Newton-Raphson method. Low number of iterations and the lack of change in a sign of a determinant of the Jacobian matrix provides for local stability in set operating point. For a single contingency case, for instance, a generator that is ranked in second place might not be as effective in avoiding voltage instability as the generator ranked in the first place. In other words, reactive power reserves in the generator ranked second will not produce the same system improvement as if these reserves were allocated to the generator ranked first instead. A percontingency generator PF-normalization metric can measure how effective generators are. An example of how to normalized generators PFs follows. Consider the following contingencies cases and generators PFs.
PFs of PQL generators (generators that are at their reactive power limit):

Conclusions
A new method for online identification of weak areas in power system that are prone to voltage instability is introduced. It is based on the decision tree and online PMU. For a wide range of system conditions and contingencies, the technique can identify the buses in each CVCA and identify CVCAs which are common for a set of contingencies and/or conditions. In addition, the method identifies the generators which are critical to maintaining stability for a given CVCA. Voltage control areas describe the regions in a power system (microgrids) that under specific conditions are prone to voltage instability. Intelligent systems hold promise to improve Voltage Security Assessment speed, provide adaptive learning capabilities and offer the ability to identify key system parameters.