## 2 Operational Strategy of BESS and Prediction System
### Operational Strategy of BESS  
The energy management system (EMS) optimizes the operation of the microgrid and schedules the power resources and BESSs in the microgrid, considering fluctuations in renewable energy resources, the uncertainty of market price and demand, and the real\(-\)time supply and demand balance of electric energy and other constraints in microgrids [25; 26; 27]. Optimization methods are used to reduce operating costs, increase energy efficiency, and reduce the carbon emissions and peak load [28]. In the grid\(-\)connected mode, RESs supply loads. As soon as the supply of load power cannot be fulfilled with RESs, it will determine whether to choose battery or the distributed grid to supply according to the state of charge (SOC) of BESS [12]. When the wind and PV power generation have a surplus after load supply, it will also determine whether to sell electricity to the distribution grid or charge the battery according to the SOC of the BESS. Figure 1: Framework of energy management system in microgrid. A considered model of the SOC of BESS is shown as follows. The SOC can be described as  
\[SoC_{t}=SoC_{t-1}+\eta*P_{ch,t}-\frac{1}{\eta}*P_{dis,t} \tag{1}\]  
where \(\eta\) is the BESS efficiency of charging/discharging; \(P_{ch,t}\) is the charging power; and \(P_{dis,t}\) is the discharging power. Under ideal conditions, the constraint is  
\[0\leq P_{ch,t}\leq P_{b} \tag{2}\]  
\[0\leq P_{dis,t}\leq P_{b} \tag{3}\]  
where \(P_{b}\) is the installed power of BESS. After considering that the charging and discharging process cannot be carried out simultaneously, there must be another constraint which is  
\[P_{ch,t}*P_{dis,t}=0 \tag{4}\]  
The charge and discharge depth should be considered as  
\[\alpha_{1}E_{b}\leq SOC_{t}\leq\alpha_{2}E_{b} \tag{5}\]  
where \(\alpha_{1}\) and \(\alpha_{2}\) represent the lower and upper limits of BESS; \(E_{b}\) represents the energy capacity of BESS. The following objective function is considered:  
\[OF:\min_{P_{Gp},P_{DER},P_{BESS}}\sum_{h} \left[\left(\rho_{G}P_{G}-\rho_{L}P_{L}\right)+\sum_{n_{DER}} \left(f_{gen}(P_{DER})+f_{OM}(P_{DER})\right)+\sum_{n_{BESS}}(f_{BESS}(P_{BESS }))\right] \tag{6}\] \[\text{s.t. (1)-(5);}\] \[P_{G}+\sum_{n_{DER}}(P_{DER})+\sum_{n_{BESS}}(P_{BESS})-P_{L}=0, \ \ \forall h\] (7) \[P_{G}\in\ \left(\underline{P}_{G},\overline{P}_{G}\right);\ P_{DER} \in\ \left(\underline{P}_{DER},\overline{P}_{DER}\right) \tag{8}\]  
where \(h\) denotes hours; \(\rho_{G}\) and \(\rho_{L}\) denote the grid \(-\)purchased/sold energy (market) price and load delivered power, respectively; \(P_{Gp}\) and \(P_{L}\) are the amounts of grid \(-\)purchased/sold and load delivered power, respectively; \(n\), \(n_{DER}\), \(n_{BESS}\) represent the number of all installed/invested units, number of generation units, and the number of BESSs, respectively; \(P_{DER}\), \(f_{gen}\), \(f_{OM}\) indicate the power generated by DERs, the fuel consumption rate of DERs as functions of generated powers, and the operation and maintenance costs of DERs as functions of generated powers, respectively; and \(P_{BESS}\), \(f_{BESS}\) denote the power delivered by BESS and the cost function of BESSs (to model the battery degradation and life cycle effect), respectively. Constraint (7) maintains the production-consumption balance, and constraint (8) imposes grid\(-\)power exchange and DER power generation capacity limits. In islanded operation mode, the microgrid power supply is mainly offered by RESs and BESS. The output of the whole microgrid should realize the real\(-\)time following of load demand changes. In general, there is a large demand for BESS in this operation mode. The EMS takes a load demand, distributed power generation, and SOC of storage battery as input. At the same time, the data are managed and the signals are shown to control the BESS operation. Its control mode mainly exists in the three following situations.