# Energy Bus-Based Matrix Modeling and Optimal Scheduling for Integrated Energy Systems
## 5 Case Study
### Analysis of Day-Ahead Optimization Results  
To compare the performance differences between the day-ahead stochastic optimization and deterministic optimization methods and to verify the adaptive ability of stochastic optimization to predict errors, we provide comparative simulation results for day-ahead stochastic optimization and deterministic optimization in the grid-connected mode that forbids the selling of electricity, as shown in Table 3. When testing the prediction data and samples, the input/output of the electricity and cold storage devices are based on the scheduling results of the two optimization methods, while the set points of the other devices need to be recalculated based on the test data. In the sample test, assuming that the source and load data are fully known, the set points of the PGU, absorption chiller, and other devices are calculated, along with the operating costs. The objective function of stochastic optimization is the expected minimum operating cost across multiple samples, while that of deterministic optimization is the minimum operating cost based on the RES and load prediction data. Therefore, when testing with prediction data, where the errors in the RES and load prediction data are zero, the results of deterministic optimization will inevitably be better than those of stochastic optimization. When testing with a set of random samples, where there are some errors in the RES and load prediction data, the results of stochastic optimization are likely to be better than those of deterministic optimization. In random sample testing, stochastic optimization reduces the total daily cost by 1.48% compared to deterministic optimization, reflecting the stronger adaptability of stochastic optimization to prediction errors. Without rolling optimization on the test samples, the IES experiences an over-supply phenomenon. The use of storage devices to store excess electricity, heat, and cold energy can be implemented to revise the scheduling scheme. Without revision, when using all samples of RES and load data to test the two methods, the results, as shown in Figure 16, indicate significant fluctuations in the minimum operating costs for both methods. When the actual output of the RESs is smaller than predicted and the load demands are higher, the operating cost exceeds the expected values; conversely, the costs are below the expectations when the conditions are reversed. It is evident from the majority of the sample tests that the minimum operating costs in stochastic optimization are consistently lower than those in deterministic optimization, demonstrating its stronger adaptability to prediction errors in the RES and load data. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Optimization Strategy** & **Objective Function** & **Prediction Data** & **Sample Testing** \\  & **Value** & **Testing** & \\ \hline Day-ahead stochastic optimization (CNY) & 1568.5 & 1542.2 & 1606.0 \\ Day-ahead deterministic optimization (CNY) & 1511.9 & 1511.9 & 1630.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparative simulation results of day-ahead stochastic optimization and deterministic optimization. Figure 15: WP output real-time forecast curve. Regarding the sample tests, the revised electricity scheduling results for the two methods are shown in Figures 17 and 18. Both methods feature the same power generation for the WP, PV, and electricity demand, with the PGU operating during periods of higher electricity prices and the storage devices effectively performing peak shaving. From 23:00 to 07:00 on the next day, when the purchase price of electricity is lower, it is more economical for the system to buy electricity from the power grid. Comparing the hourly output plans of the devices, it is seen that those of the PGU for the two methods are different.