Deterministic and stochastic modelling of greenhouse microclimate

ABSTRACT In order to improve the yield and quality of greenhouse crops, it is necessary to develop a reliable model to predict and control the microclimate of greenhouse. In this paper, the problem of deterministic and stochastic modelling for greenhouse microclimate defined by the variables of temperature and humidity is considered. Experiments were conducted in a naturally ventilated single-sloped greenhouse without crops in north China. Firstly, a mechanism model is adopted and the assumed unknown parameters are derived by using increased convergence factor particle swarm optimization algorithm. Secondly, considered the disturbance is independent identically distributed white noise, a stochastic dynamic model is constructed and the parameters are obtained by using maximum likelihood estimate. Finally, a comparison of measured and simulated data is given to show that the proposed models can reasonably forecast internal greenhouse microclimate.


Introduction
Greenhouse, which is covered with thin and transparent materials, protect the plantations from bad weather so as to supply the suitable environment for plant growing (Bennisa, Duplaix, Enéa, Haloua, & Youlal, 2008). To obtain a favourable internal environment, a mathematical model that describes the dynamic behaviour of the greenhouse climate is often required. But obtaining such model is usually a complex task because of many influencing factors, such as global radiation, wind speed and direction, external air temperature and humidity, internal floor temperature and plant, and so on.
General speaking, there are two different methods for computing the model of greenhouse climate (Perez-Gonzalez, Begovich-Mendoza, & Ruiz-Leon, 2018). The first one is called black-box modelling, which is based on analysis the causal link between the input-output data in the process. In this modelling methodology, the models of greenhouse climate are often constructed by using intelligent algorithms, such as particle swarm optimization (PSO), genetic algorithm (Wang, Wang, & Qiao, 2009), support vector machine (Hasni, Taibi, Draoui, & Boulard, 2011), neural network (Taki, Ajabshirchi, Ranjbar, Rohani, & Matloobi, 2016), etc. The black-box modelling has the disadvantage that there is no physical meaning for system parameters and the obtained model has poor universality. The second methodology is known as mechanism modelling, which is based on the physical laws of the process. There are CONTACT Hua Yang 331336198@qq.com numerous results have been proposed based on this modelling method (Bai, Wang, Sheng, & Wang, 2018;Bai, Wang, Zou, & Alsaadi, 2018;Bot, 1983;Jolliet, 1994;Joudi & Farhan, 2015;Kimball, 1994;Kothari & Panwar, 2007;Liu, Jin, Shen, & Linge, 2015;Su & Xu, 2017). By studying some energy and mass exchange processes, the greenhouse climate was given through combining the major physical processes into a physical model (Bot, 1983). The energy balance of a greenhouse was set up by experimental data (Kimball, 1994). The model humidity and transpiration was constructed (Jolliet, 1994). A model of greenhouse microclimate was proposed by analysing energy and mass transfer processes (Kothari & Panwar, 2007). A model of inside air and soil temperature is presented in Iraq (Joudi & Farhan, 2015). A discrete greenhouse climate model, which is defined by three state variables including the indoor temperature, humidity and CO 2 concentration, was presented (Su & Xu, 2017). Nevertheless, in the mechanism modelling methodology, the proposed models are often differential equations and have a very complex structure, due to too many variables and the diversification of parameters. From the aforementioned modelling methods, we know that the first methodology has poor universality and the second methodology requires a complicated process of instrumentation and experimentation. Motivated by this, a new modelling idea of combining the mechanism method and the black-box method is proposed. A mechanism model is adopted and assuming the constant coefficients of the energy and mass balance equations are unknown. Then, these unknown parameters are selected by using an intelligent algorithm based on the inputoutput data. The PSO, a recently developed stochastic efficient optimization algorithm, shows excellent ability to optimized a greenhouse climate model. Considering the convergence rate, the increased convergence factor particle swarm optimization (ICFPSO) algorithm is adopted to solve the parameters because of its effectiveness in dealing with the optimization of complex functions. On the other hand, research on stochastic modelling has been an interesting topic over the past decades (Dalal, Greenhalgh, & Mao, 2008;Litago et al., 2005;Nielsen & Madsen, 1998), since real life is stochastic rather than deterministic, particularly when modelling natural phenomena such as atmospheric pressure dynamics. The stochastic modelling for greenhouse dynamic system has been investigated (Litago et al., 2005;Nielsen & Madsen, 1998) in order to improve the accuracy of the simulated model. Motivated by the above discussions, in this paper, our purpose is to construct the deterministic and stochastic modelling for greenhouse microclimate defined by the variables of temperature and humidity. The main contributions of this paper can be highlighted as follows: (1) a new modelling idea of combining the mechanism method and the black-box method is proposed; (2) the stochastic modelling for greenhouse dynamic system has been investigated.
In this paper, we tackle the problems of deterministic and stochastic modelling for a single-sloped greenhouse located in Shanxi province of North China. For simplicity, the considered greenhouse microclimate is defined by the variables of temperature and humidity. Firstly, a mechanism model is adopted and assuming the constant coefficients of the energy and mass balance equations are unknown, and then the ICFPSO algorithm is used to select these unknown parameters by minimizing a cost function. Secondly, By supposing the disturbance is independent identically distributed white noise, an stochastic model for greenhouse is derived by using the maximum likelihood estimation method to obtain the unknown constants in the diffusion part. Finally, numerical simulations are given to show the feasibility and accuracy of the constructed deterministic and stochastic models. The model of the greenhouse climate, which is obtained based on the offline data, is updated per day. The proposed model can be used to as an initial condition for an online, real-time refinement process.
The paper is organized into five sections. Section 2 adopt a benchmark model and obtain the assumed unknown constant by using ICFPSO algorithm. In Section 3, a stochastic model for the greenhouse climate is given.
The numerical simulations are presented in Section 4. Section 5 gives concluding remarks and some directions for further research.

Benchmark model
In this section, the benchmark greenhouse climate model is adopted in terms of the literature (Su & Xu, 2017). The equilibrium equations of heat and matter are constructed based on mechanism under the ideal environment. Considering that the structure, material and environment of the greenhouse are not exactly the same in practical applications, the equilibrium equations of heat and matter may be different. For simplicity, it is assumed that the difference of the equilibrium equations is mainly reflected in the constant coefficients.
Considering the studied greenhouse without crops and actuator, a continue-time greenhouse climate model can be described as the following form: (1) where ρ air is the density of air (kg/m 3 ), C p, air is specific heat capacity of air (J/(K.kg)), T in is inside air temperature of greenhouse ( o C), V is the volume of greenhouse (m 3 ) and H air is humidity of greenhouse (g/m 3 ).
The heat flux between cover and inside air Q cov_air is calculated as where A c is the cover area of greenhouse (m 2 ), T out is out air temperature of greenhouse ( o C), a 11 is a constant number to be determined and its reference value is 1.86. The heat flux between floor and inside air Q flr_air can be given as where A g is floor area of greenhouse (m 2 ), T flr is floor temperature of greenhouse ( o C),k flr_air is the transfer coefficient from floor to inside air of greenhouse (W/(m 2 .K)) and is given by where a 12 , a 13 are constant numbers and their reference value are 1.7 and 1.3, respectively.
The heat flux from sun to inside air Q sun_air can be calculated by the following equation where a 14 is a constant number and it devotes solar radiation absorption coefficient of air to be determined, I glob is solar radiation inside greenhouse (W). The heat flux between the inside air and outside air due to ventilation Q vent can be calculated by where a 15 is natural ventilation rate (m 3 /s) to be determined. The water loss from the inside air to the cover cov_air is calculated by where a 21 is the heat transfer coefficient between inside air and cover (W/m 2 · K) to be determined, VP cov (Pa) is calculated by and VP air can be calculated by where R is molar gas constant(J/(kmol · k)), M H 2 O is the molar mass of water (kg/kmol). The water loss from the inside air to the floor flr_air is calculated by Heat and mass exchange between the inside air and outside air due to ventilation vent can be calculated by where H out is outside air humidity (g/m 3 ). Then, the next task is to solve these constants based on the actual measurement data. By minimizing the difference between measured and calculated values with the selected parameters, the constants are obtained by using the ICFPSO algorithm, which is given in the next section.

Parameter identification
In order to solve the unknown constants, the ICFPSO algorithm is used due to its greater convergence speed than the regular PSO (Clerc & Kennedy, 2002;Perez-Gonzalez et al., 2018). Let x = (x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 ) = (a 11 , a 12 , a 13 , a 14 , a 15 , a 21 , a 22 ), the value of x is regarded as a bird' position which is a potential solution, and each solution is illustrated as a particle in the swarm. The number of the unknown parameters is regarded as the dimension of solution space. The position and velocity vector of particle i are represented as where N is the swarm number and D = 7 is the dimension number of solution space. The position of each particle is updated based on its own previously position and the velocity as the following equation: where k represents the kth iteration. Each particle adjusts its trajectory towards its own best previously visited position pbest i = (pbest i1 , pbest i2 , . . . , pbest iD ) and the global best position of the swarm gbest = (gbest 1 , gbest 2 , . . . , gbest D ). The velocities of particle i can be modified by the following equation: where c 1 and c 2 are acceleration constants satisfying the limitation: c 1 + c 2 = c > 4, which is considered for a good performance and stability of ICFPSO, r 1 and r 2 are independently uniformly distributed random gains for the local and the global attractors, respectively, selected in the range of [0, 1], c s = 2/|2 − c − √ c 2 − 4c|, ω k is the inertia weight and is determined by the following equation: where ω max , ω min and iter max are the maximum inertia weight, the minimum inertia weight and the maximum number of iteration, respectively. By minimizing the difference between experimental measurement values and theoretical calculation values, a mean quadratic errors (MQE) is chosen as the fitness function of the form (13) where T exp and H exp are measured temperature and measured humidity. Then the ICFPSO algorithm is used to solve the problem as follow: The basic steps of an ICFPSO algorithm are expressed as follows: (1) Initialization of position, velocity, the best known position of each particle and the global best known position; (2) Calculation of fitness of each particle; (3) Find the best individual position and the global best position; (4) Velocity and position updating; (5) Go to step (2), if the solution is not suitable and the iteration times are not over the given value.
The search space for different parameters is shown in Table 1.
Considering the fact that the natural phenomena of modelling for greenhouse such as the dynamics of wind speed and atmospheric pressure are often stochastic rather than deterministic, It is necessary to study the dynamics of the greenhouse climate under the stochastic mechanism. Compared with the deterministic model, which only give a single value at a sampled instant, the stochastic model can produce more output values, which are obtained by running the model many times. A simple stochastic greenhouse model is proposed in the next section.

Stochastic model and estimation of parameters
It is assumed that the exchange of energy and material from greenhouse to the outside is disturbed by some random environmental effects such as wind speed and atmospheric pressure, the equation (5) and (8) can be rewritten as where θ 1 and θ 2 are constant to be determined, the term of 'noise' is seen as the white noiseḂ(t), which is formally regarded as the derivative of a Brownian motion B(t), i.e.

B(t) = dB(t)/dt.
Then, the dynamic model (1) can be rewritten as a stochastic dynamic model of the form On the other hand, when the continuous time path is observed at equidistant time points, it follows (17) that where t is known as the discretization step, ε i are independent identically distributed N(0, 1) sequence. Let (T 0 , H 0 ), (T 1 , H 1 ), (T 2 , H 2 ), . . . , (T n , H n ) are observation sequence based on the process (18), F i−1 = σ ((T j , H j ), j ≤ i − 1). Then, for the given F i−1 , the conditional probability density function of T i and H i are where air . Then, for the given F 0 , the joint conditional probability density function is Neglecting the corresponding constant, the log-likelihood function is Consider the likelihood function of the form We can get that where Then, it follows from (24) that By solving the Equation (25), we can get the parameters θ 1 = 0.0062, θ 2 = 0.053.

Experimental and numerical simulation
The collected data on a naturally ventilated single-sloped greenhouse located at the campus of Shanxi agricultural University in North China are used to compute and to evaluate the proposed models. The main features of this greenhouse are: • Surface 40 m 2 • Floor 30 m 2 • Sensors of internal and external temperature • Sensors of internal and external humidity • Sensors of floor and solar radiation The data were collected from 22 to 26, September without considering crops and actuator. The sample period was 20 min. The data in the first three days were used for modelling, and the data in two other days were used for verification.   The experimental data are presented in Figures 1-3. The measured values of the inside air temperature T exp , the outside air temperature T out and the floor temperature T flr are displayed in Figure 1. The measured values of the inside air humidity H exp and the outside air humidity H out are displayed in Figure 2. The solar radiation I glob is illustrated in Figure 3.
Figures 4 and 5 depict the measured temperature T exp (humidity H exp ) and the calculated temperature T in (humidity H air ) of the deterministic greenhouse microclimate model and the stochastic microclimate model. Figure 6 depicts the measured temperature T exp (humidity H exp ) and the predicted temperature T in (humidity H air ) of other days (25)(26)September). From the subjective view, the trends between the calculated (predicted) value and the corresponding measured data are closer. This dedicates that the constructed models are effective.
In order to analysis the validation of the proposed models, some discriminant criterion, including average, standard deviation(std), entropy(S) and correlation coefficient(CC), are introduced. Table 2 depicts the results of the deterministic model and stochastic model in the first three days. These values mean that the builded deterministic model and stochastic model have similar feasures. The reason for this conclusion is that the constructed stochastic system has the same calculated value as the corresponding deterministic model in the sense of mean. Compared with temperature, CC value of humidity is relatively low, which is mainly caused be time-delays.
In other two days (25-26 September), the constructed stochastic model is used and results are reported in    Table 3. Considered stochastic perturbations, the results of operating analysis show that the trends versus the time confirm the results validity within the framework of this work.
From previous results, we see that the developed deterministic and stochastic models are feasible. The modelling method can be popularized. The obtained models can be used for state prediction and control.
Remark 1: There are some errors between the predicted and measured values, but in the field of agriculture, the errors will not have a great impact on the growth of crops.

Conclusions
In this paper, we are concerned with the problems of deterministic and stochastic modelling for greenhouse climate. By using the PSO algorithm, the assumed unknown constant coefficients of the energy and mass balance equations are given. Moreover, supposing the disturbance is independent identically distributed white noise, the stochastic model for greenhouse is derived by using the maximum likelihood estimation method. Finally, numerical simulations are given to verify the effectiveness of the constructed models. The existence of the solution, controllability and the design of the controller will be the urgent task to be studied.  The present model for the internal air temperature and humidity in a naturally ventilated greenhouse is verified experimentally since measured and predicted values are in very good agreement. The problems of state estimation and control are not considered, which may be the next research direction.