# Optimal Scheduling of Microgrids Based on an Improved Dung Beetle Optimization Algorithm
## 3 Microgrid Multi-Objective Optimization Model
### Objective Function
#### 3.1.1 Operational Cost  
The expression for operational cost is as follows:  
\[C_{1}=C_{\text{MT}om}+C_{\text{DE}om}+a\times C_{\text{grid}}+C_{\text{PV}om}+ C_{\text{WT}om}+C_{\text{ES}} \tag{11}\]  
where \(C_{\text{MT}om}\) is the operation and maintenance cost of the MT; \(C_{\text{DE}om}\) is the operation and maintenance cost of the DE; \(C_{\text{grid}}\) is the cost of interacting with the grid; \(a\) is the grid connection coefficient, which can be either 0 or 1 (1 for grid-connected, 0 for isolation); \(C_{\text{PV}om}\) is the operation and maintenance cost of PVs; \(C_{\text{PV}om}\) is the operation and maintenance cost of WTs; and \(C_{\text{ES}}\) is the cost of BESS.  
The operation and maintenance cost of the MT \(C_{\text{MT}om}\) is divided into fuel cost \(C_{\text{MT}o}\) and maintenance cost \(C_{\text{MT}m}\).  
\[C_{\text{MT}om}=C_{\text{MT}o}+C_{\text{MT}m} \tag{12}\]  
\[\left\{\begin{array}{l}C_{\text{MT}o}=C\frac{\Delta t}{LHV}\sum_{t=1}^{T} \frac{P_{\text{MT}}(t)}{\eta_{\text{MT}}}\\ C_{\text{MT}m}=\sum_{t=1}^{T}K_{\text{MT}}P_{\text{MT}}(t)\end{array}\right. \tag{13}\]  
where \(P_{\text{MT}}(t)\) is the output power of the MT, \(\eta_{\text{MT}}\) is the efficiency of the DE, \(LHV\) is the lower heating value, \(C\) is the fixed natural gas price (2.5 CNY/m3), and \(K_{\text{MT}}\) is the maintenance coefficient of the MT.  
The operation and maintenance cost of the DE is as follows:  
\[C_{\text{DE}om}=C_{\text{DE}o}+C_{\text{DE}m} \tag{14}\]  
\[\left\{\begin{array}{l}C_{\text{DE}o}=c_{1}P_{\text{DE}}^{2}+c_{2}P_{\text{ DE}}+c_{3}\\ C_{\text{DE}m}=\sum_{t=1}^{T}K_{\text{DE}}P_{\text{DE}}(t)\end{array}\right. \tag{15}\]where \(P_{\rm DE}\) is the output power of the DE, and \(c_{1}\), \(c_{2}\), \(c_{3}\) are the combustion coefficients, whereas \(K_{\rm DE}\) is the maintenance coefficient of the DE.  
When the grid connection coefficient \(a=1\), the cost function for energy interaction with the grid is as follows:  
\[C_{\rm grid}=\sum_{t=1}^{T}\left(P_{\rm grid}(t)G_{\rm grid}(t)\times\Delta t\right) \tag{16}\]  
where \(P_{\rm grid}(t)\) is the power exchanged with the grid, and \(G_{\rm grid}(t)\) represents the current purchase and sale price of electricity.  
Since solar and wind are clean energy sources, PVs and WTs only include maintenance costs \(C_{PVom}\) and \(C_{WTom}\).  
\[\left\{\begin{array}{l}C_{PVom}=\sum_{t=1}^{T}K_{PVm}P_{\rm PV}(t)\\ C_{\rm WTom}=\sum_{t=1}^{T}K_{\rm WTm}P_{\rm WT}(t)\end{array}\right. \tag{17}\]  
where \(K_{PVm}\) is the maintenance coefficient for PVs, and \(K_{\rm WTm}\) is the maintenance coefficient for WTs.  
The cost model for the energy storage system \(C_{\rm ES}\) is represented as follows:  
\[C_{\rm ES}=\sum_{t=1}^{T}C_{p}|P_{\rm ES}|\Delta t \tag{18}\]  
\[\left\{\begin{array}{l}C_{p}=\frac{C_{\rm ES}K_{\rm ES}}{I_{\rm ES}}\\ G_{\rm ES}=\delta\frac{(1+\delta)^{n}}{(1+\delta)^{n}-1}\end{array}\right. \tag{19}\]  
where \(P_{\rm ES}\) is the output power of the BESS (positive during charging, negative during discharging), \(C_{p}\) is the present value of total investment costs, \(G_{\rm ES}\) is the total investment cost of the energy storage system, \(t_{\rm ES}\) is the annual operating time of the energy storage system, \(K_{\rm ES}\) is the investment recovery coefficient, \(\delta\) is the depreciation rate of the storage unit, and \(n\) is the designed life span.