2.2.2. Model Creation

The model was created using Simulation Studio, which is the main interface of the TRNSYS-18 program. TRNSYS-18 is a component-based program, and the simulation studio allows for the connection of all the components of the simulation together to create a model. The TRNSYS-18 Simulation studio for multi-span greenhouse model is presented in Figure 6 with the types used and their interconnections of this specific multi-span greenhouse BES model. Type-56 is first used to build the model component an interface is called TRNBuild. This is followed by the importation of IDF file for the 3-D model created by Transys3d of the multi-span greenhouse with DOE-2 files for all the cover and screen materials into TRNBuild. Application of the prepared materials into the 3-D TRNBuild is next. The TRNBuild deals with all the parameters and calculations of the greenhouse model, including solar radiation calculation on each surface of the greenhouse, convective, conductive, and radiative heat exchanges, heating and cooling set-points. The greenhouse ground properties, thermal conductivity, capacitance, and density were, 1.89 kJ·h−1·m<sup>−</sup>1·K−1, 1.5 kJ·kg−1·K−1, and 2000 kg·m<sup>−</sup>3, respectively, were also added in TRNBuild. The TRNFLOW, a tool for the calculation of the natural ventilation of the greenhouse, is also included in the TRNBuild interface. TRNBuild combines the thermal and ventilation model of the greenhouse. In simulation studio, the weather data is connected to Type-56 for the simulation of the greenhouse in the real situation. In the simulation studio di fferent types were used to process the weather data and controllers for the dynamic day/night and seasonal control of natural vents opening and closing with inside temperature, screens control with outside solar radiations and heating and cooling set-points. A detailed description of all the specific components (Types) used in this modeling process is presented in Table 4.

**Figure 6.** Transient System Simulation (TRNSYS) Simulation studio multi-span greenhouse model.



#### 2.2.3. Validation of the BES Model

To validate the proposed multi-span greenhouse BES model, the computed internal air temperature of the greenhouse was compared with those obtained experimentally using the same physical and operating conditions. Validation was carried out during a 10-day period in each of the summer and winter seasons of 2019 i.e., 20–29 August, and 1–10 December, respectively. These periods were chosen as operating conditions in greenhouses are di fferent in these two periods. A summary of reference physical and operating conditions of the greenhouse during both time periods is given in Table 5. Furthermore, a statistical analysis of the validation results was performed in quantitative terms using the coe fficient of determination (R2), Equation (1); the root mean square error (RMSE), Equation (2); and the relative root mean square error (rRMSE), Equation (3). The R<sup>2</sup> value ranges between 0 and 1. A value nearer to 1 means the model is very accurate. The RMSE gives the standard deviation of the di fference between computed and measured values. The rRMSR value is considered good if it is <10%, fair if it is <20%, and poor if it is >30%. They are mathematically defined as follows:

$$\mathbf{R}^2 = 1 - \left[ \frac{\sum\_{i=0}^n \left( \mathbf{T}\_i^{\text{exp}} - \mathbf{T}\_i^{\text{sim}} \right)^2}{\sum\_{i=0}^n \left( \mathbf{T}\_i^{\text{exp}} - \mathbf{T}\_i^{\text{mean}} \right)^2} \right] \tag{1}$$

$$\text{RMSE} = \sqrt{\frac{\sum\_{i=0}^{n} \left(T\_i^{\text{exp}} - T\_i^{\text{sim}}\right)^2}{n}} \tag{2}$$

$$\text{rRMSE} = \frac{100}{\text{T}\_{\text{i}}^{\text{exp}}} \left( \sqrt{\frac{\sum\_{i=0}^{n} \left( \text{T}\_{\text{i}}^{\text{exp}} - \text{T}\_{\text{i}}^{\text{sim}} \right)^{2}}{n}} \right) \tag{3}$$

where Texp i is the experimentally obtained internal temperature of the greenhouse, Tsim i is the simulated internal temperature of the greenhouse, Tmean i is the mean of the experimental temperature, and n is the total number of observations.
