**Table 6.** Architectures of the investigated ANNs.

The following 10 variables have been set as inputs of all ANNs:


The following five parameters have been set as outputs of all ANNs:


Table 7 summarizes the inputs and the outputs used in the artificial neural networks. Each ANN has 1 input layer with 10 neurons and 1 output layer with 5 neurons.


**Table 7.** Inputs and outputs of the ANNs.

The hyperbolic tangent sigmoid transfer function (tansig) has been adopted in the hidden and output layers of each ANN. Levenberg–Marquart back-propagation training algorithms (trainlm) have been selected as training function with the aim of updating the weights and biases.

#### 4.1.3. Training, Testing and Validation of ANNs

The experimental data measured during the tests described in Section 3 have been used for training, testing, and validating the ANNs. Two different datasets have been randomly extracted from the entire database (5352 data points in total): the first dataset (3746 points) has been utilized for training purposes, while the second one (1606 points) has been considered for testing and validating the networks. The predictions of the ANN-based models have been compared with the whole experimental dataset (containing all training, testing, and validation points) to evaluate the reliability of the ANNs by means of the metrics reported below (the average error ε, the average absolute error |ε|, the mean square error MSE, the root mean square error RMSE, and the coefficient of determination R2):

$$
\varepsilon\_{\text{i}} = \mathbf{g}\_{\text{pred,i}} - \mathbf{g}\_{\text{exp,i}} \tag{1}
$$

$$\overline{\varepsilon} = \sum\_{i=1}^{N} \varepsilon\_i / \mathcal{N} \tag{2}$$

$$|\overline{\varepsilon}| = \sum\_{i=1}^{N} |\varepsilon\_i| / \mathcal{N} \tag{3}$$

$$\text{MSE} = \frac{1}{\text{N}} \sum\_{i=1}^{\text{N}} (\varepsilon\_i - \overline{\varepsilon}) \tag{4}$$

$$\text{RMSE} = \sqrt{\sum\_{i=1}^{N} \frac{\left(\varepsilon\_i - \overline{\varepsilon}\right)^2}{N}} \tag{5}$$

$$\mathbf{R}^2 = 1 - \left[ \sum\_{\mathbf{i}=1}^{N} \frac{\left( \mathbf{g}\_{\text{exp},\mathbf{i}} - \mathbf{g}\_{\text{pred},\mathbf{i}} \right)^2}{\left( \mathbf{g}\_{\text{exp},\mathbf{i}} - \overline{\mathbf{g}}\_{\text{pred},\mathbf{i}} \right)^2} \right] \tag{6}$$

where N is the total number of experimental points, while gpred,i, gexp,I, and gpred are, respectively, the predictions at time step i, the measurements at time step i, and the arithmetic mean of the predicted values. Table 8 reports the calculated values of ε, |ε|, MSE, RMSE, and R2 associated with the performance of all the ANNs developed in this study, highlighting in green and red, respectively, the best and worst results.


**Table 8.** Errors between predictions of ANN-based models and measurements.

For each line of Table 8 the green shade has been assigned to the cell corresponding to the best performance (the readers can find more green cells for each line in the cases of more ANNs achieve the same best performance), while the worst results have been highlighted by red shades.

The results reported in this table highlight that:


and supply air relative humidity. The percentage difference between the ANN16 and the ANN22 in predicting TSA is 27% in terms of |ε|, 40% in terms of MSE, 22% in terms of RMSE, and 0.21% in terms of R2. The percentage difference between the ANN16 and the ANN22 in predicting RHSA is 11% in terms of |ε|, 7% in terms of MSE, 4% in terms of RMSE, and 0.21% in terms of R2;

• ANN22 provides better results than ANN16 in predicting the opening percentages of the post-heating coil valve, the cooling coil valve as well as the humidifier valve. The maximum percentage difference in terms of |ε| between the ANN22 and the ANN16 in predicting OPV\_PostHC, OPV\_CC and OPV\_HUM is 26%; the maximum percentage difference in terms of MSE between the ANN22 and the ANN16 in predicting OPV\_PostHC, OPV\_CC, and OPV\_HUM is 21%; the maximum percentage difference in terms of RMSE between the ANN22 and the ANN16 in predicting OPV\_PostHC, OPV\_CC and OPV\_HUM is 11%; the maximum difference in terms of R<sup>2</sup> between the ANN22 and the ANN16 in predicting OPV\_PostHC, OPV\_CC, and OPV\_HUM is 1.13%.

Even if the ANN22 performs better than the ANN16 in predicting the opening percentages of the valves, in this paper the ANN16 has been selected in order to obtain improved predictions in terms of supply air temperature as well as supply air relative humidity (that represent the fundamental outputs of AHU operation), while maintaining an adequate accuracy in forecasting the valves operation. The errors reported in Table 8 demonstrate how the ANN16 can be effectively used to generate operation data for assisting further research in fault detection and diagnosis of HVAC units.

Figures 6–9 report the instantaneous errors between the values predicted by the ANN16 and the measured data in terms of (i) supply air temperature (TSA), (ii) supply air relative humidity (RHSA), (iii) opening percentage of the post-heating coil valve (OPV\_PostHC), (iv) opening percentage of the cooling coil valve (OPV\_CC), and (v) opening percentage of the humidifier valve (OPV\_HUM) as a function of time.

**Figure 6.** Comparison between ANN16 predicted values and experimental data under fault free tests during summer: test n. 1 (**a**), test n. 2 (**b**), test n. 3 (**c**), and test n. 4 (**d**).

**Figure 7.** Comparison between ANN16 predicted values and experimental data under faulty tests during summer: test n. 5 (**a**), test n. 6 (**b**), test n. 7 (**c**), test n. 8 (**d**), and test n. 9 (**e**).

**Figure 8.** *Cont*.

**Figure 8.** Comparison between ANN16 predicted values and experimental data under fault free tests during winter: test n. 10 (**a**), test n. 11 (**b**), test n. 12 (**c**), and test n. 13 (**d**).

**Figure 9.** Comparison between ANN16 predicted values and experimental data under faulty tests during winter: test n. 14 (**a**), test n. 15 (**b**), test n. 16 (**c**), test n. 17 (**d**), and test n. 18 (**e**).

In more detail, the following parameters are showed in Figures 6–9:

$$
\Delta T\_{\rm SA} = T\_{\rm SA,pred} - T\_{\rm SA,exp} \tag{7}
$$

$$
\Delta \text{RH}\_{\text{SA}} = \text{RH}\_{\text{SA}, \text{pred}} - \text{RH}\_{\text{SA}, \text{exp}} \tag{8}
$$

$$
\Delta\text{OP}\_{\text{V\\_PostHC}} = \text{OP}\_{\text{V\\_PostHC}, \text{pred}} - \text{OP}\_{\text{V\\_PostHC}, \text{exp}} \tag{9}
$$

$$
\Delta \text{OP}\_{\text{V}\text{-CC}} = \text{OP}\_{\text{V}\text{-CC}, \text{pred}} - \text{OP}\_{\text{V}\text{-CC}, \text{exp}} \tag{10}
$$

$$
\Delta \text{OP}\_{\text{V\\_HUM}} = \text{OP}\_{\text{V\\_HUM}, \text{pred}} - \text{OP}\_{\text{V\\_HUM}, \text{exp}} \tag{11}
$$

where TSA, pred, RHSA, pred, OPV\_PostHC, pred, OPV\_CC, pred, and OPV\_HUM, pred are, respectively, the values predicted by the ANN16, while TSA, exp, RHSA, exp, OPV\_PostHC, exp, OPV\_CC, exp, and OPV\_HUM, exp represent the experimental values.

Figures 6–9 highlight that:


In order to better point out the results of comparisons between predicted and experimental values reported in Figures 6–9, the values of the metrics defined by the Equations (1)–(6), calculated for the parameters specified by the Equations (7)–(11), have been summarized in Table 9. For each line of this table, the green shade has been assigned to the cells corresponding to the best performance, while the worst results have been highlighted by red shades.


**Table 9.** Errors between the ANN16-based model predictions and experimental points.

This table underlines that the ANN16 is able to carefully predict the experimental data measured during summer and winter under both normal and faulty conditions and it provides a rigorous representation of the HVAC system's steady-state and transient operation taking into account that:

