## 4 System Model
### Two-Level Rolling Optimization  
As mentioned in Section 3.2, a hierarchical MPC is adopted to present the system considered in this study. MPC 1 mainly controls the fly wheel, and MPC 2 mainly manages the pumped hydro storage. In contrast, the single-level MPC manages both the pumped hydro storage and the fly wheel. The pumped hydro storage system and one of the MPC controllers are regarded as the outer level, and the fly wheel storage system and the other MPC controller are regarded as the inner level. The outer level and inner level run alternatively to perform real-time scheduling. First, the outer level runs for one scheduling interval for optimization and then stops, thus obtaining long term scheduling results and sending some results to the inner level as input. Next, the inner level performs a short-term scheduling task. For a real-time scheduling system, the solution speed is one of the important system characteristics. In Figure 7, for Case 0, the control horizon is two hours, and the two-hour period is useful for pumped storage because pumped storage mainly addresses the slow fluctuation. To obtain the slow fluctuation by decomposing the wind power, this relatively long control horizon is essential. However, because the flywheel mainly manages turbulence fluctuations, the two hour period is unnecessary for the following reasons: (1) the turbulence fluctuation is difficult to forecast, _i.e._, the accuracy decreases with an increase in the prediction horizon; and (2) the solution time increases with an increase in the prediction horizon. We reduce the prediction horizon when the fly wheel is used. In other words, the prediction horizon of the fly wheel (MPC 1) decreases significantly, and the prediction horizon of the pumped hydro storage (MPC 2) remains unchanged. The reduction of the fly wheel (MPC 1) prediction horizon is performed in the two-level rolling optimization, as shown in Figure 7.  
From Figure 7, it can be noted that at the beginning of scheduling (Case 0), MPC 2, which manages the pumped hydro storage, is on and MPC 1 is off. The MPC2 controller makes decisions based on the two-hour prediction horizon. The decisions include a key one that is the decision of pumped storage. The pumped storage decision is transmitted to the inner MPC (MPC 1) as an input value. In Cases 1-5, the pumped storage value is a constant, not a decision variable at the initial time. Moreover, the prediction of MPC1 is 25, 20, 15, 10, 5 min for the different cases for the above reasons. Let \(t_{s}\) be equal to 0, corresponding to the time when the system is set into operation. The two-level rolling optimization process is presented as follows:  
First (Step 1), when \(t_{s}=0\), the condition is Case 0. Only the MPC 2 controller is available, and the MPC 1 does not make system decisions. The MPC 2 controller obtains information, which is similar to that of the single-level approach; next, MPC 2 makes optimal decisions and then performs these decisions. In addition, the pumped hydro storage operating state is then transferred to the MPC 1 controller. The main purpose of the first step is to carry out a long-term and a look-ahead dispatch when the system begins to work. Because the optimal results contain some of the future information, the results can indicate the tendency of current values. The long-term rolling optimization is used to conduct the macro meteorological fluctuations by controlling the pumped storage. In Step 1, the pumped storage obtains an optimal result, and in case 0, the pumped storage in under control. We can use the following equation to describe the under control pumped storage. \[\text{Case}0:P_{t}^{\text{px}}=p_{t+1}^{\text{px}}=p_{t+2}^{\text{px}}=p_{t+3}^ {\text{px}}=p_{t+4}^{\text{px}}=p_{t+5}^{\text{px}}\ (t=0,6,12,18) \tag{22}\]  
The Equation (22) describes that the pumped storage must keep the work state unchanged for half an hour, and the specific optimal value is decided by the optimal model. Therefore, in case 0, the pumped storage is under control.