Model Predictive Control versus Traditional Relay Control in a High Energy Efficiency Greenhouse

The sustainable agriculture cultivation in greenhouses is constantly evolving thanks to new technologies and methodologies able to improve the crop yield and to solve the common concerns which occur in protected environments. In this paper, an MPC-based control system has been realized in order to control the indoor air temperature in a high efficiency greenhouse. The main objective is to determine the optimal control signals related to the water mass flow rate supplied by a heat pump. The MPC model allows a predefined temperature profile to be tracked with an energy saving approach. The MPC has been implemented as a multiobjective optimization model that takes into account the dynamic behavior of the greenhouse in terms of energy and mass balances. The energy supply is provided by a ground coupled heat pump (GCHP) and by the solar radiation while the energy losses related to heat transfers across the glazed envelope. The proposed MPC method was applied in a smart innovative greenhouse located in Italy, and its performances were compared with a traditional reactive control method in terms of deviation of the indoor temperature in respect to the desired one and in terms of electric power consumption. The results demonstrated that, for a time horizon of 20 h, in a greenhouse with dimensions 15.3 and 9.9 m and an average height of 4.5 m, the proposed MPC approach saved about 30% in electric power compared with a relay control, guaranteeing a consistent and reliable temperature profile in respect to the predefined tracked one.


Introduction
Due to the significant climate changes occurred in the last decades, the introduction of new methodologies and technologies has become essential to support agriculture and to optimize greenhouse productions.
In the last decades, vegetables and fruit cultivation has become more and more competitive-above all, in the Mediterranean area. According to Eurostat statistics [1], in the EU, the agricultural production in 2016 used the 39% of the land area of the EU countries, while, in 2017, the agriculture sector concurred for 1.2% of the EU's GDP [2].
New approaches adopted in agriculture have been suggested in Agriculture 4.0, which reflects the main features of the Fourth Industrial Revolution (Industry 4.0) promoted by Germany and other European countries [3]. The main goals of this ongoing revolution concern the introduction of the automation and digital technologies in the agriculture sector favoring a transition toward smart and sustainable farming systems. In this context, Agriculture 4.0 represents a great opportunity to take into account the variability and uncertainties involving the agri-food production chain, especially due to the costumers' inconstancy or in fighting emergency situations such as the impact of the COVID-19 pandemic [4]. The main innovative technologies able to support this transition include the Internet of Things (IoT) [5], Artificial Intelligence (AI) [6], remote sensing and new applications in intelligent control and the automation of production processes [7].
The IoT and remote sensing applications have recently been implemented to monitor and control indoor greenhouse parameters [8,9], to optimize the irrigation system automation [10], to monitor crop sensitive data and provide the farmer with real-time information about performance in order to take correct decisions [11], to detect plant diseases using image evaluation [12] and to control the lighting system [13] or nutrient optimal levels in the soil [14]. A review about IoT applications in smart agriculture appeared in reference [15].
One of the main significant smart farming approaches is represented by Precision Agriculture (PA)-above all, in the protected environment [16]. PA, in fact, is based on ICT solutions to monitor, measure and control inside parameters in order to increase productivity by minimizing the environmental impact, allowing cost and water saving and reducing disease infection and pesticide adoptions [17].
Smart agriculture and PA applied to greenhouses are also a very interesting from an energy viewpoint. In fact, the growing request of quality and production of fruits and vegetables imposes to the producer to equip greenhouses with suitable heating and cooling units to regulate the temperature, humidity and lighting, driving a healthy and controlled production. In smart applications, in general, it is mandatory to select proper high-efficiency technical solutions to reduce the energy consumption and, as a consequence, the production costs [18]. A critical point is the economic sustainability of this type of production, especially in the global market; even excellent quality products are not competitive when their price is too high. Therefore, the greenhouse agriculture is more and more investing in technologies, passing from traditional to ICT-controlled systems, resulting in a "smart" greenhouse environment.
In this context, the work proposed in this paper encompasses two main interesting features related to the recent literature dedicated to greenhouse cultivation. Firstly, it refers to the basic principle of Agriculture 4.0 focusing on the control strategy to optimize the microclimate inside a smart greenhouse realized by using innovative materials and technologies and monitored by advanced control systems. Secondly, a MPC application is used as the relevant control strategy to guarantee a reliable tracking of specific target temperature, which may assure the optimal environmental conditions for the correct growth of each selected plant with an energy-saving approach.
In detail, this paper presents the development of an MPC-based control system to optimize the indoor air temperature of a smart greenhouse according to the requirements of the specific crop cultivation. The aim of this work is to determine the optimal control signals associated with the water mass flow rate supplied by a heat pump following the a priori known temperature profile.
A multiobjective optimization model based on the MPC approach has been implemented, taking into account the dynamic behavior of the greenhouse in terms of the energy and mass balances. The energy supply is provided by a ground-coupled heat pump (GCHP) and by the solar radiation, while the energy losses are related to heat transfers across the glazed envelope.
The main contribution of this paper is twofold. Several works concern the greenhouse microclimate control, but limited literature is dedicated to the control of the heating cooling system realized by the geothermal system in greenhouses. Generally, GCHPs are applied in the context of commercial or residential buildings due to their energy efficiency, while few works refer to this application in greenhouses, especially with MPC-based control. The successfully use of GCHPs in greenhouses has been already verified, even in Italy [19], and the wide literature has demonstrated the advantages of the MPC approach in respect to other control models also in the greenhouse climate management [20], but no papers, according to the authors' knowledge, have tackled the problem to control the GCHP by MPC tracking optimal indoor greenhouse temperatures, minimizing the electrical energy consumption. The main novelty of this paper is related to the application of the MPC to optimize the water mass flow rate in the GCHP system, comparing its performances with a reactive control.
The second main interesting feature is related to the experimental test site. The greenhouse, the subject of this work, was financed and realized by an Italian national program that allowed selecting and adopting the main interesting materials and emerging technologies. The opportunity to test our control model in a such an advanced context represented an added value of our work.
The proposed MPC method was applied in a smart innovative greenhouse located in Italy. The goal was to demonstrate that the application of the proposed model yielded better energy performances in comparison with traditional reactive controls. This paper is related to an innovative regional research later exploited in an international context. The "Smart Agro-Manufacturing Laboratory (SAM-LAB)" project was developed in 2014-2016 in the framework of a Regional Italian project, funded by the Liguria Region PAR FAS program. The main aim of the SAM LAB project was to define the strategies enhancing greenhouse management in order to improve the cultivation systems and reduce the overall required energy. Based on this experience, the Interreg ALCOTRA project between Italy and France funded the Antea project "Edible Flowers: Innovations for the Development of a Cross-Border Sector" (2016-2020). The project aim was to support innovation to promote the nutritional characteristics of edible flowers and broaden the range of varieties, setting up an innovative production, commercialization and consumption system for the product. The link between the two projects was the realization and operation monitoring of an innovative prototype greenhouse at Cersaa (Center for Agricultural Experimentation and Assistance) in Albenga, Italy (Figure 1). Cersaa and Unige share the research facility. The greenhouse is equipped with new materials for the glazed envelope, innovative equipment associated to renewable energies and suitable advanced ICT monitoring and control systems. The greenhouse was tested for several experiences from the technological and methodological viewpoints. Among such experiences, heating and cooling the greenhouse tracking a specific temperature profile may represent a perfect example where the Model Predictive Control (MPC) can give a better performance when compared to traditional relay controls. The MPC represents one of the most powerful approaches to iteratively optimizing complex dynamic systems in the current sampling time, taking into account the prediction of system state in the future. The use of the MPC in this work is motivated by the ability of this control strategy to significantly improve the control performance when a desired trajectory has to be tracked. The MPC basic concept, in fact, deals with predicting the evolution of the state, the input and the output of a system, subjected to constraints, on a given prediction horizon, minimizing the cost function, which determines the best control decision. However, only the values obtained in the first interval are used, while the procedure is repeated for the following sampling times by the receding horizon approach.
In this work, after a survey of the current challenges in greenhouse production, a MPC approach is presented and compared with the traditional control solution. The MPC is implemented as a multiobjective optimization model to find the optimal control signals associated to the hot water flow in the heating plant.

Smart Greenhouses Applications
Recently, new alternative cultivation techniques and greenhouse systems have been developed to support crop production in the perspective of unfavorable environmental conditions, especially in areas where conventional farming systems are difficult to be applied.
The Nemo's Garden project (2012-2020), for example, developed an underwater farm that consisted of six biospheres made by acrylic material completely immersed in the sea, at 5-12-m depth, at 100 m from the shoreline, close to Savona, in Liguria Region, Italy [21]. This application focused on the creation of a self-sustainable farming aimed at freshwater production, comfortable stable temperature and isolation of the greenhouse environment from external contamination and external air weather conditions. The water cycle inside the underwater greenhouse depends on different parameters, such as the vapor partial pressure and the temperature inside the air volume, the radiation and the surface temperatures, the sea temperature, the vapor removal by specific heat exchangers and the plant watering system. In reference [22], Zeidler et al. described the design of a technological greenhouse dedicated to the lunar space applications. In fact, the project aimed at developing a closed-loop bioregenerative life support system, essential for future human space missions, with the realization of a lunar greenhouse system able to produce specific quantities of selected plants. In arid areas or in countries with limited rainfall, the development of a seawater desalination plant based on a renewable energy system (RES) is becoming a significant added value for the protected agriculture. An interesting example are desalination units based on a renewable hybrid system using sunlight and seawater that are able to humidify the indoor air of the greenhouse and to produce fresh water [23].
In a confined environment such as a greenhouse, the requirement of controlled internal conditions for a long time operation determines an increasing energy consumption, which represents a problem both for the environmental and the economic viewpoints. One of the main concerns in a greenhouse management is the energy cost associated with heating and cooling duties [24]. In reference [25], the authors proposed a survey and a performance evaluation of innovative and renewable heating technologies for greenhouse applications. Different energy saving solutions were presented, with special reference to thermal storage techniques, ground-to-air heat exchanger systems, solutions for insulation/thermal screens, the optimal use of a north wall, ground air collectors and aquifer-coupled cavity flow heat exchanger systems. Besides, in reference [26], the researchers proposed a comprehensive report of cooling methods for greenhouses, including renewable technologies such as roof evaporative cooling, the ground-to-air heat exchanger system and the aquifer-coupled cavity flow heat exchanger system. In reference [27], the authors analyzed the statistical performance of a microclimatic model for a naturally ventilated greenhouse for a cucumber crop based on the heat and mass transport processes. Priarone et al. [28] evaluated the energy demand of the greenhouse by an hourly numerical simulation realized by Energy Plus (E-plus) software. In order to minimize the energy produced by fossil fuel, the introduction of devices based on renewable sources such as geothermal heat pumps represent the first step to decreasing harmful emissions [28,29]. Heating/cooling systems affect, significantly, the growth, the quality and the cultivation time in greenhouses [30]. In particular, the indoor environmental parameters in a greenhouse must be monitored and controlled to support crop growth [31]. Greenhouse heating is a central issue even in countries with mild climates, such as in the Mediterranean area, but cooling operations are also necessary to maximize the crop production and drive the timing for crops. Heating and cooling costs seriously affect the economic profits but, in the long term, may also limit a large diffusion of the greenhouse cultivations. In general, energy costs account for up to 40% of final production costs in a greenhouse [32]. Moreover, high-energy consumption heating systems may generate the emission of noxious gases that produce environmental problems. Geothermal (ground-source or water-source) heat pumps represent one of the most important green energy solutions to realize a heating or cooling system for domestic and industry applications [33]. Ground-coupled heat pumps (GCHPs) work extracting/injecting heat from/to the ground in order to heat or cool the indoor environment, typically thanks to vertical ground heat exchangers [34]. This technology takes advantage of the fact that the ground, from some 10 m down on, maintains an almost constant and warm temperature during the year.
Several studies have focused on the implementation of RES-based integrated systems for energy production and storage technologies [35,36], describing technologies and the optimal energy management of greenhouses [37]. According to the above-cited literature, the current trend to realize smart greenhouses at zero-net energy is becoming one of a viable technological solution to support sustainable food production and an alternative strategy to fossil fuel energy production. In this innovative context, in the following section, the description of a real application of smart greenhouse realized in Italy is introduced.

Technologies for an Innovative Smart Greenhouse in Italy
This paper focuses on the performance of an innovative greenhouse realized in Albenga, Liguria Region, Italy. The greenhouse envelope was a rectangular aluminum frame with a pitched roof. The base dimensions were 15.3 and 9.9 m, while the eave height was 3.50 m, with a roof top of 5.60 m. Glazed walls with low emissivity K-glass type N with a thickness of 4 mm were used for the greenhouse structure. They were characterized by a heat transfer coefficient of 3.3 W/m 2 K, normal emissivity equal to 0.05 and a solar gain (g-value) of 71%.
The greenhouse was equipped with innovative solutions for energy consumption reduction and the maximization of the productivity of the selected crop. The air conditioning system of the greenhouse was able to control the indoor temperature both in the winter and summer seasons. In addition, other quantities were monitored (humidity, irradiance level and photosynthetically active radiation; PAR), and additional equipment (reflective shading) was used for tuning the inner radiation.
A complete EnergyPlus model of this greenhouse was recently developed in reference [38], for further details on the structure characteristics, operating conditions and energy transfers.
In the present greenhouse, reflective shading was applied to the roof surface to reduce during summer the heating contribution due to the solar gain. Another passive technique to reduce the internal temperature was natural ventilation by controlled opening of windows, located at the bottom of the lateral walls and at the roof top, which measured 30 m 2 . If the air volumetric flow rate obtained by natural ventilation (wind and stack effects) was not enough, an extractor fan was activated on the rooftop. Finally, in the case of peak conditions, the internal temperature and humidity thresholds were controlled by means of an air handling unit (AHU) to optimize the cooling and heating processes. The AHU was associated with a ground-coupled heat pump (GCHP) extracting or injecting heat into the ground thanks to six borehole heat exchangers (double-U pipes, 100m deep each). The local undisturbed ground temperature at the site was about 16 • C (60.8 • F). Worth noticing, this value was more helpful for both the heating and cooling operations than the corresponding air temperatures, ranging from 9 • C to 35 • C from the winter to summer.
The selected GCHP (model Ecogeo B3 of the Ecoforest brand) has a nominal heating capacity at a partial load factor (PLF) = 95% of 28 kW for the inlet water temperature T in = 10 • C and outlet water temperature T out = 55 • C, with a COP (Coefficient of Performance) = 3.7; during the summer season, the nominal cooling capacity was at PLF = 100% of 34.4 kW for T in = 20 • C and T out = 7 • C, with a EER (energy efficiency ratio) = 5.29. At the load side, the heat pump (HP) provides water to a storage tank (ST). The storage tank feeds, in turn, the coils of the AHU and, also, the local heater of the benches placed inside the greenhouse for crop purposes. The AHU is an AERMEC brand, series TN 2 with a nominal air volumetric flow rate equal to 4100 m 3 /h in cooling mode and 4700 m 3 /h in heating mode. The estimated overall heat transfer coefficient of the AHU was HTC = 760 W/K. The air distribution network was composed of three textile ducts by AIRMIXING Evoair.
The water tank was thermally stratified, due to the different densities of water related to its temperatures: the hot water coming from the GCHP enters the tank from the top, while the cooler water coming back from the air heat exchanger settles in the tank bottom section. The storage tank capacity of storing heat while maintaining the highest level of energy derives from the real temperature stratification conditions that depend on many factors, including the tank size, height and diameter; flow rate for loading and unloading water and water velocities at inlet sections [39]. Reference [40] investigated the thermal stratification in hot water tanks.
The greenhouse was equipped with a monitoring and control system based on four subsystems with peculiar features. The hardware system, built as a sensor network, has the task to measure and track each parameter of the greenhouse and to send the data to a control unit (CU). The software system acquires data from the CU, collects and displays the data and verifies the parameters of the greenhouse environment. The control system communicates with different actuators of the greenhouse structure according to the observed parameters in order to set the optimal conditions required to cope with the design set points. Finally, a website was implemented, devoted to the real-time visualization of the greenhouse parameters and to generate downloadable reports of historical measured records.

Sensor Network
The hardware system was based on an embedded CU, version A20-OLinuXino-MICRO-4GB, a local network of analogical and digital sensors that can monitor in real time each parameter of the greenhouse. In this configuration, the control system was equipped with GPRS technology. The devices installed in the greenhouse can monitor the following parameters: • external weather conditions (temperature, wind speed and direction and humidity); • indoor air temperature, pressure and humidity at different heights inside the greenhouse; • light and photon flux inside the greenhouse; • soil humidity and temperature; • photovoltaic energy production; • geothermal heat pump performance power and heat transfer rates.
The digital thermometer provided 9-bit to 12-bit Celsius temperature measurements, and it included a user-settable alarm for the upper and lower trigger points. Its operating temperature ranged from −55 • C to +125 • C, with a ±0.5 • C accuracy in the range from −10 • C to +85 • C. The digital barometric pressure sensor, which included a conditioning IC, made available accurate pressure measurements in a range of 50 to 115 kPa. The lux meter measured the illuminance of natural or artificial light sources, with a measuring cell that returned an electrical output signal (0-10 V or 4-20 mA) proportional to the light intensity. Moreover, in order to track and set a convenient water irrigation schedule, a water flow meter was installed in the irrigation system.
All the sensors were individually calibrated and tested. The sensor network transmission system was based on a single-wire bus for a serial communication with a central microprocessor that used only one data line (and ground).

Software System and Website Module
The CU performs activities related to measurement collection, partial data processing and message packing on multiple queues. The CU acquires different kinds of data from the network sensors, and it transmits them to the control center server according to different methods. All data are typically acquired at predefined fixed time intervals (e.g., 5 min). The data transmission rate can be changed between two predefined modes by fixed sample times or by on-event requests. According to the first mode, the data were periodically sent with the information about the greenhouse parameters while, according to the second mode, the measurements were sent, for example, in case of detected anomalies or whenever the received values overcame the threshold defined by the control system. It is possible to define an unlimited number of notifications by means of one or several communication protocols (e.g., email, SMS messaging and website alert messages).

Control System
The data acquired by the CU are periodically sent by a GPRS connection to the Control Center and forwarded to a dedicated internet server. If any parameter of the network system does not satisfy the optimal predefined conditions, an alert message is generated. At the same time, the CU sets the corresponding actuators of the greenhouse in order to modify their status. Specifically, the CU can operate on the following structural elements of the greenhouse: opening/closure of the shading system, opening/closure of the lateral side and roof windows, switch on/switch off the heating and cooling system, switch on/switch off the irrigation system and switch on/switch off the lighting system. The classic approach to control in automatic these systems is usually based on relay strategies (e.g., for temperature, switching on the HP when the temperature is below a specific value) or on periodic automations (e.g., for irrigation, switching it on at fixed flows at a specific hour of the day).

Heat Pump Energy Monitoring
An additional monitoring system was dedicated to record the operating parameters of the GCHP. The system was based on a Linux micropc platform that controls an acquisition unit able to collect, at sampling rates higher than 1 Hz, a series of analogical and digital inputs. The measured quantities included evaporator and condenser side temperatures, carrier fluid temperatures from the different borehole heat exchangers, a mass flow rate in the ground loop and electrical power at the heat pump compressor and circulation pump. The aim of these measurements was to track the heat pump energy performance in real time and to build a database of the working parameters.

Overview in MPC Method for Greenhouse Efficiency
The main challenge in greenhouse management is microclimate control during different seasons to fit the optimal crop growing conditions. In particular, temperature control is essential to create the best values for the overall parameters inside the greenhouse environment to avoid plant stress and to improve the efficiency of crop production. Several research studies have tackled the problem and provided different control methods and models for the indoor temperatures of greenhouses.
In general, the quality of control strategies depends on the data availability about the variability of the parameters that may affect the actuators choice and the control signals [41]. Usually, the control strategies in the context of a greenhouse are mainly based on the traditional reactive methods or on predictive models.
The traditional reactive control strategies do not take into account the forecast of the state and environmental exogenous variables [42]. On the other hand, these approaches based either on on/off relay methods or on proportional, integral and derivative (P, PI or PID) controllers have a widespread use due to their simple architecture and easy implementation [43].
Due to the complex mass and heat transfer processes in the greenhouse environment, the implementation of an on/off controller produces, in this kind of application, significant fluctuation of the variables from their input set points [44]. In reference [45], a PID and fuzzy logic controllers were implemented to minimize water use and optimize the energy consumption, while, in reference [46], the authors proposed a PID tuning scheme for greenhouse climate control by an evolutionary algorithm. Therefore, in some applications, the PID controller can generate promising results, but, when the operating conditions differ largely from the optimal ones, a controller calibration process has to be included in decreasing the control performances [47]. Besides, PID control does not usually represent a suitable solution in case of advanced applications, whereas dynamic controls are essential [48].
On the other hand, Model Predictive Control (MPC) methods receive considerable interest in research studies, with applications for different economic and industrial sectors thanks to their robustness and ability to model disturbances and nonlinear constraints [49]. In fact, recently, the MPC was extensively used in different kinds of specific applications: vehicle platoon control [50][51][52], in the management of transport flows [53], microgrid energy management [54,55], in chemical processes [56] or in the control of the thermal comfort in indoor environments [57,58].
MPC is an advanced control technique that adopts a process model to forecast the future variable behaviors. This approach allows to model complex systems and processes that require receiving control signals in the short term by an optimal automated model predictive controller. In the case of systems with fast dynamics, other constraint control approaches may be adopted. In reference [59], Hosseinzadeh et al. introduced the Explicit Reference Governor scheme for continuous-time systems, which guaranteed that the system states were constrained in a specified range. Other approaches refer to the control barrier functions (CBFs), which has been significantly applied, above all, in the context of safety and critical control conditions [60] or to the safety preserving control algorithm, where the system was forced to remain within the constraint invariant set [61].
Specific literature has been devoted to MPC methods applied to control different components of a greenhouse [62]. In references [63,64], the authors implemented an optimal strategy to regulate the operational parameters for heating and cooling systems by means of an MPC. In particular, in reference [63], the authors proposed a Generalized Predictive Control (GPC) applied to two types of heating systems in a greenhouse: an aerial pipe with hot water and air-fan heaters were tested for greenhouse temperature control. Comparing the GPC and on/off controllers, they concluded that the advantages of using GPC with respect to a traditional controller are only apparent if the operating greenhouse conditions violate the constraints about a minimum inside temperature. In reference [64], a multiobjective hierarchical control model was implemented to maximize the economic profits, crop quality and water use efficiency in greenhouse cultivation. In reference [65], the authors proposed a MPC strategy to control the air temperature within a greenhouse using a particle swarm optimization algorithm. In reference [66], the authors presented a MPC controller able to maximize the crop photosynthesis acting on the water and energy management, while, in reference [67], the MPC adoption in an irrigation system reduced 30% of the water consumption over a period of three weeks. Serale et al. in reference [68], implemented a MPC strategy to control the artificial lighting system to optimize the energy efficiency. In reference [69], a MPC approach was used to control the air temperature in a greenhouse managing two variables associated with heating pipe temperature and the air volumetric flow rate (windows opening). In other papers, the authors adopted the MPC algorithm in order to optimize the greenhouse climatic conditions by minimizing the energy and water uses [70] and by controlling the natural ventilation [71], CO 2 concentration [72] or the fan behaviors [73].
Moreover, further approaches may be introduced to improve the performances of the control strategies in terms of scalability and reconfigurability [57]. In this context, the authors in reference [58] proposed a lexicographic multiobjective optimization based on prioritized objectives, while, in reference [74], an improved multiobjective genetic algorithm was adopted to optimize the indoor thermal comfort of buildings. In references [20,48,75], interesting reviews were discussed about the application of MPC in a greenhouse context. Thus, in most papers, the control models aim at optimizing the behavior of the greenhouse environment, minimizing the heating or cooling energy and/or reference deviation for one of the main significant parameters, such as the temperature or humidity, through actuators such as win-dow opening/closing, heating valve position or signals for ventilation and heating/cooling systems. These concepts play an important role in the remainder of this paper.
This work presents the design of an MPC-based model to control indoor air temperatures in a greenhouse by optimizing three different objective functions. In detail, it considers the aims of minimizing the activation of the GCHP during the time horizon, minimizing the energy consumption associated with the use of the heating system and, finally, minimizing the maximum deviation of the inside greenhouse temperature with respect to the desired one for each time interval.
The main contribution of this paper is to show the application of a simple and effective MPC model that allows the greenhouse system to track a predefined temperature profile (specific for each crop cultivation) with an energy-saving approach. A multiobjective function is defined to obtain the control law in the proposed MPC algorithm and to determine the optimal control signals associated with the water mass flow rate supplied by the heating pump. Other constraints about physical limits and heat exchanges are taken into account in the overall process control systems.

The Proposed MPC Model
This model aims at controlling the indoor temperature of a greenhouse by tracking a predefined value, minimizing the energy efficiency of the heating system.
The proposed architecture consists of the following components. For heating and cooling purposes, the GCHP is connected to an Air Handling Unit (AHU), fed by hot (or cold) water. As it is well-known, the COP (Coefficient of Performance) refers to the ratio between the units of heating energy generated for every unit of electrical energy spent to operate the system [38]. It is assumed that the ventilation system operates in the greenhouse in full mixing mode, producing a homogeneous temperature inside the greenhouse. A sensor network is considered to monitor, in real time, the following parameters: the external air temperature and the solar radiation, the air temperature inside the greenhouse, the benches and the cultivation soil temperature and the temperatures and flow rate of the water on the condenser side of the GCHP (inlet and outlet). A module to predict the outdoor weather condition is considered as well. Figure 2 shows a sketch of the actual heating and cooling system, which includes a storage tank. Nevertheless, the following proposed preliminary version of the MPC model does not include the tank in the analysis and assumes that the GCHP feeds directly into the AHU. This assumption is based on the fact that the size of the storage is small compared to the typical flow rates, and its role is mainly to decouple the upstream and downstream flows other than storing energy. Therefore, the model may be formalized by considering the following set of parameters and variables computed for each time interval i of the time horizon I, where I = 1, . . . , I. K overall heat transfer coefficient per unit surface of the greenhouse envelope (W/m 2 K) h m int convective heat transfer coefficient (W/m 2 K) C g = c air m g heat capacity of greenhouse air (J/K)

Objective function
The objective function consists of three components: where α, β and γ are weighting parameters related to the relative importance of the objectives. The first objective OBJ1 aims at minimizing the square deviation of the Pel i during two consecutive time intervals in order to limit discontinuities in the power feeding the HP, limiting the HP straining. The second objective OBJ2 aims at minimizing the electric power Pel i during the overall time horizon. The third objective OBJ3 implements a min-max approach by minimizing the maximum value of deviation between the current indoor temperature in the greenhouse and the target one. The minimization is clearly valid when the indoor temperature T g i exceeds the target value. Governing equations Physical constraints In the above set of equations, Equations (2) and (3) represent the energy balances for greenhouse air (of temperature T g i ) and internal masses (of average temperature T m int i ), respectively. In particular, Equation (2) shows the relationship between the state variables associated to indoor greenhouse temperature T g i and the others main components due to internal and external variables. The superscripts g, e, m int refer to the variables related to the temperatures, respectively, associated to the greenhouse, to the external conditions and to the inner masses. The main contributions are due to the heat losses through the glazed envelope, the heat transfer between air and the internal masses of the greenhouse, the solar gains and the heat provided by the plant by means of the AHU. This energy balance is intrinsically time-dependent, because the external air temperature T e i and the solar irradiance G sol i change continuously during the day, depending on the season. Equation (4) allows to evaluate the evolution in time of the water temperature at the load side of the GCHP (the stream that exits from the heating coil of the AHU). On the contrary, due to the peculiar characteristics of the greenhouse site (the presence of a double aquifer at some 10 and 80-m depths, respectively) measured values of the carried liquid temperature, the ground side was demonstrated to be very constant in time, and this is the reason for setting it as a constant in the present model. In Equation (4), the estimated heat transfer coefficient of heat exchanger water/air in the AHU is considered; in fact, the decrease of water temperature T out i − T in i is proportional to the heat transferred to the air in the AHU heating coil Q i , evaluated as in Equation (7). Equation (5) is the definition of the performance parameter COP for the GCHP. Due to numerical constraints, the COP i variable has been top-limited by the value in Equation (6). The range of the GCHP efficiency depends on the hot water temperature exiting from the heat pump T out i and from the temperature T geo of the water coming from the ground, respectively. The variable Q i is defined in Equation (7) by the heat transfer formula, which is the measure of the thermal energy transferred by the GCHP water according to the outlet and inlet water temperature variations. In detail, the heating power of GCHP is given by the product of the mass flow rate of the water circulating in the pipe and the related specific heat of water and the temperature difference. Equations (8) and (9) introduce a maximum threshold for the variables associated with Pel i and T out i due to physical and numerical constraints. In Equation (10), the value of T out i , (i.e., the supply temperature of the GCHP) is forced to be ∆Temp over T in i , the temperature of water returning from the greenhouse if the pump is activated, or to be equal to T in i otherwise. Finally, Equation (11) represents an upper limit for the variable associated to the mass flow rate of the water circulating in the GCHP pipe.

Model Application
The proposed model was tested to simulate and control the air temperature inside the aforementioned SamLab greenhouse located in the town of Albenga, Liguria Region, Italy. In the proposed case study, the effective regulation of the heating system was implemented by simply minimizing the difference between the current internal air temperature condition and the optimal set point, considering a time interval of 20 h. The input for the MPC model was the outside air temperature and the solar irradiance, whereas the state variable, with values to be tracked for each time interval, was the indoor air temperature of the greenhouse.
In the proposed approach, the temperature of the internal masses of the greenhouse were taken into account, because in the transient analysis, their heat capacity could not be neglected. In particular, the cultivation benches (account for some 7 tons as a whole) and greenhouse walls were taken into account as a fraction of the overall envelope mass to properly account for the twin heat transfer contributions, the one towards the external air (that follows the weather variability) and the one towards the indoor air of the greenhouse.
Finally, the heat transfer with the bottom ground (greenhouse floor) was neglected. The parameters taken into account are presented in Table 1.

Results
In order to evaluate the performance model, the prediction horizon considered was 20 h with a 3-min sampling period (∆I = 180 s) and 400 time intervals.
For the MPC application, the predicted values of the external temperature and solar irradiance were computed by the interpolation of real hourly data coming from the monitoring system for a day of May at the greenhouse location (Albenga, Liguria Region, Italy). Figures 3 and 4 display the main results of the model application. For this solution, the weighted parameters in the objective function were α = 0.1, β = 0.5 and γ = 350. Those values came from the tuning phase where the parameters were set empirically to compare the objectives according to the scale of the problem. In the following section, a sensitivity analysis was realized by varying the parameter γ to compare the proposed method performances with respect to the OBJ2 and OBJ3.  The optimal tracking of the temperature set points along the time horizon is displayed. During the daily cycle, the proposed MPC model continuously monitored and controlled the inside temperature, which remained approximately close to the optimal tracking one, allowing the GCHP to operate nearer to its maximum efficiency ( Figure 5). In Figure 6, the compressor power Pel i and the useful heat transfer Q i of the GCHP are displayed according to the control variables. The maximum value for Pel i is about 2800 W. The efficiency of the GCHP is shown in Figure 6 in terms of the COP i , associated to the temperature of the water exiting from the HP and feeding the AHU. As one can expect, if the fluid temperature at the load side decreases, the HP condenser temperature decreases, and this implies an increase of the COP i . Moreover, it is necessary to consider the peculiar formula employed in the present model that accounts for the COP i limited at a maximum value equal to 6. The results highlighted that the possibility to take into account a reliable expected value of the outdoor climate conditions might produce significant improvements of the system performance with a reduction of the energy consumption. In the first time intervals, the water temperature of the GCHP load side (both inlet and outlet) decreased because the heating system started switched-off and turned on immediately, producing a quick increase of the water temperature.

MPC Method and Reactive Method Performance Comparison
In order to evaluate the performance of the proposed control model, a comparison between the MPC approach vs. a classical reactive method is presented.
To implement a simple reactive control method, the Objective Function (Equation (1d)) of the proposed MPC model was replaced by the following equation: This constraint forces the activation of the GCHP when the inside controlled temperature T g i is lower than the tracking value T g track i for each specific time interval. In the same way, if the inside temperature exceeds the set point, the GCHP is switched off. Figures 7 and 8 show exactly the same variables as Figures 3 and 4, for an easy comparison of the different behaviors. The high-frequency oscillations in the temperature values that appear in Figures 7 and 8 are generated by the use of the classical reactive method, which implies switching on and off the GCHP consecutively, producing a significant variation in the water temperature.  In fact, the trend of the examined parameters for the case of a simple reactive control method speedily fluctuate, because the system is continuously switched on/off to track the desired setpoint value T g track i . A great electrical energy saving in the MPC approach results from the comparison between the behavior of Pel i using the reactive approach in Figure 9 and using the MPC method in Figure 5. From the analysis of Figure 10 and the comparison with Figure 6, it is interesting to note that the MPC control allows the system to work at higher values of the COP i , because it is able to maintain the system at a lower temperature T out i , around 312 K. On the contrary, the reactive control works at a higher temperature T out i , which reaches about 323 K. As a consequence, the system controlled using the proposed MPC method exhibits a reduction of the electrical power consumption (comparison between Figures 5 and 9) that leads to lower costs of operation. Figure 11 presents the direct comparison of the COP i values for the two approaches. In Figure 12, the behavior of the state variables T g i associated with the indoor temperature are displayed for different values of the parameter γ in the MPC and of parameter crt in the reactive method (RM). Imposing small values of the control parameter crt in the reactive method, Equation (12), the T g i fluctuation is reduced in time and in extension (see, as an example, T g i in RM for crt = 0.2). In those cases, the HP activation is reduced, decreasing the energy consumption but, also, leading to a failure in keeping track of the temperature during most of the time horizon. Besides, the comparison between the MPC approach and reactive method performance was carried out by varying the weighted parameters in the multiobjective optimization control model. In particular, the controller design based on the weighted sums of the three objectives in the optimization model was decomposed in its components. The two approaches were evaluated with respect to the second (OBJ2, Equation (1b)) and the third objectives (OBJ3, Equation (1c)), respectively, associated with the minimization of the electric power Pel i and the minimization of the maximum value of deviation between the current indoor air temperature in the greenhouse and the target one. Thus, to evaluate the tradeoff between energy saving (OBJ2) and tracking costs (OBJ 3) in the MPC approach, the parameter γ in Equation (1d) was modulated, while, in the reactive method, the parameter crt in Equation (12) was varied according to the range of feasible values. The resulting Pareto optimal solutions in Figure 13 shows that the reactive control was dominated by the MPC method. Different solutions for the MPC and reactive approaches are compared as a function of two opposite terms in the objective function.

Conclusions
In this work, using a MPC methodology whose cost function minimizes three different objectives, a model was implemented to optimize the energy saving in a greenhouse. In particular, the aim was to control the flow rate of hot water generated by a heating system in order to trace the optimal indoor temperature specific for a crop cultivation.
The MPC was applied to a nonlinear model for the optimal management of the microclimatic internal parameters of the greenhouse, taking into account the energy exchanges and the physical constraints of each component. By the MPC, the controller showed a rapid output tracking, and only a small fluctuation appeared in the first-time intervals with respect to the optimal trajectory of the desired temperature.
In the proposed MPC, the weighted parameters in the objective function were set to continuously track the desired temperature in the protected cultivation environment (OBJ3). This choice significantly reduced the deviation between the current and target indoor temperatures, with better performance of the MPC for almost 85% with respect to the reactive method over a time horizon of 20 h. Besides, from the energy consumption viewpoint, the MPC represented the best solution in terms of energy saving. As appeared in Figure 13, for comparable values of the temperature deviation (OBJ3), the MPC used lower electric power Pel than the reactive method (OBJ2). In the best case, for γ = 550 and crt = 1.3, the MPC allowed saving about 31% of the electric power with respect to the on/off control.
The main interesting feature of the proposed multiobjective approach was the possibility to separately weigh the objectives in the cost function in order to obtain the solution that best fits with the decision-maker's requirements. If the farmer decides that the main purpose of his/her control process addresses the energy saving with respect to temperature tracking, which assures the quality of the crop growth environment, the main parameters of the objective may be enlarged to enforce that the related costs might prevail in the minimization problem.
MPC tuning was examined with several values of weighted parameters in the multiobjective cost function to achieve the optimal setting for the controller's performance. Subsequently, a classical relay control was applied to the same model. The parameters of the on/off controller were varied, and the results were compared with those obtained using the MPC controller in terms of the two components of the cost function that were the minimization of the electric power consumption and the divergence of the indoor air temperature with respect to the predefined one. The results indicated that the Pareto front associated with the MPC controller dominated the relay control one in all simulations.
Author Contributions: Conceptualization, R.S. and M.F.; methodology, C.B. and A.P.; software, C.B. and E.Z.; writing-original draft preparation, C.B. and A.P. and supervision, R.S. and M.F. However, the efforts in this work by all the authors can be considered equal. All authors have read and agreed to the published version of the manuscript.