## 4 Bi-Level Dispatch and Control Architecture
### Inner-Level Operation Strategy  
The aim of the GVPP is to promote the accommodation of RESs and provide continuous power support. Moreover, in the inner level of the proposed architecture, each GVPP is controlled by its own optimal dispatch agent or emergency response agent according to the operation states of the power system. So the inner-level dispatch and control strategy should be divided into the normal and emergency modes. Considering the functional requirements, the accommodation of RESs and the smooth of net output power are considered in the normal mode. The economic efficiency of each GVPP should be taken into account. Thus, the operation strategy of the normal mode is a multi-objective optimization problem, and the output power of corresponding DERs should be determined. In the normal mode, the optimization objectives can be composed of the operation cost \(C_{G,in}\), the amount of RES curtailment \(R_{C,in}\), the root mean error \(D_{V,in}\) between actual output power and out-level commands, and the standard deviation \(D_{S,in}\) of output power, which are represented as,  
\[ \begin{array}{l}F_{in,nor}(\textbf{P}_{DER})=\left[\begin{array}{cc}f_{in,nor,1}(\textbf{P}_{DER}),&f_{in,nor,2}(\textbf{P}_{DER}),&f_{in,nor,3}(\textbf{ P}_{DER}),&f_{in,nor,A}(\textbf{P}_{DER})\end{array}\right]\\ =\left[\begin{array}{cc}C_{G,in},&R_{C,in},&D_{V,in},&D_{S,in}\end{array} \right]\end{array}  \tag{1}\]  
where \(\textbf{F}_{in,nor}\) is the objective functions of the normal mode and \(\textbf{F}_{in,nor}\in\textbf{R}^{4\times 1}\), \(f_{in,nor,1}\), \(f_{in,nor,2}\), \(f_{in,nor,3}\), and \(f_{in,nor,4}\) are corresponding objective functions; \(\textbf{P}_{DER}\) are the decision variables and,  
\[\textbf{P}_{DER}=\left[ \begin{array}{cc}\textbf{P}_{T},&\textbf{P}_{R},& \textbf{P}_{E},&\textbf{P}_{D}\end{array} \right] \tag{2}\]  
where \(\textbf{P}_{T}\), \(\textbf{P}_{R}\), \(\textbf{P}_{E}\), and \(\textbf{P}_{D}\) are the commands for traditional generators, RESs, ESSs, and controllable loads, respectively, and \(\textbf{P}_{T}\in\textbf{R}^{N_{g}\times N_{i}}\), \(\textbf{P}_{R}\in\textbf{R}^{N_{r}\times N_{i}}\), \(\textbf{P}_{E}\in\textbf{R}^{N_{c}\times N_{i}}\), and \(\textbf{P}_{D}\in\textbf{R}^{N_{d}\times N_{j}}\); \(N_{i}\) is the length of optimization window; \(N_{g}\), \(N_{r}\), \(N_{e}\), and \(N_{d}\) are the number of deployed traditional generators, RESs, ESSs, and controllable loads, respectively. Additionally, some equality and inequality constraints should be satisfied, which can be represented as,  
\[\textbf{H}_{in,nor}(\textbf{P}_{DER})=0 \tag{3}\]  
\[\textbf{G}_{in,nor}(\textbf{P}_{DER})\leq 0 \tag{4}\]  
where \(\textbf{H}_{in,nor}\) and \(\textbf{G}_{in,nor}\) are the functions of equality and inequality constraints, respectively, and,  
\[\textbf{H}_{in,nor}=\left[ \begin{array}{cc}\textbf{H}_{in,nor,PS},&\textbf{H }_{in,nor,RE},&\textbf{H}_{in,nor,T},&\textbf{H}_{in,nor,R},&\textbf{H}_{in,nor,E},&\textbf{H}_{in,nor,D}\end{array} \right] \tag{5}\]  
\[\textbf{G}_{in,nor}=\left[ \begin{array}{cc}\textbf{G}_{in,nor,PS},&\textbf{G}_ {in,nor,RE},&\textbf{G}_{in,nor,T},&\textbf{G}_{in,nor,R},&\textbf{G}_{in,nor, E},&\textbf{G}_{in,nor,D}\end{array} \right] \tag{6}\]  
where \(\textbf{H}_{in,nor,PS}\), \(\textbf{H}_{in,nor,RE}\), \(\textbf{H}_{in,nor,T}\), \(\textbf{H}_{in,nor,R}\), \(\textbf{H}_{in,nor,E}\), and \(\textbf{H}_{in,nor,D}\) are the equality constraints of power flow and stability, power reserve, traditional generators, RESs, ESSs, and controllable loads, respectively; \(\textbf{G}_{in,nor,PS}\), \(\textbf{G}_{in,nor,RE}\), \(\textbf{G}_{in,nor,T}\), \(\textbf{G}_{in,nor,R}\), \(\textbf{G}_{in,nor,E}\), and \(\textbf{G}_{in,nor,D}\) are the inequality constraints of power flow and stability, power reserve, traditional generators, RESs, ESSs, and controllable loads, respectively. Therefore, the optimization model for the inner-level GVPP operation in the normal mode can be expressed as,  
\[