## 2 Mathematical Formulation
### Constraints
Additionally, the reactive power injection capabilities of wind turbines (WTs) within the microgrid must be explicitly considered to ensure realistic operational constraints. The electrical configuration for the connection of the WT in the microgrid is presented in Figure 2. As shown, the wind turbine is connected to the grid through a full-scale power converter system consisting of a back-to-back converter with a DC-link capacitor. This architecture enables both voltage and frequency regulation, as well as decoupled control of active and reactive power. In particular, the grid-side converter independently regulates the injection of active power (\(P_{i,h}^{wt}\)) and reactive power (\(Q_{i,h}^{wt}\)) at each time interval, ensuring that both remain within the converter's apparent power limit (\(S^{wt}\)). This capability allows the WT to flexibly manage active power delivery and provide voltage support to the grid, which is crucial for improving the flexibility and operational reliability of the microgrid, especially under variable generation and demand conditions. Equation (11) ensures that the total power injected by the converter remains within its rated apparent power capacity. \[\sqrt{(P_{i,h}^{wt})^{2}+(Q_{i,h}^{wt})^{2}}\leq S^{wt} \tag{11}\]  
In this context, Equation (12) defines the maximum allowable reactive power \(Q_{i,h}^{wt,\max}\) that a WT can inject at node \(i\) during hour \(h\) as a function of its active power output. This limitation arises from the control strategy implemented through the turbine's power converter, whose capacity restricts the range of reactive power support. The converter enables reactive power compensation, particularly in scenarios of low wind generation or when active power injection is curtailed due to the operational constraints of the grid, allowing for better utilization of the converter's capacity to support voltage regulation and overall system stability [39]. \[Q_{i,h}^{wt,\max}=\sqrt{|S_{wt}|^{2}-|P_{i,h}^{wt}|^{2}} \tag{12}\]  
This expression is derived from the apparent power triangle, where the square of the apparent power \(S\) is the sum of the squares of the active power \(P\) and the reactive power \(Q\), i.e., \(S^{2}=P^{2}+Q^{2}\), which is described in Equation (11). Physically, this equation reflects a fundamental inverter limitation: the converter can only handle a certain maximum current, which translates into a maximum apparent power. As more active power is dispatched, a lower capacity remains for reactive power. This creates a circular constraint in the \(P\)-\(Q\) plane, where the feasible operating region lies within a circle of radius \(S_{wt}\). By enforcing this relationship, the model ensures that the WTs operate within the safe and feasible region of the power converter's capability curve, which is essential for maintaining voltage stability and preventing overloading, especially in scenarios of high renewable penetration. Figure 2: Active and reactive power control of WTs [38]. This relationship allows defining the reactive power injection limits of the WTs, as expressed in Equation (13). \[P_{i}^{gc,\text{min}}\leq P_{i,h}^{gc}\leq P_{i}^{gc,\text{max}} \tag{6}\]0  
In this equation, \(Q_{i}^{wt,\min}\) represents the minimum reactive power injection allowed for the WTs at node \(i\). In this study, this value is assumed to be zero, as reactive power consumption by the WTs is not considered. The upper bound \(Q_{i,h}^{wt,\max}\) is time-dependent and varies according to the active power output at each hour \(h\), as defined by Equation (12). This dynamic bounding ensures that the reactive power injection remains within the feasible limits imposed by the converter's apparent power capability. This bounding is adapted on an hourly basis according to the active power dispatch. Such constraints are critical for accurately modeling the operational flexibility of WTs in supporting voltage regulation and overall MG stability.