# Operation Scheduling Optimization for Microgrids Considering Coordination of Their Components
## 2 Problem Framework
### Formulation of Target Problem
* Balance of power supply and demand \[d_{t}=\sum\
olimits_{i=1}^{\text{NG}}g_{i,t}u_{i,t}+\sum\
olimits_{j=1}^{\text {NS}}s_{j,t}+\sum\
olimits_{k=1}^{\text{N}V}v_{k,t}+\Big{(}e_{t}+e_{t}^{ \prime}\Big{)},\ \text{for}\ \forall t.\] (9)
* State duration for CGs \[g_{i,t}\in\left[G_{i}^{min},G_{i}^{max}\right],\text{ for }\forall i,\,\forall t, \tag{2}\]0 (10) where \(u_{i,t}^{on}\) and \(u_{i,t}^{off}\) are the consecutive operating and suspending durations of CGs; and \(MUT_{i}\) and \(MDT_{i}\) are the minimum operating and suspending durations of CGs. * Ramp rate for CGs \[g_{i,t}\in\left[G_{i}^{min},G_{i}^{max}\right],\text{ for }\forall i,\,\forall t, \tag{2}\]1 (11) where \(\Delta G_{i}^{up}\) and \(\Delta G_{i}^{down}\) are the ramp-up and the ramp-down rates of CGs. * Maximum and minimum outputs for CGs \[ \begin{split} g_{i,t}^{min}\leq g_{i,t}\leq g_{i,t}^{max},\ \text{for}\ \forall i,\ \forall t,\\ \Big{(}g_{i,t}^{max}=\min\Big{(}G_{i}^{max},g_{i,t-1}+\Delta G_{i} ^{up}\Big{)}\,;\ g_{i,t}^{min}=\max\Big{(}G_{i}^{min},g_{i,t-1}+\Delta G_{i} ^{down}\Big{)}\Big{)},\end{split} \] (12) where \(g_{i,t}^{max}\) and \(g_{i,t}^{min}\) are the maximum and the minimum outputs for CGs at \(t\). * State for ESSs \[ \begin{split} Q_{j}^{min}\leq q_{j,t}\leq Q_{j}^{max},\ \text{for}\ \forall j,\ t\in TS_{j},\\ \Big{(}\text{If}\ s_{j,t}\leq 0\ \text{then}\ q_{j,t}=q_{j,t-1}- \eta_{j}s_{j,t};\ \text{If}\ s_{j,t}>0\ \text{then}\ q_{j,t-1}-\tfrac{1}{\eta_{j}}s_{j,t} \Big{)},\end{split} \] (13) where \(q_{j,t}\) is the state-of-charge (SOC) level in ESSs; \(Q_{j}^{max}\) and \(Q_{j}^{min}\) are the maximum and the minimum SOC levels of ESSs; and \(\eta_{j}\) is the overall efficiency of ESSs. * Maximum and minimum outputs for ESSs \[ \begin{split} s_{j,t}^{min}\leq s_{j,t}\leq s_{j,t}^{max},\ \text{for}\ \forall j,\ t\in TS_{j},\\ \Big{(}s_{j,t}^{max}=\min\Big{(}S_{j}^{max},q_{j,t-1}-Q_{j}^{min} \Big{)}\,;\ s_{j,t}^{min}=\max\Big{(}S_{j}^{min},q_{j,t-1}-Q_{j}^{max}\Big{)} \Big{)},\end{split} \] (14) where \(s_{j,t}^{max}\) and \(s_{j,t}^{min}\) are the maximum and the minimum outputs for ESSs at \(t\). * State for CLs \[P_{k}^{min}\leq p_{k,t}\leq P_{k}^{max},\text{ for }\forall k,\text{ }t\in TV_{k}, \text{ }\Big{(}p_{k,t}=p_{k,t-1}-\xi_{k}v_{k,t}\Big{)},\] (15) where \(p_{k,t}\) is the SOC level in CLs; \(P_{k}^{max}\) is the maximum SOC level of CLs; and \(\xi_{k}\) is the overall efficiency of CLs. * Maximum consumption for CLs \[v_{k,t}^{min}\leq v_{k,t}\leq 0,\text{ for }\forall k,\text{ }t\in TV_{k}, \Big{(}v_{k,t}^{min}=\max\Big{(}V_{k}^{min},p_{k,t-1}-P_{k}^{max}\Big{)}\Big{)},\] (16) where \(v_{k,t}^{min}\) is the maximum consumption for CLs at \(t\). In summary, the target optimization problem is to determine the operation schedule, \((u,\text{ }g,s,v,e)\), which minimizes the objective function (7) under constraints (9)-(16). Here, electricity trading is classified into \(e_{t}\) and \(e_{t}^{\prime}\) for calculating the expected values of the trading cost and the imbalance penalty individually. By using (9), (12), (14), and (16), we can calculate the expected imbalance electricity, \(e_{t}^{\prime}\), as  
\[\left\{ \begin{array}{l}\text{If }d_{t}-e_{t}<\sum_{i=1}^{\text{NG}}S_{i,t}^{ min}u_{i,t}+\sum_{j=1}^{\text{NS}}s_{j,t}^{min}+\sum_{k=1}^{\text{NV}}v_{k,t}^{ min}\text{ then }\\ e^{\prime}{}_{t}=d_{t}-e_{t}-\left(\sum_{i=1}^{\text{NG}}S_{i,t}^{min}u_{i,t}+ \sum_{j=1}^{\text{NS}}s_{j,t}^{min}+\sum_{k=1}^{\text{NV}}v_{k,t}^{min}\right) \\ \text{ If }d_{t}-e_{t}>\sum_{i=1}^{\text{NG}}s_{i,t}^{max}u_{i,t}+\sum_{j=1}^{ \text{NS}}s_{j,t}^{max}\text{ then }\\ e_{t}^{\prime}=d_{t}-e_{t}-\left(\sum_{i=1}^{\text{NG}}S_{i,t}^{max}u_{i,t}+ \sum_{j=1}^{\text{NS}}s_{j,t}^{max}\right)\\ \text{ Else }e_{t}^{\prime}=0\end{array} \right.. \tag{17}\]  
The reserve margin is automatically secured by (7) and (17) (depending on the expected operational cost in the microgrid).