*2.2. Mathematical Model of Permanent Magnet Synchronous Generator (PMSG)*

The mathematical model of the PMSG is derived from the output voltage equations of the stator. The output voltage equations of the PMSG are illustrated in Equation (3) below. The windings are placed as balanced on the stator. The resistances of the windings are equal and depicted by *Rs* = *Rq* = *Rd*. *Rs* depicts the stator resistance, *Ls* depicts the stator inductance, and ω*<sup>e</sup>* denotes the electrical angular

frequency. *vs*, which depicts an output voltage of the PMSG, is described in Equation (3) [27–30]. The mathematical model is very useful for the generator to operate at optimum values and most important for the safe operation of the generator.

$$\begin{pmatrix} \upsilon\_{sd} \\ \upsilon\_{sq} \end{pmatrix} = R\_s \begin{pmatrix} i\_{sd} \\ i\_{sq} \end{pmatrix} + \frac{d}{dt} \begin{pmatrix} L\_{il} i\_{sd} \\ L\_{q} i\_{sq} \end{pmatrix} + \omega\_c \begin{pmatrix} -\psi\_{sq} \\ \psi\_{sd} \end{pmatrix} \tag{3}$$

The stator flux linkages (*dq* frame) are defined in Equation (4):

$$
\begin{pmatrix} \psi\_{sd} \\ \psi\_{sq} \end{pmatrix} = \begin{pmatrix} L\_d & 0 \\ 0 & L\_q \end{pmatrix} \begin{pmatrix} i\_{sd} \\ i\_{sq} \end{pmatrix} + \psi\_f \begin{pmatrix} 1 \\ 0 \end{pmatrix} \tag{4}
$$

where ψ*sd* and ψ*sq* are the flux linkages, *Ld* and *Lq* represent the stator inductances in the *dq* frame, *isd* and *isq* represent the generator's *dq* frame currents, and ψ*<sup>f</sup>* represents the flux linkage in the permanent magnets. The *dq* frame stator voltages by means of the flux linkages are as follows:

$$
\begin{pmatrix} v\_{sd} \\ v\_{sq} \end{pmatrix} = R\_{\mathcal{S}} \begin{pmatrix} i\_{sd} \\ i\_{sq} \end{pmatrix} + \frac{d}{dt} \begin{pmatrix} L\_d i\_{sd} \\ L\_q i\_{sq} \end{pmatrix} + a \iota\_{\mathcal{C}} \begin{pmatrix} -L\_d i\_{sq} \\ L\_d i\_{sd} \end{pmatrix} + a \iota\_{\mathcal{C}} \begin{pmatrix} 0 \\ \psi\_f \end{pmatrix} \tag{5}
$$

where *vsq* and *vsd* are the voltages of the *q* and *d* loops in the stator, respectively. The voltages of the *vsd* and *vsq* are utilized to generate the reference three-phase sinusoidal voltage, and the *isd* and *isq* depict the currents of the *d* and *q* loops in the stator, respectively. *Rs* is a stator resistor, *Lq* and *Ld* represent the inductances of the *q* and *d* loops in the stator, respectively, and ω*<sup>e</sup>* is the electrical angular of the PMSG.
