**5.3. The networks and their estimates**

The "*soft evidence*" instantiation strategy presented in section 5.2 has been implemented in a java library that wraps HuginTM reasoning engine and allows also for other high-level func‐ tionalities, like multiple network iterations and interconnection between different networks that shares the same variables. This library is able to get the set of variables describing the current state of the station and to initialize with them the first network to be queried. Then, it is able to perform probabilistic inference by running the HuginTM application and to extract the outputs, which will be transferred to the second network to be queried according to the procedure already shown in Fig. 7. This is done *H* times, if *H* is the desired prediction horizon.

The same functions has been also integrated in an excel spreadsheet for validating BNs. The two networks were combined according to the scheme depicted in Fig. 7 and used to simulate the predictive control. Fig. 10 shows the prediction results for one typical day (in blue), i.e. prediction horizon *H* =24 hours, compared with the simulation results achievable from the Dymola model (shown in red), regarding the main outputs: expected energy consumption by one of the station' fans (6a), overall airflows coming from outdoor air (6b) and future temper‐ ature (6c) plots in the platform of Line 3. In order to assess the level of accuracy of such predictions, Table 2 shows the corresponding *RMSE* and *NRMSE* relative to the variables plotted on Fig. 10. The agreement between the real plots and the estimated one is very good at each prediction time, especially for the energy consumption, that is one of the key variables influencing the cost function described in paragraph 6.2 and, as a consequence, the results of the loop managed by the controller.

**6. The Passeig de Gracia simulator case study**

to the outside through the station's spaces.

In this section, we will report the implementation of a Bayesian Network predictor for the environmental control of the aforementioned test-bed given by *Passeig De Gracia* (PdG) metro station in Barcelona, Spain. The purpose of this section is to provide readers with an example regarding how Bayesian Networks can be embedded within a large MPC control framework, and how their predictions can be exploited for optimal control. The environmental control has been based on MPC because of the great complexity of the thermal and airflow dynamics in the underground environment, and of the time length of their characterising constants. The metro station underground environment is mainly characterised by huge thermal inertia caused by the terrain surrounding the station, and by relevant contributions to the indoor temperature and pollutants levels provided by air flows. Indoor air flows are determined by a number of sources that influence the station with different time frequencies and during different daytimes. The outdoor wind flow, quite frequent in a coastal station like Barcelona, affects directly the shallowest levels of the station, and determine the air pressure configuration at the interfaces of the deepest levels that may favour or impede the mechanically air supply, depending on their mutual disposal. The train transit causes the well-known piston effect. The approaching trains act as pistons compressing the air into the station platform, and leaving trains act as pulling pistons, reversing the flows. The frequency of this effect depends on the train schedule and, in our case, can be assumed about 180 sec on the average. The train piston effect causes relatively high-speed air transients with many local turbulences that affect also the platform neighbouring spaces. A third relevant source of air exchange, which is usually neglected in standard analyses, is due to the air buoyancy caused by the temperature difference between the indoor and the outdoor environments. This effect becomes substantial during the night, because of the absence of the other sources and of the greater temperature difference. Buoyancy effect causes relatively slow and laminar airflows that move air form the rail tunnels

Bayesian Networks for Supporting Model Based Predictive Control of Smart Buildings

http://dx.doi.org/10.5772/58470

27

Within this scenario, the problem of controlling the forced ventilation in an optimal way, through the fan speed, cannot be approached but with an MPC technology. Within the MPC framework, the definition of the weighting coefficients of the cost function, that maximize energy saving without compromising comfort and air quality in different operating conditions (see section 6.2), and without affecting normal operation of the station (due to safety reasons), required the development of a co-simulation architecture. Thus, the Bayesian predictor and the MPC logics has been embedded in a simulation environment that accurately reproduces the thermal and air-flow dynamics of the outdoor and indoor environments, and the trains and passenger flows. The development of the models that contribute to the simulation environment required in depth preliminary analysis by means of Finite Element Modelling, and a number of on-site surveys, that became necessary to determine the magnitude of the phenomena and to subsequently calibrate the models. Once they have been calibrated and included in the simulation architecture, the environmental models resemble the same dynamic

of the measured environment, thus allowing for scenario analysis and control sizing.

Figure 10.Fig. 10: Comparison between real energy consumption of station fan PELSF1 and the estimated one by AF-BN (a), the real air change per hour and the estimation by AF-BN (b) and comparison between the real PL3 temperature and the estimation by TP-DBN (c). **Figure 10.** Comparison between real energy consumption of station fan PELSF1 and the estimated one by AF-BN (a), the real air change per hour and the estimation by AF-BN (b) and comparison between the real PL3 temperature and the estimation by TP-DBN (c).

7. The Passeig de Gracia simulator case study


environment, and of the time length of their characterising constants. The metro station underground **Table 2.** Errors obtained for the whole prediction cycle with *H*=24 hours in the three prediction cases shown in Fig. 10.
