*3.3. Simulation Platform*

A dynamic simulation platform integrating TRNSYS and MATLAB was constructed to test the performance of the proposed optimal control approaches. The platform layout was shown in Figure 6. The used TRNSYS models were verified by measured data with acceptable model accuracies. The model details are presented in Table 3. The control logics presented in Section 2 were coded in MATLAB. The simulation duration for each run was 24 h, with a simulation time step of 30 s. Several typical loads and weather data are simulated. The computer used to perform the simulation has a six-core processor (3.60 GHz) with 16 GB RAM. Since cooling load and weather data are crucial for the AC optimal control, actual load and weather data were input to the TRNSYS simulation to mimic the actual operations. The airflow rate was calculated based on the cooling load and the enthalpy difference between the supply air (the temperature set-point with 95% relative humidity) and the room air (set as 25 ◦C with 50% relative humidity).

**Figure 6.** Transient System Simulation Tool (TRNSYS) model (screenshot).


#### **Table 3.** TRNSYS model and description.

## *3.4. Ideal SCOP Model*

To develop an ANN model for predicting the ideal SCOP, important variables that have significant influence on the SCOP were firstly identified. Basically, important variables that affect the SCOP are similar in typical AC systems that contain chillers, cooling towers, pumps and AHUs/Coils [16,32]. The variables include the outdoor dry/wet-bulb temperature (*Tdb*/*Twb*), the chilled water supply temperature (*Tschw*), the condensing water return temperature (*Tscw*), the chilled water mass flow rate at the primary/secondary loop (*Mw*,*prm*,*pump*/*Mw*,*sec*,*pump*), the PLR, the cooling tower fan frequency (*Freqct*, *f an*) and the enthalpy driving force in the operation of cooling towers "Δ*h*" [33].

To evaluate the variable importance, the RF algorithm was implemented in the software R using the package of "randomForest" [34] and the results were plotted in Figure 7. The variable PLR has the highest importance, while the Mw,sec,pump has the lowest importance. As discussed in [35], less important variables (e.g., % IncMSE lower than 10%) can be omitted. Therefore, Mw,sec,pump was not used in the ideal SCOP model, and totally eight variables were used as the ANN model inputs.

In the ANN model, 70% of the data set was used for training, 15% of the data set was used for validation and the additional 15% of the data set was used to test whether the model can perform well. Since the optimal number of the hidden layer neurons depends upon the specific problem, this study tested a different number of hidden neurons (from 2 to 20). The MSEs of different numbers of hidden neurons were plotted in Figure 8. Figure 8. shows that when the number of neurons increased, the MSE decreased. However, the reduction in MSE became insignificant as the number of neurons was greater than 15. Thus, "15" was selected as the optimal number of hidden neurons. The R-value of the ANN model with 15 hidden neurons was 0.96052 (see Figure 9), with R values of training, validation and test are 0.96007, 0,95783 and 0.9656 respectively, which showed a good prediction accuracy.

**Figure 7.** Results of random forest (higher %IncMSE means more important).

**Figure 8.** Number of ANN hidden neurons vs. mean squared error (MSE).

**Figure 9.** Regression plots of the ANN model (with "15" hidden neurons).
