## 3 DFIG-Based Load Flow Analysis  
A commonly applied approach for determining operating conditions in power systems is the load flow analysis. From the conventional topology and the electrical grid parameters, load flow analysis establishes unknown electrical variables like bus voltages (magnitude and angle), powers through the links, and active and reactive powers. Traditionally, an induction machine was an additional load within the load flow treated as a constant PQ load. The alternative energy sources revived the use of the induction machine as a generator, however, with significant interest in evaluating the performance of such a unit. Thereby, the most refined models are incorporated in the load flow analysis, considering a more realistic mode of the induction machine's characteristics. For load flow analysis, the DFIG is modeled as a PV or PQ node [29; 30; 31], depending on the control scheme envisaged. A PV representation is applied when the control objective focuses on terminal voltage control. This is advantageous because only the wind velocity is needed as an input variable. In contrast, a PQ representation is employed when the control objective focuses on controlling the Power Factor (PF). Through load flow analysis, the node voltages of the DFIG's connections, the active power delivered to the grid, and the reactive power consumed by the DFIG are obtained. These results verify whether the DFIG is operating at its nominal power. If it is operating below its nominal power, the rotor velocity is calculated using the power curve generated against the rotor velocity provided by the manufacturer. According to the generated power, the electric torque is determined by \(T_{e}~{}=~{}P_{e}/\omega_{r}\). Bearing the rotor velocity, the slip is calculated using Equation (1). Finally, the variables resulting from the initialization method are calculated. If the DFIG operates at its nominal velocity, however, the nominal rotor velocity, the wind velocity, or the inclination angle of the blade are required. The electric torque, the slip and the resulting variables are calculated. The mechanical power \(P_{m}\) provides the power balance in the DFIG and the electrical values in the stator \(P_{s}\), rotor \(P_{r}\), and losses \(P_{loss}\), are given by Equation (8). \[P_{m}~{}=~{}P_{s}+P_{r}+P_{loss}~{}=~{}P_{s}+P_{r}+\Bigl{(}{I_{s}}^{2}r_{s}+{I _{r}}^{2}r_{r}\Bigr{)} \tag{8}\]  
Additionally, the stator and rotor powers are given by Equation (9),  
\[ \begin{split}& P_{s}~{}=~{}V_{s}I_{s}\cos(\delta_{s}-\varphi_{s}) \\ & P_{r}~{}=~{}V^{\prime}{r}^{\prime}{I^{\prime}}_{r}\cos(\delta_{r }-\varphi_{r})\end{split}  \tag{9}\]  
Thereby, the total active power injected toward the electrical grid by the DFIG is given by Equation (10),  
\[P~{}=~{}P_{s}+P_{r} \tag{10}\]  
The reactive power \(Q\) is controllable at specified ranges of the agreed exchange between the generator and the electrical grid. That is, if \(Q\) is predetermined at zero, then the power exchange occurs through the stator of the generator, producing a reactive power given by Equation (11). \[Q~{}=~{}V_{s}I_{s}\sin(\delta_{s}-\varphi_{s}) \tag{11}\]A relationship is considered between the mechanical power and the rotor velocity of the generator, which is established in Equation (12), as seen in Figure 4.  
\[P_{m}\ =\ \gamma_{0}(1-s)^{3} \tag{12}\]  
Regarding Equation (12), the mechanical power \(P_{m}\ [W]\) extracted from the wind can be calculated by Equation (13)  
\[P_{m}\ =\ \frac{1}{2}\rho AV_{w}{}^{3}C_{p} \tag{13}\]  
where \(\rho\) is the air density \(\left[\mathrm{kg}/\mathrm{m}^{3}\right]\), \(A\) the area covered by the rotor \(\left[\mathrm{m}^{2}\right]\), \(C_{p}\) is the power coefficient and \(V_{w}\) is the wind speed upstream the rotor \(\left[\mathrm{m}/\mathrm{s}\right]\).