A Stochastic Model for Determining Static Stability Margins in Electric Power Systems

: This paper aims to develop a method for determining margins of static aperiodic stability for electric power systems equipped with distributed generation plants. To this end, we used generalized equations of limiting modes in a stochastic formulation. Computer simulation showed that the developed methodology can be used in solving problems of operational control of the modes of electric power systems. On the basis of the results obtained, we arrived at the following conclusions: the modiﬁed equations do not allow the iterative process to converge to a trivial solution and, therefore, they ensure high reliability of results when determining stability margins in a stochastic statement; a technique based on the introduction of an additional variable can be used to improve the convergence of computational processes when determining the stability margins in a deterministic statement; the parameters of the limiting modes obtained in the deterministic and stochastic formulations may signiﬁcantly differ; with an increase in the variance of the load graphs, the risk of stability violation signiﬁcantly increases; at the same time, the amount of the margin determined on the basis of the Euclidean norm remains overly optimistic; in the illustrative example, a signiﬁcant increase in the risk of stability violation takes place during planned and emergency shutdowns of the EPS elements.


Introduction
The design and operation of electric power systems (EPS) face problems of determining the limiting modes and margins of static aperiodic stability (SAS). Static stability is understood as the ability of the EPS to return to the steady state after small perturbations of the operating conditions, in which the changes in the parameters are very small compared to their average values. There are two types of static instability: aperiodic and dynamic. Static aperiodic stability is associated with a change in the active power balance in the EPS. Dynamic stability occurs when the automatic generator field regulators are set incorrectly. The first type of instability is associated with the appearance of positive real roots of the characteristic equation, and the second with the presence of complex roots with a positive real part.
The study in [1,2] develops the methods based on the equations of limiting modes proposed in [3,4]. In [5], the authors propose a non-iterative method to determine the SAS boundaries. The authors of [6] use power series to study the regions of existence of the EPS state. Reference [7] presents the results of the analysis of EPS states based on the tropical geometry of power balance equations over complex multipoles. The analysis of robust SAS is presented in [8]. Classical approaches to determining the static stability margins are given in [9,10]. Paper [11] presents the results of studies on stability margins in networks with DC lines. The research presented in [12] considers the stability margin problems for the networks with distributed generation. In [13], the authors focus on predicting the stability of electric power systems with a large share of wind generators.
In connection with the planned transition of the electric power industry to the technological platform of smart grids [14,15], which assumes a large-scale application of distributed generation (DG) plants [16,17], the formulated problems become relevant for power supply systems (PSS) since they determine the important factors associated with ensuring the required level of reliability [18].
Modern PSS tend to incorporate DG plants that use renewable energy sources, such as small-scale hydraulic power plants and wind farms that can be located at considerable distances from the consumption centers; at the same time, the margins of SAS are reducing, which has a significant effect on emergency control to ensure stability in post-emergency modes [18]. Therefore, the problem of building digital models for the operational determination of static stability margins in PSS with DG plants are of particular importance. One of the possible approaches to building such models is presented below. It is based on the equations of limiting modes [3] written in a stochastic formulation.
The analysis of SAS of electric power systems is carried out for the conditions of tuning automatic excitation regulators that eliminate the occurrence of self-swinging. The analysis procedure includes determination of the limiting modes, construction of the boundaries of the stability regions in the space of controlled parameters, and estimation of the SAS margin. The margin can be characterized by the roots of the characteristic equation based on finding the negative real root α i located closest to the imaginary axis [10]. The margin can be estimated using the Jacobian of the steady-state mode equations that coincides with the free term of the characteristic polynomial. The values of synchronizing capacities ∂P i ∂δ i can also be used as margin indicators.
It should be noted that most of the listed parameters are of little use for rationing of margins, since they characterize the PSS at the point of the mode under consideration. They are calculated using linearization of the system of equations, and the nonlinearity of power characteristics is not considered. Therefore, these indicators, borrowed from the theory of automatic control, do not find practical application due to the formality of estimates and insufficient clarity.
The articles published in 2020-2021 [19][20][21][22] consider the issues of static stability analysis and margin assessment in the framework of the intelligent control algorithms and active elements applied to increase SAS. For example, article [19] proposes improving the stability of multi-machine EPS by a static synchronous compensator controlled based on the ant colony algorithm. The study in [20] enhances the stability by creating an intelligent hybrid wind-solar farm as a static compensator. In [21], the problem of increasing SAS in a two-machine EPS is solved by using a fuel cell as a STATCOM. A real-time assessment of voltage stability in a large-scale EPS based on the spectrum estimation of the phasor measurement unit data is given in [22].
When determining the SAS margins, it is important to take into account the stochastic nature of changes in consumer loads, but the listed works do not address this issue.
The novelty of the results presented below is as follows: 1.
The stability margin is determined relying on the calculation of the limiting mode probability, which makes it possible to assess the risk of the planned measures to be taken to change the mode.

2.
The essential difference between the approach proposed below and the known methods for determining limiting modes is that the corresponding Jacobian matrix is nondegenerate at the solution point, which ensures reliable convergence of computational processes when calculating stability margins [3].

3.
Reliable result is provided and the iterative process does not converge to the point of a trivial solution corresponding to the initial steady state.
Of particular relevance is the development of a method to stochastically determine stability margins in the isolated power systems [23] involving renewable energy sources. Such systems can be established by applying a cyber-physical approach [24,25] based on the most advanced information and computer technologies, such as artificial intelligence, big data, the Internet of things, quantum computing, and others. However, the core of the virtual part of the cyber-physical power system should rely on digital models based on improved algorithms designed to solve traditional electric power problems, which include the determination of SAS margins as well.

Problem Statement
In the problems of operational control and determination of reliability of the EPS, as well as when choosing the control actions of emergency automation, high-speed highvalidity and reliability methods for assessing margins are required. The validity and reliability requirements are met by the SAS margin indicator that corresponds to the distance in the space of controlled parameters Y from the point Y 0 of the analyzed mode to the limiting hypersurface L W . Assessment of the SAS margin can be carried out using the vector Which contains margin coefficients with respect to parameters y i : noindent.
where y i0 , y iL are the values of the i-th parameter corresponding to the initial and limiting modes; k inorm are normative coefficients. The critical (most dangerous) direction of loading can be found by solving the following optimization problems: where X L is a vector of dependent variables at the points of the limit surface; Z is the margin value. Condition (1) does not fully characterize the closeness of the mode to the boundary L w , because it does not take into account changes in all variables y j included in the loading vector. The criterion defined by the Euclidean norm (2) does not have this shortcoming and corresponds to the shortest distance from point Y 0 to L w in space K.
Further development of methods for determining the SAS margins based on the search for the critical direction of load increase can be carried out using the stochastic approach described below.

Stochastic Approach to Determining the Stability Margin
The algorithm that implements the stochastic approach to determine the stability margins is based on a generalization of the equations of limiting modes [3].
Components of the vector Y that represent active and reactive powers of generators and loads are random variables. With irregular changes in these parameters, it is possible to reach the boundary L w ; in this case, reliable operation of the PSS will be ensured if the scattering hyperellipsoid ( Figure 1) [4] Computation 2022, 10, 67

of 15
With constraints in the form of the steady-state equations where F is a nonlinear vector function; Х is unregulated operating parameters, which are the magnitudes and phases of nodal voltages or their real and imaginary components. Figure 1. Determination of the margin of static aperiodic stability of electric power system in a stochastic statement.
To solve the problem of minimizing , build a Lagrange function where Λ is a vector of undefined factors.
The following conditions correspond to the minimum of L: With the center at the point MY does not have common points with the hypersurface L W . Here T is a covariance matrix; C L is a value that determines the probability of finding the parameters of Y inside the hyperellipsoid (3). The covariance matrix S participating in (3) can be found using known methods for assessing the state of the PSS [26]. The stochastic approach to assess the margin of SAS can be formulated as follows: Find With constraints in the form of the steady-state equations where F is a nonlinear vector function; X is unregulated operating parameters, which are the magnitudes and phases of nodal voltages or their real and imaginary components.
To solve the problem of minimizing C L , build a Lagrange function where Λ is a vector of undefined factors.
The following conditions correspond to the minimum of L: where ∂ F ∂ X is a Jacobian of the steady-state mode equations; ∂ F ∂ DY is a block diagonal matrix. It should be taken into consideration that Equation (4) has two solutions: The trivial solution corresponds to zero values of the vectors Hence, the nontrivial solution corresponds to the hypersurface of the limiting modes. Equation (4) can written as Introduce a change of variables Then, system (4) can be written in the following form From system (5), we can find a vector Substituting the resulting value of DY into the third equation, we can transform the system to the form: The results of computer simulation show that the iterative process for Equation (6) may converge to a trivial solution. To eliminate this, we can employ the following technique. In system (6), we introduce an additional equation, which corresponds to a nonzero length of the vector R, and a variable γ, which ensures the "balancing" of the first vector equation: A similar technique can be used to improve the efficiency of determining the stability margin in a deterministic statement [3].  (7) is nonlinear and can be solved only by iterative methods, for example, Newton's method. In this case, the following system of linear equations is solved at each interaction: where Γ i is Hessian matrix of function f 1 .
If the steady-state equations can have the form then the following equality is true where E is an identity matrix. Such a situation occurs when loads are specified by constant power take-offs.
With an implicit Y dependency of X and by using the Cartesian coordinate system, one can write where P i0 = P Gi0 − P Hi0 , Q i0 = Q Gi0 − Q Hi0 are active and reactive power injections at node i in the initial mode; P Gi0 , Q Gi0 are active and reactive powers of generators; P Hi0 , Q Hi0 are active and reactive powers of loads; U i , U i are real and imaginary components of nodal voltages; U Zi is a set magnitude of voltage at the i-th node; dP i , dQ i , DU Zi are components of vector DY; P Ci , Q Ci are power flows from node i to the network. To obtain ∂ F ∂ DY at an implicit X dependency of Y, steady-state conditions should be written in an expanded form: For generator nodes f 2i−1 (X, Y) = P Gi + DP Gi − (P Hi + DP Hi )h 1i − P Ci U 1 , U 1 , . . . U n , U n = 0; (8) For load nodes where DP Gi , DU Zi , DP Hi , DQ Hi are components of vector DY; a 0i ; a 1i ; a 2i ; b 0i ; b 1i ; b 2i are coefficients of polynomials approximating the static characteristics of the load; U NOMi is rated voltage of the i-th node.
For the nodes corresponding to Equations (8) and (9), matrix ∂ F ∂ DY will include the following parts: For generator nodes

Components of Vector
Based on the value C L obtained by solving Equation (7), one can calculate R SAS that determines probabilistic assessment of the risk of SAS loss; in this case, an approach similar to that proposed in [27] can be used to assess financial risks where DY L is the value of vector DY at the point of contact between the hyperellipsoid (3) and the hypersurface L W . System (7), compared to the steady-state equations that form the first group of equations of this system, has an increased dimension. However, the exclusion of multistep procedures of discrete weighting [10] ensures high efficiency of calculations and reliability of results in the problems of operational control of electric power systems.

Simulation Results
As an example, below are the results of determining the stability margins for a threenode EPS model shown in Figure 2. The model corresponds to a 110 kV network supplying two load nodes equipped with distributed generation (DG) plants with a rated power of  Figure 3 shows the graphs of the power injection changes P k (t) = P Hk (t) − P Gk , where P Hk (t) are consumer loads with a random time law; P GK -capacities of generators of the DG plants, which are assumed to be constant; k = 1, 2.   (8) and (9), the sign of the load powers is taken as negative.
The approach used in this example was based on the following assumptions: 1. a stochastic approach was used for consumer loads; at the same time, their capacities changed according to the graphs shown in Figure 2; 2. deterministic models traditionally used in practice were employed for the powers of the generator; it should be noted that the algorithm described above can also be used without modifications in the case of a stochastic nature of changes in the capacities of generators. Table 1 presents simulation results obtained on the basis of an experimental code implemented in Mathcad. Figures 4-10 provide the corresponding illustrations. Table 1 shows the values of the parameters ( )     (8) and (9), the sign of the load powers is taken as negative.
The approach used in this example was based on the following assumptions: 1. a stochastic approach was used for consumer loads; at the same time, their capacities changed according to the graphs shown in Figure 2; 2. deterministic models traditionally used in practice were employed for the powers of the generator; it should be noted that the algorithm described above can also be used without modifications in the case of a stochastic nature of changes in the capacities of generators. Table 1 presents simulation results obtained on the basis of an experimental code implemented in Mathcad. Figures 4-10 provide the corresponding illustrations. Table 1 shows the values of the parameters ( )   (8) and (9), the sign of the load powers is taken as negative.
The approach used in this example was based on the following assumptions: 1.
a stochastic approach was used for consumer loads; at the same time, their capacities changed according to the graphs shown in Figure 2; 2.
deterministic models traditionally used in practice were employed for the powers of the generator; it should be noted that the algorithm described above can also be used without modifications in the case of a stochastic nature of changes in the capacities of generators. Table 1 presents simulation results obtained on the basis of an experimental code implemented in Mathcad. Figures 4-10 provide the corresponding illustrations. Table 1 shows the values of the parameters y  Table 1 provides values of C L corresponding to hyperellipsoid (3), and the values that determine the probabilistic risk assessments of the SAS loss. Note: the values of Z were calculated using formula (2).  Note: the values of Z were calculated using formula (2).
It follows from Table 1 that, with significant load variations, the probability of stability loss can be quite high and reach 16%. However, the stability margin determined by the Euclidean norm (2), which does not take into account the stochastic nature of the operating conditions, will be even higher (62%). Thus, the margin value determined on the basis of the Euclidean norm may be overly optimistic. Figure 4 shows the results of determining the limiting modes in a stochastic statement. For comparison, we performed calculation of a limiting mode using a deterministic approach; it was assumed that where E is an identity matrix. The results of calculating the limiting mode in a deterministic statement are illustrated in more detail in Figure 5. As seen in Figure 5, the limiting mode parameters obtained in deterministic ( ) D L Y and stochastic ( ) S L Y statements can differ greatly. Figure 6 shows the results of determining the limiting mode for σ = 40%. Figure 7 shows the results of determining the limiting mode when the 50 MW generator of the DG plant is disabled at node 1. Figure 8 provides illustration for the results obtained when one circuit of the electric transmission line connecting nodes 2 and 3 is disabled.       Using Table 1, we drew graphs for  It should be noted that at the solution to Equation (7), vectors of the normals to the limit hypersurface , subject to and to hyperellipsoid (3) are collinear. It should be noted that at the solution to Equation (7), vectors of the normals to the limit hypersurface , subject to and to hyperellipsoid (3) are collinear. It was shown in [5] that the vector R determined by solving Equation (7) coincides with the direction of the normal to . The direction of the normal to the hyperellipsoid (3) can be found by calculating the gradient vector Figure 10. Dependence of the stability margin on the standard deviation of the load capacities.
It follows from Table 1 that, with significant load variations, the probability of stability loss can be quite high and reach 16%. However, the stability margin determined by the Euclidean norm (2), which does not take into account the stochastic nature of the operating conditions, will be even higher (62%). Thus, the margin value determined on the basis of the Euclidean norm may be overly optimistic. Figure 4 shows the results of determining the limiting modes in a stochastic statement. For comparison, we performed calculation of a limiting mode using a deterministic approach; it was assumed that where E is an identity matrix. The results of calculating the limiting mode in a deterministic statement are illustrated in more detail in Figure 5. As seen in Figure 5, the limiting mode parameters obtained in deterministic Y

(D)
L and stochastic Y (S) L statements can differ greatly. Figure 6 shows the results of determining the limiting mode for σ = 40%. Figure 7 shows the results of determining the limiting mode when the 50 MW generator of the DG plant is disabled at node 1. Figure 8 provides illustration for the results obtained when one circuit of the electric transmission line connecting nodes 2 and 3 is disabled.
It should be noted that at the solution to Equation (7), vectors of the normals to the limit hypersurface L w , subject to det ∂ F ∂ X = 0, and to hyperellipsoid (3) are collinear. It was shown in [5] that the vector R determined by solving Equation (7) coincides with the direction of the normal to L w . The direction of the normal to the hyperellipsoid (3) can be found by calculating the gradient vector Collinearity of vectors R and N can be determined by finding the angle between them: Calculations of the limiting mode obtained for σ = 15% provide the following results: These results confirm the theoretical findings about collinearity of the vectors R and N.

Conclusions
Based on the results of computer simulation, the following conclusions can be made: 1.
The modified equations that do not allow the iterative process to converge to the trivial solution ensure high reliability of results when determining the stability margins in a stochastic statement; a technique based on the introduction of an additional variable can be used to improve the convergence of computational processes in determining the stability margins in a deterministic statement.

2.
The parameters of the limiting modes obtained in the deterministic and stochastic formulations may significantly differ.

3.
With an increase in the variance of load graphs, the risk of stability violation increases significantly; at the same time, the amount of the margin determined on the basis of the Euclidean norm remains overly optimistic. 4.
In the illustrative example, a significant increase in the risk of stability violation occurs during planned and emergency shutdowns of the EPS components.

5.
At present, the concept of cyber-physical systems is being actively developed. It provides the foundation for building modern, efficient, and reliable EPSs. This concept presupposes the use of not only physical objects, but also deep integration of digital components that process a large amount of information coming from sensors, which is then used to simulate and control physical objects. The proposed method for determining the stability margins in a stochastic statement can be effectively used to solve the problems of analyzing SAS in cyber-physical EPS equipped with distributed generation units.

6.
Further research could be aimed at factoring in the asymmetry of loads when determining the stability margins in a stochastic formulation based on the use of phase coordinates to write the equations of limiting modes [28].  Institutional Review Board Statement: Not applicable.

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

Conflicts of Interest:
The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.