## 2 Modeling of the DC Sub-Microgrid  
### Modeling of Wind Energy Generation Unit  
The proposed wind energy system (WES) model consists of a wind generation unit, including a permanent magnet synchronous generator (PMSG) connected with a wind turbine. Furthermore, the generation unit is combined with a boost converter for the current flow in one direction only, as shown in Figure 2. The wind generator operation will be controlled through a high-level controller that offers maximum power point tracking (MPPT) operation of WES. The WES converts the kinetic energy into mechanical energy. Furthermore, it is converted into electrical energy. The mechanical power generated by the PMSG can be expressed as [43].  
\[P_{m}=\frac{1}{2}\rho\pi R^{2}V^{3}C_{p}(\lambda,\beta) \tag{1}\]  
Figure 1: Hybrid AC/DC Microgrid.  
where, \(\rho\left(\frac{k_{B}}{m^{3}}\right)\), \(R\), \(C_{p}\) and \(V\) is the air density, turbine radius, power coefficient of the turbine, and wind speed, respectively. The pitch angle of the blade (\(\beta\)) and the power coefficient of the turbine are the functions of the tip speed ratio. The practical value of \(C_{p}\) ranges from 0.4 to 0.45, but theoretically, the maximum value can be 0.59 [43]. \(\lambda\) generally, can be illustrated as:  
\[\lambda=\ \frac{\omega_{m}R}{V} \tag{2}\]  
Angular velocity of the rotor is represented by \(\omega_{m}\left(\frac{rad}{s}\right)\). However, substituting the values of \(V\) into Equation (1), we get:  
\[P_{m}=\frac{0.5}{\lambda^{3}}(\rho\pi R^{5}\omega_{m}^{5}C_{p}) \tag{3}\]  
It is observed that optimal torque control (OTC) is considered to be a practical approach to achieve MPPT due to its accuracy and simplicity [43]. Furthermore, OTC alters the torque produced in PMSG, approaching the turbine's maximum torque reference at a specified wind speed. If the rotor is at an optimum tip speed ratio, then it has a maximum power coefficient. Therefore, \(\lambda\)_and_\(C_{p}\) can be replaced with \(\lambda_{opt}\)_and_\(C_{p-max}\) and Equation (3) can be represented as:  
\[P_{m-opt}=\frac{\frac{1}{2}\rho\pi R^{5}C_{p-max}}{\lambda^{3}}\ \omega^{3}=K_{p-opt}\ \omega^{3} \tag{4}\]  
Since \(P_{m-opt}=\omega_{m}T_{m-opt}\), so Equation (4) can be rewritten as:  
\[T_{m-opt}\ =\frac{\frac{1}{2}\rho\pi R^{5}C_{p-max}}{\lambda^{3}}\omega^{2}=K_{ p-opt}\ \omega^{2} \tag{5}\]  
Equation (5) can be used to generate the reference torque, and reference current can also be determined by the following equation.  
\[I_{ref}=T_{m-opt}\ *\frac{\omega_{m}}{V_{d}} \tag{6}\]  
where \(V_{d}\) represents the rectifier's DC output voltages. The rotational speed of the generator or turbine is controlled by a DC-DC boost converter (applied as apparent load) operated in continuous conduction mode. Components of the boost converter are comprised of an inductor \(L_{w}\), series resistance \(R_{w}\), output capacitor \(C_{w}\), diode \(D_{1}\), and IGBT switch \(S_{1}\). The following differential equation describes the state-space model of the converter.  
\[\frac{di_{w}}{dt}=\frac{V_{w}}{L_{w}}-\frac{R_{w}i_{w}}{L_{w}}-(1-\mu_{1}) \frac{V_{dc}}{L_{w}} \tag{7}\]  
Figure 2: Wind energy system configuration.  
\[\frac{dV_{dc}}{dt}=\frac{(1-\mu_{1})i_{w}}{C_{dc}}-\frac{i^{\prime}_{w}}{C_{dc}} \tag{8}\]  
where average state variables \(\mu_{1}\), \(V_{dc}\) and \(i_{w}\) shows the values of the control signal, output voltage and wind current, respectively.