*2.1. Power System Model*

For transient stability studies, a synchronous generator model with four state variables *δi*, *ωi*, *E*- *qi*, *E*- *di*, and an automatic voltage regulator represented by a state variable *Ef di* [1,24] is used Equation (1). Where subscript *i* identifies the *i*th generator. Then,

$$\begin{aligned} \frac{d\delta\_i}{dt} &= \omega\_i - \omega\_B\\ \frac{d\omega\_i}{dt} &= \frac{\omega\_B}{2H\_i} [-D(\omega\_i - \omega\_B) + P\_{mi} - P\_{ci}]\\ \frac{dE'\_{qi}}{dt} &= \frac{1}{T'\_{d0i}} \left[ -E'\_{qi} + (\mathbf{x}\_{di} - \mathbf{x}'\_{di})i\_{di} + E\_{fdi} \right] \\ \frac{dE'\_{di}}{dt} &= \frac{1}{T'\_{q0i}} \left[ -E'\_{di} - \left( \mathbf{x}\_{qi} - \mathbf{x}'\_{qi} \right)i\_{qi} \right] \end{aligned} \tag{1}$$

where *δ* is the load angle; *ω* is the angular speed; *E*- *<sup>q</sup>* and *E*- *<sup>d</sup>* are the quadrature and direct internal transient voltages, respectively; *Pe* is the injected real power; *iq* and *id* are the quadrature and direct axis currents, respectively; *Ef d* is the excitation voltage; *ω<sup>B</sup>* is the speed in steady state condition; *H* is the inertia constant; *T*- *<sup>d</sup>*<sup>0</sup> and *T*- *<sup>q</sup>*<sup>0</sup> are the *d* and *q* open-circuit transient time constants; *x*- *<sup>d</sup>* and *x*- *<sup>q</sup>* are the *d* and *q* transient reactances; *xd* and *xq* are the *d* and *q* synchronous reactances; *D* is the damping constant. Considering this representation, the real power is obtained by,

$$P\_{\rm ef} = E\_{di}' i\_{di} + E\_{qi}' i\_{qi} + \left(\mathbf{x}\_{di}' - \mathbf{x}\_{qi}'\right) i\_{di} i\_{qi} \tag{2}$$

This set of equations is solved along with the algebraic equations of the electric grid. The initial values of *dq*-axis currents are obtained by power flow analysis. The algebraic equations of the power grid are formulated by power flow representation and solved together with synchronous generator equations [24]. Additionally, a static excitation system is considered to regulate the terminal voltage in each equivalent model of synchronous generators,

$$\frac{dE\_{fdi}}{dt} = \frac{1}{T\_{Ai}} \left[ -E\_{fdi} + K\_{Ai} \left( V\_{refi} - V\_{ti} + V\_{si} \right) \right] \tag{3}$$

where *Vref* is the reference voltage; *Vt* is the terminal voltage magnitude; *Vs* is the PSS's output signal (auxiliary signal); *KA* and *TA* are the system excitation gain and time constant.

The power system stabilizer model has the representation by phase lag-lead compensators and a washout block. The error between the actual speed and the corresponding in steady state condition is considered as the input signal, *ωi*(*s*) − *ωB*. This auxiliary control signal, *Vs*, must guarantee a faster damping of the low frequency oscillations that occur in the system after a short circuit failure is presented. For this purpose, it is necessary to define properly: *Ks*, *Tw*, *T*1, *T*2, *T*<sup>3</sup> y *T*4, for each PSS included in the power system. In general, it is considered that *T*<sup>1</sup> = *T*<sup>3</sup> y *T*<sup>2</sup> = *T*4.

In Figure 1, the proposed adaptive scheme is included in the power system stabilizer model to attain improved dynamic performance. This non-linear model is used to validate the tuning on the proposal. The Equations (1)–(3) are not used for design purposes. The time response of some variables is used to train the adaptive scheme in offline stage and then also in online learning operation.

**Figure 1.** Improved power system stabilizers with adaptive scheme.
