      
\chapter{Dynamic Models of Rotating Machines and Wind Turbines}\label{Chapter2}
In this chapter, the dynamic models of synchronous machines, induction machines and wind turbines are developed which would be used throughout this thesis to analyze dynamics of various topologies of power system networks with weak interconnections. These mathematical models are derived based on references \cite{krause1965simulation}, \cite{krause2013analysis} and \cite{sauer1998power}. Electromagnetic and electromechanical transients are modeled using differential equations in this dissertation to study stability issues in weak grids when series capacitors are utilized to enhance power transfer and strengthen the interconnection between the generator and the grid (Chapters 3 to 5) or the generator and load center (Chapters 6 and 7).

\section{Dynamic modeling of synchronous machine}\label{SG_Modeling}
The two-axis model of a synchronous machine is developed in a reference frame fixed on the rotor. The state variables for the synchronous machine are the $d$ and $q$ axis stator currents, emfs induced in the rotor along the field and damper windings, speed and instantaneous position of the rotor. This model is interfaced with the electrical network in Chapter \ref{chap7} to study interactions of synchronous generators with induction motor loads in a series compensated system. 

\subsection{Modeling of electromagnetic transients}\label{elmg_SG}
Dynamics of flux linkages in the stator winding along the $d$ and $q$ axis is given by:

\begin{align}
    \frac{d}{dt}\{\psi_{sg}\} = R_a [U]\{I_{sg}\} + \omega [N_1]\{\psi_{sg}\} + \{V_{sg}\} \label{Fdq_stator}
\end{align}
where the elements of matrices $[U]$ and $[N_1]$ are given by:

\begin{align}
[U] &=     \begin{bmatrix}
           1 && 0\\
           0 && 1
          \end{bmatrix}\label{U_mat}\\
[N_1] &= \begin{bmatrix}
        0  & 1\\
    -1 & 0\label{N1_mat}
    \end{bmatrix}
\end{align}

and the elements of the vectors $\{\psi_{sg}\}$, $\{I_{sg}\}$ and $\{V_{sg}\}$ are given by: 

\begin{align}
    \{\psi_{sg}\} &= [\psi_d \hspace{0.35cm} \psi_q ]^{T}\\
    \{I_{sg}\} &= [I_d \hspace{0.35cm} I_q ]^{T}\\
    \{V_{sg}\} &= [V_d \hspace{0.35cm} V_q]^{T}
\end{align}
% In equation \eqref{Fdq_stator}, $p$ denotes the derivative operator with respect to time $(p \equiv \frac{d}{dt})$.

The stator flux linkage vector can be expressed as:
\begin{align}
    \{\psi_{sg}\} = [X_{sg1}]\{I_{sg}\} + [N_1]\{E'_{sg}\}\label{Fdq_1}
\end{align}
 where the elements of the matrix $[X_{sg1}]$ and vector $\{E'_{sg}\}$ are given by:
 
 \begin{align}
     [X_{sg1}] &= \begin{bmatrix}
         -X'_d & 0\\
         0 & -X'_q
     \end{bmatrix}\\
      \{E'_{sg}\} &= [E'_d \hspace{0.35cm} E'_q]^{T}
 \end{align}
     
On substituting \eqref{Fdq_1} in \eqref{Fdq_stator}, equation \ref{Fdq_stator_final} is obtained which will be used to interface the synchronous machine with the network using the term $\{V_{sg}\}$.

\begin{align}
    [X_{sg1}]\frac{d}{dt}\{I_{sg}\} + [N_1]\frac{d}{dt}\{E'_{sg}\} = [Z_{sg}]\{I_{sg}\} + \omega [N_1^2]\{E'_{sg}\} + \{V_{sg}\} \label{Fdq_stator_final}
\end{align}

where
\begin{align}
    [Z_{sg}] &= R_a[U] + \omega [N_1X_{sg1}]
\end{align}

Dynamics of the emfs induced in the rotor windings of the synchronous machine along the $d$ and $q$ axis due to flux linkages in the damper and field windings respectively can be expressed as:
\begin{align}
    [M_r]\frac{d}{dt}\{E'_{sg}\} &= -[U]\{E'_{sg}\} + [X_{sg2}]\{I_{sg}\} + [N_2]E_{fd}\label{Edq_Final}
\end{align}

where the elements of the matrices $[M_r]$ and $[X_{sg2}]$ can be written as:

\begin{align}
[M_r] &= \begin{bmatrix}
        T'_{qo} & 0\\
        0 & T'_{do}
        \end{bmatrix}\\
[X_{sg2}] &=     \begin{bmatrix}
           0 & X_q-X'_q\\
          -(X_d - X'_d) & 0
          \end{bmatrix}
\end{align}

\subsection{Modeling of electromechanical transients}

The electromechanical transients of the synchronous machine in generator mode are described by the swing equation given below: 

\begin{align}
    2H\frac{d\omega}{dt} &= T_m - T_e\label{speed_SG}\\
    \frac{d\delta}{dt} &= \omega_s(\omega - 1)\label{angle_SG}
\end{align}

where the electrical torque $T_e$  of the synchronous machine is given by the following equation:

\begin{align}
    T_e &= E'_dI_d + E'_qI_q + (X'_q - X'_d)I_dI_q
\end{align}

In equation \ref{angle_SG}, the rotor angle $\delta$ is measured with respect to a synchronously rotating reference and defines the instantaneous angular position of the rotor. 
\vspace{-0.4cm}
\subsection{Linearization of synchronous machine model}

In this section, the linearized equations corresponding to the nonlinear dynamic model of the synchronous machine are presented. The linearized state variable around an operating point is prefixed with a $\Delta$ and the values of state variables under equilibrium conditions is superscripted by `o' in this dissertation. The linearized version of equation \eqref{Fdq_stator_final} is presented below:

\begin{equation}
    [X_{sg1}]\frac{d}{dt}\{\Delta I_{sg}\} + [N_1]\frac{d}{dt}\{\Delta E'_{sg}\} = [Z_{sg}]^o\{\Delta I_{sg}\} + (\omega)^o [N_1^2]\{\Delta E'_{sg}\} + [N_1]\{\psi_{sg}\}^o\Delta \omega \nonumber \\
    + \{\Delta V_{sg}\} \label{Fdq_linearized}
\end{equation}

where $[Z_{sg}]$ is a function of the rotor speed of the generator at equilibrium which is given by $[Z_{sg}]^o = R_a[U] + (\omega)^o [N_1X_{sg1}]$ and $\{\psi_{sg}\}^o$ is the vector of stator flux linkages of the synchronous generator evaluated using equation \eqref{Fdq_1} at the equilibrium point. The linearized expression for the emfs induced in the field and damper windings of the synchronous machine is given by the following equation:  

\begin{align}
     [M_r]\frac{d}{dt}\{\Delta E'_{sg}\} &= -[U]\{\Delta E'_{sg}\} + [X_{sg2}]\{\Delta I_{sg}\} + [N_2]\Delta E_{fd}\label{Edq_linearized}
\end{align}

Equations \eqref{speed_SG} and \eqref{angle_SG} are linearized and are given below:

\begin{align}
    2H\frac{d\Delta \omega}{dt} &= \Delta T_m - [T_{sg1}]\Delta \{I_{sg}\} - [T_{sg2}]\Delta \{E'_{sg}\}\label{speed_SG_linearized}\\
    \frac{d\Delta \delta}{dt} &= (\omega_s)\Delta \omega\label{angle_SG_linearized}
\end{align}

The elements of matrices $[T_{sg1}]$ and $[T_{sg2}]$ are given in equations \eqref{Tsg1} and \eqref{Tsg2} respectively. 

\begin{align}
    [T_{sg1}] &= [(I_{d})^o \hspace{0.35cm} (I_{q})^o]\label{Tsg1}\\
    [T_{sg2}] &= [(E'_{d})^o + (X'_q - X'_d)(I_{q})^o  \hspace{1cm} (E'_{q})^o + (X'_q - X'_d)(I_{q})^o]\label{Tsg2}
\end{align}

\section{Dynamic model of induction machine}
The dynamic model of an induction machine operating in motoring and generating modes expressed in a reference frame rotating at synchronous speed is presented in this section. The state variables considered in the induction machine are the $d$ and $q$ axis stator currents, $d$ and $q$ axis rotor currents and slip of the machine. The induction generator model is interfaced with the electrical network in Chapters \ref{Chap3}, \ref{Chap4} and \ref{Chap5} to analyze stability of systems with Squirrel Cage Induction Generator - Wind Turbines (SCIG-WTs) in series compensated networks. The induction motor model presented is interfaced with the series compensated   network to compute stability domains with respect to series compensation in systems with induction motor loads supplied through weak networks in Chapters \ref{Chap6} and \ref{chap7}.    

\subsection{Modeling of electromagnetic transients}
Dynamics of $d$ and $q$ axis stator and rotor currents for the induction machine operating as a motor are expressed using the following differential equations:

\begin{align}
    \frac{X_s}{\omega_s}[U]\frac{d}{dt}\{I_{s}\} + \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{I_{r}\} &= [Z_{im1}]\{I_{s}\} + [Z_{im2}]\{I_{r}\} + \{V_{s}\}\label{Stator_IM}\\   
    \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{I_{s}\} + \frac{X_r}{\omega_s}[U]\frac{d}{dt}\{I_{r}\} &= [Z_{im3}]\{I_{s}\} + [Z_{im4}]\{I_{r}\}\label{rotor_IM}   
\end{align}
where

\begin{align}
    [Z_{im1}] &= -R_s[U]+X_s[N_1]\\
    [Z_{im2}] &= X_m[N_1]\\
    [Z_{im3}] &= s_mX_m[N_1]\\
    [Z_{im4}] &= -R_r[U]+s_mX_r[N_1]
\end{align}

Similarly, the dynamics of $d$ and $q$ axis currents of an induction machine in generator mode of operation are governed by equations given below:

\begin{align}
    -\frac{X_s}{\omega_s}[U]\frac{d}{dt}\{I_{s}\} + \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{I_{r}\} &= [Z_{ig1}]\{I_{s}\} + [Z_{ig2}]\{I_{r}\} + \{V_{s}\}\label{Stator_IG}\\   
    -\frac{X_m}{\omega_s}[U]\frac{d}{dt}\{I_{s}\} + \frac{X_r}{\omega_s}[U]\frac{d}{dt}\{I_{r}\} &= [Z_{ig3}]\{I_{s}\} + [Z_{ig4}]\{I_{r}\}\label{rotor_IG}   
\end{align}
where

\begin{align}
    [Z_{ig1}] &=  R_s[U]-X_s[N_1]\\
    [Z_{ig2}] &=  X_m[N_1]\\
    [Z_{ig3}] &= -s_gX_m[N_1]\\
    [Z_{ig4}] &= -R_r[U]+s_gX_r[N_1]
\end{align}

In all the equations presented above, $X_s = X_{ls} + X_{m}$ and $X_r = X_{lr} + X_m$ where $X_{ls}$ and $X_{lr}$ are the leakage reactances of the stator and rotor windings respectively and $X_m$ is the magnetizing reactance of the induction motor. The matrices $[U]$ and $[N_1]$ are the same as defined in equations \eqref{U_mat} and \eqref{N1_mat}. In equations \eqref{Stator_IM}, \eqref{rotor_IM}, \eqref{Stator_IG} and \eqref{rotor_IG}, $\{I_{s}\} = [I_{ds} \hspace{0.35cm} I_{qs}]^T$, $\{I_{r}\} = [I_{dr} \hspace{0.35cm} I_{qr}]^T$ and $\{V_{s}\} = [V_{ds} \hspace{0.35cm} V_{qs}]^T$. Note that in equations \eqref{rotor_IM} and \eqref{rotor_IG}, the matrices $[Z_{im3}]$, $[Z_{im4}]$, $[Z_{ig3}]$ and $[Z_{ig4}]$ are a function of the slip of the machine. Since these matrices are multiplied by vectors containing stator and rotor currents which are also state variables, the resulting equations are nonlinear.

\subsection{Modeling of electromechanical transients}

The rotor speed of an induction motor is determined using the swing equation below:
\begin{align}
    2H_{im}\frac{ds_m}{dt} &= T_m - T_e\label{swing_IM}
\end{align}

where $T_m$ is the mechanical torque demanded from the induction motor and $T_e$ is the electrical torque output of the motor and is given by equation: 

\begin{align}
    T_e = X_m(I_{qs}I_{dr} - I_{ds}I_{qr})\label{IM_Te}
\end{align}

Electromechanical dynamics of an induction generator are described using the swing equation as shown below: 

\begin{align}
    2H_{ig}\frac{ds_g}{dt} &= T_e - T_m \label{swing_IG}
\end{align}

where $T_m$ is the mechanical torque input to the induction generator. In this dissertation, the mechanical torque of the induction generator is supplied by the wind and $T_e$ is the same as that of equation \eqref{IM_Te}. 

\subsection{Linearization of induction machine model}

The linearized equations corresponding to the electromagnetic transients of the induction motor are shown below:

\begin{align}
    \frac{X_s}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{s}\} + \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{r}\} &= [Z_{im1}]\{\Delta I_{s}\} + [Z_{im2}]\{\Delta I_{r}\} + \{\Delta V_{s}\}\label{Stator_IM_linearization}\\   
    \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{s}\} + \frac{X_r}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{r}\} &= [Z_{im3}]^o\{\Delta I_{s}\} + [Z_{im4}]^o\{\Delta I_{r}\} + [N_1]\{\lambda_{r}\}^o\Delta s_m\label{rotor_IM_linearization}   
\end{align}

where
\begin{align}
    [Z_{im3}]^o &= (s_m)^oX_m[N_1]\\
    [Z_{im4}]^o &= -R_r[U] + (s_m)^oX_r[N_1]\\
    \{\lambda_{r}\}^o &= X_m[U]\{I_s\}^o + X_r[U]\{I_r\}^o
\end{align}

Similarly, the linearized expressions corresponding to the electromagnetic transients of an induction generator can be written as:

\begin{align}
    -\frac{X_s}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{s}\} + \frac{X_m}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{r}\} &= [Z_{ig1}]\{\Delta I_{s}\} + [Z_{ig2}]\{\Delta I_{r}\} + \{\Delta V_{s}\}\label{Stator_IG_linearized}\\   
    -\frac{X_m}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{s}\} + \frac{X_r}{\omega_s}[U]\frac{d}{dt}\{\Delta I_{r}\} &= [Z_{ig3}]\{\Delta I_{s}\} + [Z_{ig4}]\{\Delta I_{r}\} + [N_1]\{\lambda_{r}\}^o\Delta s_g\label{rotor_IG_linearized}   
\end{align}

where
\begin{align}
    [Z_{ig3}]^o &= -(s_g)^oX_m[N_1]\\
    [Z_{ig4}]^o &= -R_r[U] + (s_g)^oX_r[N_1]\\
    \{\lambda_{r}\}^o &= -X_m[U]\{I_s\}^o + X_r[U]\{I_r\}^o
\end{align}

Equations \eqref{swing_IM} and \eqref{swing_IG} which describe the electromechanical dynamics of the induction machine in motoring and generating mode are linearized and the corresponding expressions are given below: 

\begin{align}
    2H_{im}\frac{d\Delta s_m}{dt} &= \Delta T_m - [T_{im1}]\Delta \{I_s\} - [T_{im2}]\Delta \{I_r\}\label{swing_IM_linearized}\\
    2H_{ig}\frac{d\Delta s_g}{dt} &= [T_{im1}]\Delta \{I_s\} + [T_{im2}]\Delta \{I_r\} - \Delta T_m\label{swing_IG_linearized}
\end{align}

where 
\begin{align}
    [T_{im1}] &= X_m[-(I_{qr})^o \hspace{0.35cm} (I_{dr})^o]\\
    [T_{im2}] &= X_m[(I_{qs})^o \hspace{0.35cm} -(I_{ds})^o]
\end{align}

\section{Modeling of wind turbine}

\begin{figure}[h]
    \centering
    \includegraphics[width=5in,height=3in]{figure/WT_Figure.pdf}
    \caption{Wind Turbine}
    \label{fig:WT}
\end{figure}

In this section, the expression for the mechanical power input ($P_w$) to the generator from the wind turbine is presented as a function of slip of the generator. Figure \ref{fig:WT} shows a wind turbine coupled to an electrical generator through a gear box which is used to translate the speed of rotation of the wind turbine blades to a value of rotor speed to achieve a suitable steady state operating point based on the electrical characteristics of the generator. The mechanical power developed by the wind turbine is a function of air density, swept area of the turbine blades and the power coefficient and is given by:

    \begin{align}
        P_w &= (1/2)\rho C_p(\lambda)AV_w^3\\
        T_w &= P_w/\omega_r\label{Tw}
    \end{align}
    
    where $C_p$ is the power coefficient given by equation \eqref{power_Coeff}, $A$ is the radius of swept area by the wind turbine blades and $\rho$ is the air density. 
    \begin{align}
        C_p(\lambda) &= c_1(c_2/\lambda_i - c_3\theta - c_4\theta^{c_5} - c_6)e^{-c_7/\lambda_i}\label{power_Coeff}
    \end{align}
   where
    \begin{align}
        \frac{1}{\lambda_i} &= \frac{1}{\lambda + c_8\theta} - \frac{c_9}{\theta^3 + 1}
    \end{align}
    where $\lambda = \omega_r R/V_w$. $R$ is the rotor radius and $\lambda$ is called `Tip Speed Ratio' (TSR). If $N_s$ is the synchronous speed in rpm, $n_{s}$ is the speed of the wind turbine in rpm which is given by $n_{s} = \frac{N_s}{G_r}$ where $G_r$ is the gear box ratio. The expression for TSR in terms of $N_{s}$ and slip $s_g$ as: 
    
    \begin{align}
        \lambda = \frac{2\pi R N_{s}}{60V_w}(1 - s_g)\label{TSR}
    \end{align}
    
    \subsection{Linearization of wind turbine model}
    In this section, the linearized mathematical model of the wind turbine is presented. Before deriving the linearized expressions, the equations for the mechanical power and torque developed by the wind turbine in per unit are presented below:
    
    \begin{align}
        P_w &= (1/2)\rho C_p(\lambda)AV_w^3*(10^{-6}/S_b)\label{Pw_pu}\\
        T_w &= \frac{P_w}{\omega_r} = \frac{P_w}{1 - s_g}\label{Tw_pu}
    \end{align}
    
    In equation \eqref{Pw_pu}, the power coefficient $C_p$ is a function of $\lambda$ which is a function of the generator slip and this is obvious from equation \eqref{TSR}. Hence, $P_w$ can be written as $P_w = K_oC_p(\lambda)$ where $K_o = (1/2)\rho AV_w^3*(10^{-6}/S_b)$ and $S_b$ being the base MVA of the system. The linearized expression for $T_w$ can now be expressed as:
    
    \begin{align}
        \Delta T_w = \frac{K_o}{1 - (s_g)^o}\Delta C_p + \frac{K_oC_p(\lambda^o)}{(1 - (s_g)^o)^2}\Delta s_g 
    \end{align}
    
    The expression for TSR at equilibrium can be written as $\lambda^o = L_o(1 - (s_g)^o)$ where $L_o = \frac{2\pi R N_s}{60V_w}$. The expression for $C_p(\lambda)$ can be written as $C_p = c_1M(\lambda)N(\lambda)$ where 
    
    \begin{align}
        M(\lambda) &= c_2/\lambda_i - c_3\theta - c_4\theta^{c_5} - c_6\label{M_Lambda}\\
        N(\lambda) &= e^{-c_7/\lambda_i}\label{N_Lambda}
    \end{align}
    The linearized expression for $C_p$ is now written as 
    \begin{align}
        \Delta C_p &= C_{w1}C_{w2}\Delta s_g
    \end{align}
    where
    \begin{align}
        C_{w1} &= \frac{c_1N(\lambda^o)L_o}{(\lambda^o + c_8\theta)^2}\\
        C_{w2} &= c_2 - c_7M(\lambda^o)
    \end{align}
    Hence, the linearized expression for the torque developed by the wind turbine can be finally written as
    
    \begin{align}
        \Delta T_w = \left[ \frac{K_oC_{w1}C_{w2}}{1 - (s_g)^o} + \frac{K_oC_p(\lambda^o)}{(1 - (s_g)^o)^2} \right]\Delta s_g
    \end{align}
    
    \section{Conclusion}
    In this chapter, nonlinear dynamic models of a synchronous generator, induction machine operating as a motor and as a generator and a wind turbine are presented. The synchronous machine model is developed in a reference frame fixed on the rotor of the machine and the induction machine model is developed in a reference frame rotating at synchronous speed. Linearized models of these components have been presented in this chapter as well. These nonlinear dynamic models will be interfaced with networks of different configurations in the forthcoming chapters to perform time domain simulations to understand dynamic behavior of systems subject to various disturbances. The linearized models developed in this chapter will be interfaced with linearized models of various  electrical networks to compute the Jacobian matrix which will be used to analyze local bifurcations affecting the stability of the system.   