## 2 Problem Formulation  
### Microgrid System Design  
Figure 1 depicts the configuration of the proposed microgrid system, highlighting the energy flow between its various components. The system incorporates a wind turbine (WT), a solar panel (SP), and a biomass gasifier (BG) for power generation. Operating in grid-connected mode, the microgrid has the capability to import both electricity and heat. The arrows in the diagram represent the directional flow of electrical and thermal energy. To meet the electricity demand, the combined output from the WT, SP, BG, and battery (BT) is utilized, all while adhering to their operational limits and constraints. The power  
generated by the WT, SP, and BG modules can be used to charge the BT. The thermal demand is solely met by the BG. The system is allowed to purchase power from external sources to ensure the power needs of the customers and avoid outages caused by damage to microgrid equipment or other reasons. Any deficits in electricity and heat supply are covered by purchasing electricity and heat from the utility. It is assumed that all the units run without malfunction.  
The energy \(x_{1}^{t}\) generated by BG is converted into electrical and thermal energy through the engine generator, which is used to meet electrical and heat demands through energy flow \(x_{2}^{t}\) and \(x_{3}^{t}\), while excess electrical energy \(x_{4}^{t}\) is stored in the battery. The purified and cooled producer gas from the BG installation serves dual purposes--it can be utilized directly as fuel for both engine-generator assemblies and boilers or stored in dedicated gas containment vessels (combustion properties of biomass, Fuel Process). The BG facility functions as a load-following generation unit, capable of adjusting its output in response to varying demand patterns within its operational capacity constraints, as described by Equation (1):  
\[P_{\text{BG}}^{t}=f(\text{load}) \tag{1}\]  
where \(P_{\text{BG}}^{t}\) is the energy produced by BG at time \(t\).  
Photovoltaic power involves converting light energy into electrical energy through the use of solar panels. The electricity produced by the solar panels (SPs) is immediately used to meet the power demand through \(x_{5}^{t}\), while any excess is stored in the battery via \(x_{6}^{t}\). The power output of the photovoltaic system can be expressed by the following equation:  
\[P_{\text{SP}}^{t}=\eta_{\text{SP}}A_{\text{SP}}S \tag{2}\]  
where \(P_{\text{SP}}^{t}\) signifies the power output of the solar panel (SP) at time \(t\), \(\eta_{\text{SP}}\) corresponds to the overall conversion efficiency of the SP array, which accounts for both the inherent module performance and array-shading coefficient, \(A_{\text{SP}}\) represents the area of the array, and \(S\) indicates the solar radiation, which is treated as a stochastic variable.  
Wind power generation is influenced by wind speed and the interaction between the turbine and the wind. The electric energy generated by WT is directly used through \(x_{7}^{t}\) to meet the power demand, while the excess electricity is stored in the battery through \(x_{8}^{t}\). The turbine's power generation capacity operates at three distinct levels:  
\[P_{\text{WT}}^{t}=\left\{\begin{array}{ll}0&\text{if }V(t)<V_{\text{work}} \text{ or }V(t)>V_{\text{safe}}\\ \frac{1}{2}C_{p}\rho A_{\text{wt}}V(t)^{3}&\text{if }V_{\text{work}}<V(t)<V_{\text{rated}}\\ \frac{1}{2}C_{p}\rho A_{\text{wt}}V_{\text{rated}}^{3}&\text{if }V_{\text{rated}}<V(t)<V_{\text{safe}} \end{array}\right. \tag{3}\]  
Figure 1: Schematic microgrid system.  
where \(P_{\text{WT}}^{t}\) represents the mechanical output power of the turbine at time \(t\), \(\rho\) denotes the air density, \(A_{\text{wt}}\) is the turbine swept area, \(V(t)\) is the undisturbed wind speed at time \(t\), \(C_{p}\) is the power coefficient of the turbine. \(V_{\text{work}}\), \(V_{\text{rated}}\), and \(V_{\text{safe}}\) represent the turbine's working, rated, and safe wind speeds, respectively.