# Hierarchical Optimization Method for Energy Scheduling of Multiple Microgrids
## Appendix A  
It is assumed that  
\[C_{ex}=\sum_{p^{h}_{cs}<p^{h,\min}_{s,i}}l^{h,\max}_{b,i}+\sum_{p^{h}_{cs}>p^{h, \max}_{s,i}}\max(l^{h,\min}_{i},pv^{h}_{i}-e^{h}_{i})D^{h}_{b,i}+\sum_{D^{h}_{b,i}=1}e^{h}_{i}-pv^{h}_{i}, \tag{32}\]  
\[C_{im}=\sum_{p^{h}_{cs}>p^{h,\max}_{s,i}}l^{h,\min}_{i}D^{h}_{s,i}+\sum_{p^{h} _{cb}<p^{h,\min}_{b,i}}\min(pv^{h}_{i}-e^{h}_{i},l^{h,\max}_{i})D^{h}_{s,i}+ \sum_{D^{h}_{s,i}=1}e^{h}_{i}-pv^{h}_{i}. \tag{33}\]  
Thus, expressions (32) and (33) can be simplified as  
\[E^{ho}_{ex}=\sum_{p^{h}_{s,i}\leq p^{h}_{cs}\leq p^{h,\max}_{s,i}}\left(\frac {k^{h}_{i}}{p^{h}_{cs}}-1\right)+C_{ex}, \tag{34}\]  
\[E^{ho}_{im}=\sum_{p^{h}_{b,i}\leq p^{h}_{cs}\leq p^{h,\max}_{b,i}}\left(\frac {k^{h}_{i}}{p^{h}_{cb}}-1\right)+C_{im}. \tag{35}\]  
By substituting (42) and (43) into (34), the objective function of the EMO in sub-region \(\forall s\in S\) is described as:  
If \(E^{ho}_{im}<E^{ho}_{ex}\)  
\[ \begin{array}{ll}Pro^{h}_{EMO}&=p^{h}_{cs}(\sum\limits_{p^{h}_{s,i}\leq p^{ h}_{cs}\leq p^{h,\max}_{s,i}}\left(\frac{k^{h}_{i}}{p^{h}_{cs}}-1\right)D^{h}_{b,i}+C_{ex})-p^{h} _{cb}(\sum\limits_{p^{h}_{b,i}\leq p^{h}_{cb}\leq p^{h,\max}_{b,i}}\left(\frac {k^{h}_{i}}{p^{h}_{cb}}-1\right)D^{h}_{s,i}+C_{im})\\ &+p^{h}_{gb}(\sum\limits_{p^{h}_{b,i}\leq p^{h}_{cb}\leq p^{h,\max}_{b,i}}\left( \frac{k^{h}_{i}}{p^{h}_{cb}}-1\right)D^{h}_{s,i}+C_{im})-p^{h}_{gb}(\sum\limits _{p^{h}_{s,i}\leq p^{h}_{bs}\leq p^{h,\max}_{s,i}}\left(\frac{k^{h}_{i}}{p^{h} _{cs}}-1\right)D^{h}_{b,i}+C_{ex})\end{array}  \tag{36}\]  
If \(E^{ho}_{im}\geq E^{ho}_{ex}\)  
\[ \begin{array}{ll}Pro^{h}_{EMO}&=p^{h}_{cs}(\sum\limits_{p^{h}_{s,i}\leq p^{ h}_{cs}\leq p^{h,\max}_{s,i}}\left(\frac{k^{h}_{i}}{p^{h}_{cs}}-1\right)D^{h}_{b,i}+C_{ ex})-p^{h}_{cb}(\sum\limits_{p^{h}_{b,i}\leq p^{h,\max}_{cs}\leq p^{h,\max}_{b,i}} \left(\frac{k^{h}_{i}}{p^{h}_{cb}}-1\right)D^{h}_{s,i}+C_{im})\\ &+p^{h}_{gs}(\sum\limits_{p^{h}_{b,i}\leq p^{h,\max}_{s}\leq p^{h,\max}_{b,i}} \left(\frac{k^{h}_{i}}{p^{h}_{cb}}-1\right)D^{h}_{s,i}+C_{im})-p^{h}_{gs}( \sum\limits_{p^{h}_{s,i}\leq p^{h,\max}_{cs}\leq p^{h,\max}_{s,i}}\left(\frac {k^{h}_{i}}{p^{h}_{cs}}-1\right)D^{h}_{b,i}+C_{ex})\end{array}  \tag{37}\]where \((p_{cb}^{h},p_{cs}^{h})\in s\), and \(p_{cb}^{h}<p_{cs}^{h}\). Therefore, the Hessian matrix of \(Pro_{EMO}^{h}\) is  
\[\mathbf{H}=\left\{ \begin{array}{ccc}-\frac{2p_{cb}^{h}}{p_{cb}^{h}} \sum\limits_{p_{cs}^{h}\leq p_{cs}^{h}\leq p_{cs}^{h,\max}}D_{b,i}^{h}k_{i}^{h}& 0\\ 0&\frac{2p_{gb}^{h}}{p_{cb}^{h}}\sum\limits_{p_{h,i}^{h,\min}\leq p_{cb}^{h} \leq p_{cb,i}^{h,\max}}D_{s,i}^{h}k_{i}^{h}\\ -\frac{2p_{cs}^{h}}{p_{cb}^{h}}\sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\max}} D_{b,i}^{h}k_{i}^{h}&0\\ 0&\frac{2p_{cs}^{h}}{p_{cb}^{h}}\sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\min}} \sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\max}}D_{s,i}^{h}k_{i}^{h}\\ \end{array} \right.,E_{im}^{ho}<E_{ex}^{ho}\\ -\frac{2p_{cs}^{h}}{p_{cb}^{h}}\sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\max}} D_{b,i}^{h}k_{i}^{h}&0\\ 0&\frac{2p_{cs}^{h}}{p_{cb}^{h}}\sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\min}} \sum\limits_{p_{cb}^{h}\leq p_{cb,i}^{h,\max}}D_{s,i}^{h}k_{i}^{h}\\ \end{array}\right.,E_{im}^{ho}\geq E_{ex}^{ho} \tag{38}\]  
Consider the fact that \(k_{i}^{h}>0\), \(p_{gb}^{h}>0\), \(p_{gs}^{h}>0\), \(p_{cs}^{h}>0\), \(p_{cb}^{h}>0\)\(\forall i\in N,h\in H\), \(H\) is thus negative definite and \(Pro_{MGC}^{h}\) is strictly concave with respect to \(p_{cs}^{h}\) and \(p_{cb}^{h}\). Appendix B Formulas (26) and (27) show that if \(p_{cs,i}^{h}\
otin[p_{cs,i}^{h,\min},p_{cs,i}^{h,\max}]\), then \(\partial U_{i}^{h}/\partial p_{cs,i}^{h}=0\), and if \(p_{cb,i}^{h,\min}\
otin[p_{cb,i}^{h,\min},p_{cb,i}^{h,\max}]\), then \(\partial U_{i}^{h}/\partial p_{cb,i}^{h}=0\). Therefore, we mainly discuss the case of \(p_{cs,i}^{h}\in[p_{cs,i}^{h,\min},p_{cs,i}^{h,\max}]\) and \(p_{cb,i}^{h}\in[p_{cb,i}^{h,\min},p_{cb,i}^{h,\max}]\).