Microsoft Word - ETASR_V11_N4_pp7424-7429 Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7424 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate A Takagi-Sugeno Fuzzy Model for Greenhouse Climate Imen Haj Hamad Laboratory of Automatic Research National Engineering School of Carthage University of Carthage Carthage, Tunisia imen.hadjhamad@enicar.u-carthage.tn Amine Chouchaine Laboratory of Application for Energy Efficiency and Renewable Energies, Faculty of Sciences of Tunis University of Tunis El Manar Tunis, Tunisia amin.chouchain@laposte.net Hajer Bouzaouache Laboratory of Application for Energy Efficiency and Renewable Energies (LAPER) National Engineering School of Tunis University of Tunis El Manar Tunis, Tunisia hajer.bouzaouache@ept.rnu.tn Abstract-This paper investigates the identification and modeling of a greenhouse's climate using real climate data from a greenhouse installed in the LAPER laboratory in Tunisia. The objective of this paper is to propose a solution to the problem of nonlinear time-variant inputs and outputs of greenhouse internal climate. Combining fuzzy logic technique with Least Mean Squares (LMS), a robust greenhouse climate model for internal temperature prediction is proposed. The simulation results demonstrate the effectiveness of the identification approach and the power of the implemented Takagi-Sugeno Fuzzy model-based algorithm. Keywords-TS fuzzy modeling; climate greenhouse; fuzzy clustering; identification I. INTRODUCTION Greenhouse cultivation is a way to protect plants from bad meteorological conditions and to take advantage of the internal climate to guarantee the high quality and the low cost of production. Optimal management of the greenhouse climate is the most appropriate way to meet the needs of industrial agricultural production. This management is essentially based on the efficient use of solar energy, air heating, ventilation, and cooling. For these reasons, greenhouse modeling is very difficult in terms of the non-linearity that describes the function between the outputs (internal humidity, internal temperature) and the inputs (external temperature, external humidity, solar radiation, wind speed, etc.) [1]. In order to develop a control technique, a good model of the greenhouse is needed for simulation and for real time control. Various methods have been proposed in the past for modeling a greenhouse. In the literature, there are two main categories of mathematical modeling techniques for real processes [2]: physical modeling and system identification. The first is based on the physical laws involved in the process and the second on the analysis of the input-output data of the model. In [3-6], the dynamic temperature model is based on the energy balance. The physical model of a greenhouse by researching thermal radiation and ventilation was developed in [7]. The modeling of the system was described from the process of mass-energy exchange in [8]. Authors in [9] studied the heat exchange by internal convection, plant transpiration, and natural ventilation to establish a greenhouse model. Authors in [10] analyzed the auto-regressive models with external data based on the GDGCM model. In [11], the modeling of the internal temperature of the greenhouse was based on a hybrid system. Identification based on Takagi-Sugeno (TS) fuzzy model was used in [12]. In [13], clustering was utilized to acquire the main modeling greenhouse parameters. In [14], hierarchical strategy was used to minimize the number of fuzzy rules in the modeling of the system. Fuzzy modeling based on neural network learning techniques was developed in [15, 16]. To obtain the consequence of the rules, we can see the use of least squares for the modeling in [17, 18]. In [19], calculus of variations and nonlinear optimization-based algorithm for optimal control of hybrid systems with controlled switching were utilized. In this paper, principal focus is given on the modeling phase. The paper is dedicated to the modeling of a class of nonlinear dynamic processes by merging local linear models. These local linear models are the fuzzy models of TS type [20]. The output of these fuzzy systems is obtained by simple interpolation of locally approved linear models. This approach allows a linguistic interpretation of the fuzzy rules. On the other hand, classical methods of linear control can be applied to local fuzzy models [21, 22]. The information system from fuzzy models can be used by a great variety of command methodologies. Thus, the performance of control depends heavily on the accuracy of the model used. Therefore, a large part of the design effort must be dedicated to modeling. So, our Corresponding author: Imen Haj Hamad Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7425 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate objective is to have the simulation results of a Fuzzy Inference System (FIS) that seeks to generate a linguistic model optimized by back-propagation and the least mean squares algorithm for predicting the climate of the greenhouse. II. EXPERIMENTAL SET-UP A. Description of the Experimental Greenhouse The actual greenhouse is located at the Laboratory of Application for Energy Efficiency and Renewable Energies (LAPER). The external structure of the greenhouse is oriented east-west and has the form of a chapel, as illustrated in Figure 1. The geometric characteristics of the greenhouse are: length = 150cm, width = 100cm, height = 115cm. Fig. 1. The experimental greenhouse. B. Description of the Measuring Equipment The database is obtained using the following equipment: • The air temperature is measured by an LM35 sensor, with an accuracy of 0.4°C in the temperature range between -24°C and 48°C. • The relative humidity is measured by a SY-230 sensor. These sensors have an accuracy of about 3% in the measurement range between 0 and 95%. • A pyranometer type LPYRA03 was used to measure the global solar radiation level on a horizontal surface. Its accuracy is about 5%, its measuring range from 0 to 2000W/m 2 and its typical sensitivity about 10µV(W/m 2 ). III. TAKAGI-SEGUNO FUZZY MODEL A. Basic Structure Fuzzy logic can provide an interesting alternative to mathematical modeling for many physical processes that are too complicated to be described by precise and simple mathematical equations or formulas. There are several classes of fuzzy systems, the most commonly used are the Mamdani fuzzy systems [12] and the TS fuzzy systems. The particularity of these systems is that the consequence of each rule does not correspond to a fuzzy set but to a local model of the system to be estimated. The TS model is composed of if-then rules with fuzzy antecedents and mathematical functions in the consequent part [23]. The antecedents of fuzzy sets divide the input space into a number of fuzzy regions, while the consequent functions are used to describe the behavior of the system in these regions [24]. For an i th rule, a TS fuzzy system has the following form: ( ) ( ) ( ) ( )i i iIf x k is M , then x k +1 = A x k + B u k (1) where x(k) represents the state vector and Mi represents the vector of the fuzzy set of the i th rule. The output of the TS model corresponds to every rule. Therefore, it is necessary to attribute a weight to describe the similarity ratio of each rule to the actual behavior of the process: ( )( ) ( )( ) p i ij j j=1 w x k = M x k∏ (2) where ( )( )ij jM x k is the membership degree of the jth state variable of the i th rule. In addition, ( )( )iw x k is the product of all the membership degrees of the i th rule, which shows the weight of this rule in the whole model. Therefore, the output can be defined by the weighted average of all rules: ( ) ( )( ) ( ) ( )( ) ( )( ) n i i i i=1 i n i i=1 w x k A x k +B u k x k +1 = w x k ∑ ∑ (3) Thus, in the whole TS fuzzy system, the weighting of the element x(k ) is described in the form : ( )( ) ( )( ) ( )( ) i i n i i=1 w x k x k = w x k φ ∑ (4) So, the output of the TS model is: ( ) ( ) ( )( ) n i i i=1 x k +1 = x k +1 x kφ∑ (5) B. Fuzzy Clustering Fuzzy clustering consists on identifying natural groupings of data from a large data set to produce an accurate representation of a system's behavior. It is useful to divide a fuzzy data set into a certain number of groups by mapping membership probabilities to each object [25]. The membership of each data item to each group is illustrated by the membership matrix with size c×l for grouping the data set }{ 1 2 lX = x ,x ,...x : 11 1 1 1 1 l l c c cl u u u u u uU = u u u β α αβ α β                 L L M O M N M L L M N M O M L L (6) Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7426 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate where uαβ corresponds to the membership degree of the β th (β=1,2,…l) element to the α th clustering. In the present matrix, there are several limitations: • [ ]αβu 0,1∈ • c αβ α=1 u = 1∑ • 0 l αβ =1 u l β ∑p p The objective function during the clustering is defined as: ( ) ( ) ( ) l c m 2 αβ αβ β=1 α=1 J U,V = u d∑∑ (7) where ( )1 cV = v ,...,v represents a vector whose elements represent the center of each clustering, m is the weight factor with a usual value of 2. The Euclidean distance between the β th element and the center of the α th fuzzy clustering is defined by: ( ) 2 2 d x vαβ β α= − . Thus, the objective function aims are to calculate the sum of the weighted values. To obtain the minimum of the objective function, it is necessary to search for the partial derivatives and make them equal to zero. Finally, the limit conditions are: ( ) ( ) l m αβ β β=1 α l m αβ β=1 u x v = u ∑ ∑ (8) 2 m-1 β α αβ 2 -c m-1 β α α=1 x - v u = x - v∑ (9) where vα calculates the center of α th clustering while uαβ renews the membership degree of each element. In the clustering process, the iteration will be completed when the convergence condition is satisfied [26] or the iteration time is reached. C. Parameter Estimation Generally, it is recommended to start with a linear model and determine the structure of the system based on the available tools to use the best model possible as a starting point for the nonlinear modeling. This is possible with the TS models' ability to use the local linear models obtained by fuzzy identification and interpolate them with each other to optimize the nonlinear structure of the system and obtain optimal results. The most common way to identify the parameters is the Least Mean Squares (LMS) method. However, different rules play a different role in the TS fuzzy model. For this reason, the ordinary LMS method should be applied [12]. Firstly, the consequence must be rewritten in the following form: ( ) 1 1 p p 1 1 q qx k +1 = a x + + a x +b u + +b uL L (10) where x(k +1) is the output of this rule and x and u are the system inputs. Thus, the data can be described as follows: ( ) ( ) ( ) ( ) ( ) ( ) ; Y 2 x 2 X 1 Y = = X = Y k +1 x k +1 X k                              M M M (11) The parameters of an ordinary LMS identification are determined by the following equation: -1 T T i i i θ = X Q X X QY   (12) where θi represents the consequent parameter vector and Qi represents the weight matrix that contains the weight of all the data: ( )( ) ( )( ) i i x 1 0 0 Q = 0 0 0 0 x n φ φ            O (13) IV. GREENHOUSE FUZZY MODELING AND SIMULATION RESULTS The main objective of fuzzy identification is to improve the accuracy acquired by a nonlinear physical model. For this simulation, a database was recorded on October 5, 2020 at the LAPER laboratory to do the greenhouse fuzzy modeling. The sampling rate was fixed to 15s. From the obtained data we have fixed 2 membership functions for the inside temperature, the outside temperature, the humidity, and the solar radiation. The data of each input will be classified and indexed using the C- Mean Fuzzy algorithm and then they will be approximated by trapezoidal membership functions. The results obtained for each input are represented by Figures 2-5, designating the membership functions of the discrete fuzzy model as well as the groupings established by the C-Mean Fuzzy algorithm. For each input, we select a small number of clusters to minimize the number of rules in the TS fuzzy system. Fig. 2. Membership of internal temperature (°C) (solid line) and data clusters (points). The prediction of the internal climate is given by the diagram illustrating the fuzzy rule architecture of the FIS in the Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7427 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate MATLAB environment, when the trapezoidal membership function is adopted. The architecture consists of 32 fuzzy rules. In the preliminary experiments, the proposed architecture proved to be sufficiently capable of extracting the climate model of the greenhouse from the control actuators and meteorological data. Figure 6 presents the flow chart of the internal climate prediction by FIS. Fig. 3. Membership of external temperature (°C) (solid line) and data clusters (points). Fig. 4. Membership of internal humidity (%) (solid line) and data clusters (points). Fig. 5. Membership of radiation (W/m 2 ) (solid line) and data clusters (points). Fig. 6. Diagram of the internal climate prediction of the FIS system. The consequent output of a rule i of the TS fuzzy model to be identified has the form: ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) i 1i 2i i 3i e 4i i 5i e 6i s 7i i 8i ch T k +1 = a +a T k +a T k +a RH k +a RH k +a R k +a V k +a Q k (14) where Ti is the internal temperature, Te is the external temperature, RHi is the internal humidity, RHe is the external humidity, Rs is the solar radiation, Vi is the internal air speed, and Qch is the heat delivered by the thermal system. Subsequently, the practical results show that the fuzzy identification system generated with the LMS method is more accurate than the dynamic modeling (Figure 9) because a good convergence to the real data of the Figure 7 may be observed. Moreover, in Figure 8, we notice that the error is of the order of 1% proving the efficiency of the proposed system, since the classical dynamic modeling reaches an error value of 2%-4% (Figure 10). In order to evaluate the result quantitatively, the VAF function [27] was adopted, to compare the difference degree between two signals. This function is given as follows: ( ) ( ) 1 2 1 var y - y VAF = 1- ,0 ×100% var y         (15) where y1 represents the real data, y2 represents the simulation result, and var is the variance. The result is more accurate if the VAF value is closer to 100% and less accurate if it is closer to 0%. After the calculation, the temperature variation value for the physical model is VAF=89.38% and the temperature Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7428 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate variation value for the fuzzy model is VAF=97.47%. We can see that the performance of the proposed modeling method is successful for any kind of greenhouse. Furthermore, when we compare the results of this study with the ones from [5] that used the dynamical modeling method [5], we notice that our fuzzy system is more accurate. A good agreement has been obtained between the calculated and the measured data, which indicates the efficiency of our proposed model in comparison with other methods. Fig. 7. Inside temperature of the greenhouse and the output of the fuzzy model. Fig. 8. Difference between the temperature inside the greenhouse and the output of the fuzzy model. Fig. 9. Inside temperature of the greenhouse and the output of the dynamic model. Fig. 10. Difference between the temperature inside the greenhouse and the output of the dynamic model. V. CONCLUSION This paper proposes a greenhouse model method based on a TS fuzzy model using the Fuzzy C-means algorithm for clustering and the LMS method for adjusting the model. This method has the following advantages: it allows modifying the hierarchical structures by adding or removing a sub-model or rules at any time without the need to repeat the whole identification process and to use all the collected data. These sub-models have similar correspondences in the physical modeling, which represent the contributions of the process mechanisms involved in the global process. The comparison of the results obtained by the fuzzy model and the experimental results confirmed the efficiency and the accuracy of the proposed model in predicting the internal greenhouse climate. In following work, we intend to integrate the developed model in an adaptive control system in order to obtain increased production and quality of horticultural products and to reduce energy consumption. ACKNOWLEDGMENT The authors would like to thank the Laboratory of Automatic Research, National Engineering School of Carthage. REFERENCES [1] H. H. Imen and B. Hajer, "Gestion et Instrumentation d’une Serre Agricole: Realisation Experimentale," in 5me Confrence Internationale des Energies Renouvelables, Sousse, Tunisie, Dec. 2017, pp. 31–36. [2] J. B. Cunha, "Greenhouse Climate Models: An Overview," in EFITA Conference, Debrecen, Hungary, Jul. 2003, pp. 823–829. [3] I. H. Hamad, A. Chouchaine, and H. Bouzaouache, "Experimental validation of a dynamic analysis and fuzzy logic controller of greenhouse air temperature," International Journal of Computer Science and Network Security, vol. 21, no. 5, pp. 175–182, May 2021, https://doi.org/10.22937/IJCSNS.2021.21.5.25. [4] I. H. Hamad, A. Chouchaine, and H. Bouzaouache, "On Modeling Greenhouse Air-Temperature: an Experimental Validation," in 18th International Multi-Conference on Systems, Signals Devices, Monastir, Tunisia, Mar. 2021, pp. 353–358, https://doi.org/10.1109/SSD52085. 2021.9429311. [5] M. Jomaa, M. Abbes, F. Tadeo, and A. Mami, "Greenhouse Modeling, Validation and Climate Control based on Fuzzy Logic," Engineering, Technology & Applied Science Research, vol. 9, no. 4, pp. 4405–4410, Aug. 2019, https://doi.org/10.48084/etasr.2871. Engineering, Technology & Applied Science Research Vol. 11, No. 4, 2021, 7424-7429 7429 www.etasr.com Haj Hamad et al: A Takagi-Sugeno Fuzzy Model for Greenhouse Climate [6] J. Yau, J. J. Wei, H. Wang, O. Eniola, and F. P. Ibitoye, "Modeling of the Internal Temperature for an Energy Saving Chinese Solar Greenhouse," Engineering, Technology & Applied Science Research, vol. 10, no. 5, pp. 6276–6281, Oct. 2020, https://doi.org/10.48084/ etasr.3728. [7] G. P. A. Bot, "Greenhouse climate : from physical processes to a dynamic model," Ph.D. dissertation, Wageningen, Netherlands, 1983. [8] J. G. Pieters and J. M. Deltour, "Performances of Greenhouses with the Presence of Condensation on Cladding Materials," Journal of Agricultural Engineering Research, vol. 68, no. 2, pp. 125–137, Oct. 1997, https://doi.org/10.1006/jaer.1997.0187. [9] L. Shuhai, M. Chengwei, Z. Junfang, and B. Shunshu, "Thermal model of multi-span greenhouses with multi-layer covers," Transactions of The Chinese Society of Agricultural Engineering, vol. 20, no. 3, pp. 217– 220, 2004. [10] H. U. Frausto, J. G. Pieters, and J. M. Deltour, "Modelling Greenhouse Temperature by means of Auto Regressive Models," Biosystems Engineering, vol. 84, no. 2, pp. 147–157, Feb. 2003, https://doi.org/ 10.1016/S1537-5110(02)00239-8. [11] L. L. Qin, C. Shi, G. Wu, M. S. Xue, and Z. H. Hu, "Modeling of ventilation window air temperature system in greenhouse based on hybrid system," Journal of System Simulation, vol. 22, no. 4, pp. 833- 836–2010. [12] A. Trabelsi, F. Lafont, M. Kamoun, and G. Enea, "Fuzzy identification of a greenhouse," Applied Soft Computing, vol. 7, no. 3, pp. 1092–1101, Jun. 2007, https://doi.org/10.1016/j.asoc.2006.06.009. [13] E. Gorrostieta-Hurtado, A. Sotomayor-Olmedo, J. C. Pedraza-Ortega, M. A. Aceves-Fernandez, and U. G. Villasenor-Carillo, "Modeling Key Parameters for Greenhouse Using Fuzzy Clustering Techniques," in Ninth Mexican International Conference on Artificial Intelligence, Pachuca, Mexico, Nov. 2010, pp. 103–106, https://doi.org/10.1109/ MICAI.2010.37. [14] P. Salgado and J. B. Cunha, "Greenhouse climate hierarchical fuzzy modelling," Control Engineering Practice, vol. 13, no. 5, pp. 613–628, May 2005, https://doi.org/10.1016/j.conengprac.2004.05.007. [15] D. Dubois and H. Prade, Fuzzy Sets and Systems: Theory and Applications. New York, NY, USA: Academic Press, 1980. [16] L. X. Wang, A course in fuzzy systems and control. Hoboken, NJ, New Jersey: Prentice-Hall, 1997. [17] E. M. Abdel-Rahman, O. Mutanga, J. Odindi, E. Adam, A. Odindo, and R. Ismail, "A comparison of partial least squares (PLS) and sparse PLS regressions for predicting yield of Swiss chard grown under different irrigation water sources using hyperspectral data," Computers and Electronics in Agriculture, vol. 106, pp. 11–19, Aug. 2014, https://doi.org/10.1016/j.compag.2014.05.001. [18] R. Babuska, Fuzzy Modeling for Control. Boston, MA, USA: Springer, 1998. [19] H. Bouzaouache, "Calculus of Variations and Nonlinear Optimization Based Algorithm for Optimal Control of Hybrid Systems with Controlled Switching," Complexity, vol. 2017, Aug. 2017, Art. no. e5308013, https://doi.org/10.1155/2017/5308013. [20] T. Takagi and M. Sugeno, "Fuzzy identification of systems and its applications to modeling and control," IEEE Transactions on Systems, Man, and Cybernetics, vol. SMC-15, no. 1, pp. 116–132, Jan. 1985, https://doi.org/10.1109/TSMC.1985.6313399. [21] J. C. Bakker, G. P. A. Bot, H. Challa, and N. J. van de Braak, Greenhouse climate control: an integrated approach. Wageningen, Netherlands: Wageningen Academic Publishers, 1995. [22] A. Fink, M. Fischer, O. Nelles, and R. Isermann, "Supervision of nonlinear adaptive controllers based on fuzzy models," Control Engineering Practice, vol. 8, no. 10, pp. 1093–1105, Oct. 2000, https://doi.org/10.1016/S0967-0661(00)00059-9. [23] E. H. Mamdani, "Application of Fuzzy Logic to Approximate Reasoning Using Linguistic Synthesis," IEEE Transactions on Computers, vol. C– 26, no. 12, pp. 1182–1191, Dec. 1977, https://doi.org/10.1109/TC.1977. 1674779. [24] F. Lafont and J.-F. Balmat, "Optimized fuzzy control of a greenhouse," Fuzzy Sets and Systems, vol. 128, no. 1, pp. 47–59, May 2002, https://doi.org/10.1016/S0165-0114(01)00182-8. [25] J. C. Bezdek, R. Ehrlich, and W. Full, "FCM: The fuzzy c-means clustering algorithm," Computers & Geosciences, vol. 10, no. 2, pp. 191–203, Jan. 1984, https://doi.org/10.1016/0098-3004(84)90020-7. [26] R. L. Cannon, J. V. Dave, and J. C. Bezdek, "Efficient Implementation of the Fuzzy c-Means Clustering Algorithms," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. PAMI-8, no. 2, pp. 248– 255, Mar. 1986, https://doi.org/10.1109/TPAMI.1986.4767778. [27] J. C. Gomez, A. Jutan, and E. Baeyens, "Wiener model identification and predictive control of a pH neutralisation process," IEE Proceedings - Control Theory and Applications, vol. 151, no. 3, pp. 329–338, May 2004, https://doi.org/10.1049/ip-cta:20040438.