Real-Time Models of Electromechanical Power Systems, Based on the Method of Average Voltages in Integration Step and Their Computer Application

: In this work, the real-time mathematical models of electromechanical power systems with semiconductor converters based on the author’s method of the average voltages in the integration step are described. As well as the theoretical basics of the method, the algebraization algorithm of di ﬀ erential equations on a time quantum is described. This time quantum in the hybrid model is synchronized with the time quanta of signal samples of the physical part of the model. In the hybrid model, only algebraic equations of electromechanical power systems are present. Software and technical applications of the hybrid models of energy-generating blocks for selected thermal and nuclear power plants are described. In the process curve courses obtained and projected in this paper, the author’s hybrid models are illustrated. In the existing models, the nonlinearity of the electric machines and the semiconductor converters are taken into account. The numerical stability of the method of average voltages in integration step—in the sense of the resistance to computer calculation disturbances—is proven. a resistance with a low value in the “on” state and a high value in the “o ﬀ ” state. The switch turns o ﬀ at the time its current crosses zero from the positive to the negative value (these times are calculated by solving algebraic equations for the current of the commutating switch). The switch “turn-on” times are deﬁned from logical equations on the basis of the information received from the control system.


Introduction
There are two subsystems in modern electromechanical systems: the energy conversion system (power scheme) and information conversion system (control, regulation and automatic circuits). The authors have accumulated many years of experience in the study of electromechanical systems in a hybrid environment, in which the power part is a virtual mathematical model and the automatic control system is a real physical object. Today, this approach corresponds to hardware-in-the-loop technologies, which are described in [1][2][3][4][5]. The computer application of the power scheme must work in a real-time mode (real-time model) and must be stable to the numerical disturbances caused by the limit of real number digits in the computer application. The authors dealt with numerical stability problems during the implementation of their projects; additionally, these problems were considered in [4][5][6]. The author's method of average voltages in the integration step [7] is effective in providing numerical stability for models of power schemes with electrical circuits. Their application has provided numerical stability in the described projects during an unlimited period of hybrid model working, which could not be provided by using classical explicit and implicit methods (Runge-Kutta, Adams, trapezoids, etc.). The author's method is also effective in providing high performance, which was proven in [8].
This article deals with models of the power circuits of electromechanical systems, which are based on the method of average voltages in the integration step and its computer application in hybrid models of power generation systems based on the example of selected nuclear and thermal power plants; furthermore, the work presents a demonstration of the processes which are obtained for the hybrid models developed by the authors and an explanation of the method's stability.
In addition, the proposed method solves a problem in the time domain. The method algebraizes differential equations of electromechanical systems' power circuits within numerical quanta of time, which are synchronized in the hybrid models with signal quanta of time from a physical object. Other methods of algebraization are possible; for example, in the frequency domain [9]. However, in our opinion, using the time domain with a one-step algebraization method is optimal for real-time models of electromechanical systems with electric machine nonlinearities and semiconductor converters. Our opinion is the same as that of the authors in [9,10].

Method Description
Electromechanical systems are described by differential and algebraic equations, which are basically nonlinear. Numerical methods are used for solving equations, namely for the algebraization of differential equations in the integration step. Disturbances occur during numerical algebraization, which are caused by number rounding in computer applications (round-off error). This leads to numerical instability during multiple numerical iterations. This problem appears especially in hybrid models, in which the mathematical model works in a real-time mode for a long period. The authors highlight two factors which cause these problems.
The first factor is that a system of equations contains variables, which are simultaneous in differential and algebraic equations. An example is an electrical scheme, which is simultaneously described by Kirchhoff's first and second laws. The algebraization of differential equations by explicit methods (for example, Euler or Runge-Kutta) causes error accumulation during the solving of algebraic equations (the sum of the calculated values of currents at the system nodes in multiple calculations is equal to the error). The algebraization of differential equations by implicit methods causes a numerical disturbance during the solving of differential equations (the sum of the calculated values of the voltages in the system circuits in multiple calculations is equal to the error).
The second factor is that variables variation in the integration step are different in their characters. For example, in the case of a series connection of inductance and capacitors, the capacitor voltage is described by a series, which has an order higher than the order of the current series. The same situation can be noted for the rotor speed and rotor angle of an electric machine. Thus, using the same approach to integrate these variables is incorrect and therefore generates errors.
Here, we propose the application of the method of average voltages in the integration step for the algebraization of equations; this process was first described in [7] and used in the projects presented in [11,12]. The method is robust to the numerical disturbances described above.
The general interpretation of the method is as follows: The equations which describe electromechanical systems (power conversion systems) are written as follows: (1) The initial conditions for the integration step are written as follows: In Equations (1) and (2), x is the argument (mostly time), → y is the vector of functions, d → y/dx is the vector of derivative functions, K is the coefficient matrix for the algebraic equations system, and → B is the vector of absolute values of the algebraic equation system.
The vector differential Equation (1) is written after integration as 1 ∆x The name of this integration is the title of the method: "the method of average values of variables in the integration step". The variables were the voltages for the branch of the electrical circuits in the first applications of the method. Thus, the method was titled "the method of average voltages in the integration step".
Assuming that the vector → y is represented as a truncated Taylor series in the integration step, and substituting this expression in Equation (4), a system of vector equations is written as where → y 1 is the vector of variables The number of members of the Taylor series m determines the order of the method, namely the method of average voltages in the integration step of the first, second, . . . m-th order. In our experience, the optimal version is the second-order method.
The presented description of the method is general. The method application for a specific power system is described as follows.
The equation for an electric branch which contains an electromotive force source, inductance, capacitance and resistance is written as where u, e, u R , u C , u L are the instantaneous values of applied voltage, electromotive force, and voltages on appropriate branch elements, respectively, t 0 is the time value at the beginning of integration step, and ∆t is the integration step value. Instantaneous values of voltages on the resistor and capacitor are represented as where u R0 , u C0 are values of voltages at the beginning of the integration step; and ∆u R , ∆u C are increments of voltages in the integration step, which are represented in the form: where dt (k) are the k-order derivatives of voltages on the resistor and capacitor at the beginning of the integration step.
Taking into consideration the known dependencies between the voltages and current for branch elements, on the basis of Equations (8)-(10), the following equation was obtained, in which the unknowns are the branch's current at the end of integration step i 1 and the average voltage applied to the branch U [8]: where i 0 is the current value at the beginning of the integration step; L 0 , L 1 are the branch inductances at the beginning and at the end of the integration step; m is the order of the polynomial by which a current is described in an integration step (the order of method); and U = 1 are average values of the applied voltage and electromotive force in the integration step, respectively. As noted above, the second-order method (m = 2) is optimal from our project experience. In this case, the equation is written as The currents at the end of the integration step i 1 are determined from Equation (12). The voltage of the capacitor at the end of integration step (for the second-order method) is written as It should be noted that components of Equations (11)- (13), which include capacitance, are zero in the case of the absence of capacitance in the circuit branch. In other words, we must substitute voltage U c0 for zero and capacitance for infinity in these equations to exclude capacitance. The inductances L 1 , L 0 are zero in the case of the absence of inductance. This means that the method is applicable to any circuit, which includes any combination of R, L, and C elements.
Equations (12) and (13) should be supplemented by Equation (7) for the nodes. Equations (12) and (13) are the result of the algebraization of differential equations in the integration step. Numerical stability is ensured by solving equations in which the algebraic sum of voltages is zero at the beginning of the integration step (Kirchhoff's second law), and the sum of currents is zero at the end of the integration step (Kirchhoff's first law). Stability is absent when using classical methods, in which there are no explicit equations for the sum of currents equal to zero (explicit methods), or for a sum of voltages equal to zero (implicit methods). In addition, the contradictions in the integration of current and voltage for the capacitance, which have different steepnesses in the integration step, and which also affect the numerical stability, are eliminated. The model of the system was formed on the basis of the multipolar theory applied in [13], where the description of electric machines and semiconductor converters was applied, taking into account their nonlinearities.
Each element of the power scheme of the electromechanical system was represented by a multipole and is described by the vector equations: where → v e is the vector of potentials of the multipole's external poles; → i e is the vector of currents of the multipole's external branches; and G se , C se are the matrix of coefficients and the vector of the absolute values, respectively. According to Kirchhoff's first law, the equation is written as where Π j is the incidence matrix, which determines the method of connecting the outer branches of multipoles to the independent nodes of an electrical circuit and describes the topology of the power circuit; and L is the quantity of elements in the power system. The incidence matrices set the relation between the potentials of the multipole's external poles and potentials of independent nodes (for averaging integration step values): with its coefficients being defined after coefficients of matrix Equation (14) for each element, and after the elements' incidence matrices: The average values for an integration step of an independent system's nodes potentials were obtained from Equation (17). The average values for the integration step of an external pole's potentials for every element are obtained from Equation (16) and the currents of the external branches at the end of the integration step were calculated from Equation (14). The average values for the integration step of voltages on capacitors were determined from Equation (13).

Mathematical Models of Elements
The principles of the mathematical model's construction for elements of an electromechanical system's power scheme are illustrated by the example of the mathematical model of a synchronous machine. The mathematical model of the synchronous machine is developed in phase coordinates and takes into consideration the non-linearity of the magnetic circuit characteristics and the influence of the rotor damper system. The calculation scheme of a synchronous machine as an eight-pole is shown in Figure 1. The damping system of the synchronous machine is represented by two short-circuited windings oriented on axes d and q. According to Equation (11), the vector equations for external (stator and excitation windings) and internal (damping) circuits for the calculation scheme on Figure 1 are written as where are the vectors of the external pole potentials; where L ee is the matrix of the self and mutual inductances of the external circuit, in which the diagonal elements are the self-inductances of the stator and field windings, and all the others are the mutual inductances of appropriate windings; L ei , L ie are the matrices of the mutual inductances between the external and internal circuits; and L ii = diag L DD , L QQ is the matrix of the damper system inductances.
Equations (20) and (21) describe the flux linkage changes for the integration step of the external and internal circuit, which were caused by the changes of the current in the integration step and electromagnetic parameter changes caused by rotor rotation.
Equations (18) and (19), using Equations (20) and (21), are written as where R * ii = R ii 3 + L ii ∆t is the matrix of the step resistance of the internal circuit. Equation (23) is an algebraic equation used for the determination of the internal circuit's current in the integration step. Equation (22) using Equation (23) is written as Equation (14) for a synchronous machine: where E are the matrix of coefficients and the vector of the absolute values, respectively; i ii0 is the step electromotive force determined by the initial conditions; ∆t are the matrices of the step resistances of the external circuits at the beginning and end of the step; where M is the electromagnetic torque; M S is the external mechanical torque on the shaft, which is calculated by mathematical model of drive; J is the moment of inertia of the unit; and ω is the rotor speed. Equations (23)-(25) form the mathematical model of the synchronous machine. The mathematical models of other elements are formed as multipoles, such as the mathematical model of the synchronous machine.
The semiconductor switches are presented as a resistance with a low value in the "on" state and a high value in the "off" state. The switch turns off at the time its current crosses zero from the positive to the negative value (these times are calculated by solving algebraic equations for the current of the commutating switch). The switch "turn-on" times are defined from logical equations on the basis of the information received from the control system.

Application
The described method was used by authors in many projects, particularly in digital diagnostic complexes for brushless excitation systems for the Kursk Nuclear Power Plant (Russia), the South-Ukrainian Nuclear Power Plant, as well as for static excitation systems for turbogenerators of thermal power plants; in particular, the Burshtyn Thermal Power Plant (Ukraine).
The examples of the application of a real-time computer model of a power scheme for a power generation system in conjunction with a physical generator control system (hardware-in-the-loop structure) are described below. This "hybrid" system is used to test, diagnose, and debug the physical control system of the generator before it is connected to the generator, as well as periodically during its operation for prevention purposes. The structural-functional scheme of the system is shown in Figure 2. The power scheme, implemented in the computer model, contains a synchronous generator G (rated power P n = 63 MW; rated voltage and current U n = 10,750 V, I n = 3980 A) with a semiconductor self-excitation system, in which the excitation current is regulated by thyristor converter TC. The thyristor converter is supplied by the synchronous generator's output voltage through the transformer. The generator is driven by the turbine TG with the speed control system. The load of the generator is the model of the Power Network consisting of the parallel-working generators of the power plant and the power line with the equivalent electromotive force.
The thyristor converter is controlled by signals from the real control system (excitation controller) including the automatic excitation control system with the voltage regulator (AVR) and the system stabilizer (SS), as well as the thyristor converter control system (CSTC). The following signals are emitted from the computer model into the excitation controller: the generator's output linear voltages u gAB , u gBC , the generator's stator current i g , and the generator's excitation current i fg . The control voltage for the thyristor converter is sent to the computer model from the excitation controller. The matching devices provide the interconnection between the computer and the real part of the hybrid model. Their functions are analog-to-digital and digital-to-analog conversion (the analog excitation controller is used), as well as the signal's level matching and power amplification. In particular, the nominal values of the signals of the generator's voltages and stator current on the inputs of the real excitation controller must be 100 V and 5 A, accordingly. The matching devices provide the work conditions for the excitation controller, in a similar manner to the power plant.
The research results in the form of the experimental oscillograms of the generator excitation current I f , the effective value of the generator terminal voltage U T , the reference value of the generator terminal voltage U ref , and the active and reactive power at the generator's output P g , Q g are shown in  Oscillograms were derived from the physical excitation system co-operating with the excitation system's software. All values on the oscillograms are given in relative units.   The experimental oscillogram for the mode of the initial excitation of the non-loaded generator (the generator was disconnected from the network) is shown in Figure 3.
The automatic voltage regulator provides the generator terminal voltage, increasing in accordance with the set point signal (reference), which varies according to the prescribed law.
The research results for the case of an abrupt loading of the generator by active power are shown in Figure 4. Under this loading, there was a dynamic drop of voltage by 0.1 nominal value. These experiments made it possible to adjust the generator control system.
The oscillogram obtained for the mode of the generator's reactive power regulation by changing the generator's voltage setting on the physical excitation system is shown in Figure 5.
In the case of an increase of the generator voltage set point, the magnitudes of the excitation current and the reactive power that the generator generates into the power network increase (a positive signal of reactive power means the mode of return of power to the network). In the case of a decrease of the generator voltage set point, the generator's excitation current and the reactive power are reduced. With a significant reduction of the excitation current, the generator switches to reactive power consumption from the power network. A significant consumption of reactive power by a synchronous turbogenerator is not allowed due to the overheating of the tooth areas of the rotor. Therefore, in automatic excitation controllers, a minimum excitation limit is provided in order to prevent this mode.
Another hybrid model was implemented as part of a project to diagnose a brushless excitation system for a turbogenerator with power of 1000 MW, which is operated, in particular, at nuclear power plants in Ukraine and Russia. The appearance of the digital diagnostic complex and the functional diagram of the hybrid model combining a real automatic excitation controller and a computer model of the power generation system are shown in Figure 6. The power scheme contains the main synchronous generator (G), auxiliary generator (brushless synchronous machine (AG)), turbine (TG), input transformer (TR1) of the main generator excitation system, generator transformers (TR2), and thyristor converter (TC). The main generator is excited by a brushless exciter (AG); its excitation current is regulated by a thyristor converter.
The signals of the generator terminal voltage (u gAB , u gBC ), the generator stator current (i g ), the generator excitation current (i fg ) are sent from the computer model to the excitation controller. The control voltage of the controlled rectifier (thyristor converter (TC) in the computer model) is applied from the real excitation controller.
The oscillogram for the mode of the repeated short circuits (one and two-phase) in the power network, which are obtained in the hybrid model ( Figure 6) with the physical excitation controller of the turbogenerator, which is operated at the South-Ukrainian Nuclear Power Plant, is shown in Figure 7.
The short-circuit mode is accompanied by a resynchronization of the generator, during which oscillations occur due to changes in the load angle. The basic coordinates set the generator (stator current, excitation current, electromagnetic torque) depending on the moment of occurrence of the short circuit in relation to the voltage phase angle of the power network. The excitation system forces the excitation voltage and excitation current in the case of a short circuit to increase the generator's electromagnetic torque to avoid the loss of synchronism caused by the increasing of the rotor speed and load angle. The developed model allows us to estimate the magnitude of the oscillations of the generator's electromagnetic torque in short-circuit modes, and therefore to evaluate the effect of these modes on the turbine. The oscillogram for the mode of the repeated short circuits (one and two-phase) in the power network of the power generation system with a brushless excitation system for the turbogenerator.

Conclusions
The method of average voltages in the integration step provides numerical stability for hybrid real-time models and ensures the analytical-numerical algebraization of differential equations of electromechanical power circuits on time quanta, which are synchronized with time quanta of control system signals. This is important for the operation of hybrid models for an unlimited period of time.
The method is applicable for systems for which variables are described in the integration step by polynomials of a different order; for example, the voltage for the capacitance and current in a branch with series-connected inductance and capacitance, as well as the rotor speed and angle in electric machines.
Mathematical models of elements are represented as multipoles, providing generality for electromechanical systems models. The use of multipolar models makes it possible to parallelize the calculation and increase the speed of performance.
The developed real-time models of the power schemes of nuclear and thermal power plant generator blocks work in conjunction with the real excitation control system of generators during diagnosis and testing. In particular, the use of a real-time model for the generator blocks allows us to test and tune-up the real automatic excitation controllers of generators at power plants, as well as to train service staff.
The use of the author's method of average voltage in the integration step enables to increase the numerical stability and performance of models and ensures their continuous operation in a real-time mode in combination with physical objects.
The models provide high-precision, instantaneous modeling with an error of less than 10%, which is determined by the precision of the identification of power scheme parameters. This is ensured by the high completeness of the description of electric machines and converters, taking their nonlinearity into account.