Copyright © IFAC Mathematical and Control Applications in Agriculture and Horticulture, Hannover, Germany, 1997
OPTIMAL CONTROL OF GREENHOUSE CLIMATE USING A SHORT TIME CLIMATE MODEL AND EVOLUTIONARY ALGORITHMS
Hartmut Pohlheim l and AdolfHei8ne~
I
Technical University ofIlmenau, Faculty of Informatics and Automation, PF 10 05 65, 98684 Ilmenau, Germany,
[email protected] 2 Institut fur Gemiise- und Zierpj/anzenbau GroJ3beerenlErfurt e. V. Theodor-Echtermeyer-Weg 1, 14979 GroJ3beeren, Germany
Abstract: The use of evolutionary algorithms for calculation of the optimal control of the states of a greenhouse system will be presented. The integrated model employed (greenhouse climate, crop growth, outside weather conditions and control equipment) predicts temperature, air humidity and CO2 concentration in a time interval of 15-60 minutes (short time-scale model). The paper presents the optimization of the control of the greenhouse climate to maximize the profit under certain constraints (for instance, prevention of stress for the crops) using evolutionary algorithms. By incorporation of problem specific knowledge into the evolutionary algorithm better results were produced in a shorter time. The results of optimization for optimal control using real world weather data are shown. Keywords: optimal control, integrated model , greenhouse climate, evolutionary algorithms
This model can be employed for short time-scale control tasks such as maximization of crop growth and the prevention of stress. Modified evolutionary algorithms were used to solve the optimization task. Two evolutionary algorithms are outlined and the advantages and disadvantages of each are shortly discussed. Real world weather data were used for the optimizations.
1 INTRODUCTION The efficiency of plant production in greenhouses depends significantly on the adjustment of optimal climate growth conditions to achieve high yield at low expense, good quality and low environmental load. To achieve these goals several components (temperature, air humidity and CO 2 concentration) must be controlled optimally given certain criteria through heating, ventilation and CO 2 injection. The continually changing optimal state must be maintained over the full growth period. Thus, a high dimensional optimization task must be solved.
Section 2 briefly describes the greenhouse climate model. In Section 3 the optimization algorithms used are outlined. The optimization results are presented in Section 4. Section 5 gives concluding remarks and some directions for further investigations.
Solutions based on non-linear optimization employing yield models (cucumber, tomato) for discretization intervals of several days were presented in, for instance, Arnold (1987), Markert (1990) and Schmidt (1985 ). These solutions represent dynamic long timescale controls, that should be supplemented by short time-scale controls (minutes, hours). The long timescale control is the high level control defining the valid control domain for the low level short timescale control.
2 GREENHOUSE CLIMATE MODEL The greenhouse climate model, Figure 1, describes the dependence of temperature, air humidity and CO 2 concentration inside the greenhouse on the outside weather conditions and the control equipment using 3 nonlinear differential equations of first order. The 3 differential equations of the model are the balance equations of the greenhouse interior for 1) energy (temperature, TEMl [OC)), 2) vapor, DDl [glm 3] (air humidity), and 3) CO 2 (C0 2 concentration, Cl [ppm)). The short time-scale crop growth model con-
This paper presents the optimization of temperature, air humidity and CO 2 concentration employing an integrated greenhouse climate model, see (HeiBner, 1996) for short time-scale prediction (15-60 minutes).
113
The model uses a number of physical constants, greenhouse parameters, and coefficients for the description of transpiration and CO 2 gas exchange by models and plant parameters. Due to space limitations this paper only briefly outlines the model. For an extended description of all parameters and equations as well as an explanation of all variables refer to (HeiBner, 1996, 1997; Pohlheim and HeiBner, 1996). The profit, PROFIT [0.01 DMI(m2·h)] is represented by: 1) biomass, BIOM, 2) fruit price, PRj, 3) cost of CO 2 enrichment, PR], and 4) cost of heating, P R 3 • PROFIT=YlELD · PR]-W · PR2 -Q · PR3
Figure 1: Scheme of greenhouse climate model 2
The dried fruit biomass, BIOM, is calculated by the CO 2 gas exchange of the plants, gawe. The biomass is converted into YIELD by multiplying the biomass with the percentage of yield (55%) and dividing with the percentage of dried fruit mass (8.5%). The cost of CO 2 enrichment is calculated from the price of CO 2 and the cost of heating from the price of oil.
sists of 2 equations for 1) transpiration, trans [glm ·h] and 2) CO 2 gas exchange, gawe [glm 2 ·h] (HeiBner, 1997). We use the crop growth model for sweet pepper throughout the whole paper. The greenhouse climate can be influenced by 4 control components: I) heating, Q [W1m2], 2) ventilation, LR [m 3/(m 2 ·h)], 3) CO 2 enrichment, W [gI(m2·h)] and 4) vapor injection, RM [gI(m2·h)].
The standard constraints of the controls are defined by the boundaries of the domain of the control variables: heating [0 ... 150 W 1m2]; air ventilation [2 ... 100 2 m 3/(m 2.h)] and CO 2 enrichment [0 ... 10 gI(m ·h)] . Vapor injection is not currently used. The states of the greenhouse climate are constrained to prevent stress of the plants. Currently we employ constraints for the temperature in the greenhouse. The temperature should always be above 16°C and if possible not higher than 36°C.
The outside weather conditions to be measured are 1) solar radiation, IGLOB [W/m2], 2) air temperature outside, TEMA [0C] , 3) air humidity outside , FA [% r.F.], 4) CO 2 concentration outside , CA [ppm] and 5) wind speed, U [mls]. The greenhouse model uses only one compartment (interior of the greenhouse including plants). Thus, additional input values have to be considered: 1) floor temperature, TEMB [0C] and 2) cover temperature, TEMG [0C] . Both values can be measured . Another possibility (used here) is the derivation of these values from the outside weather conditions and the inside climate through a regression model. The temperature used in the balance equations is determined by the specific heat capacity of air and plants in the greenhouse. Thus, the temperature is the average of air and plant temperature.
Control healing
C onstrainlS
Weather
control
solar radIation.
_
Figure 2 provides an overview of the interdependencies between all elements of the integrated greenhouse climate model and the dependencies used to calculate the profit. The greenhouse climate model is a set of first-order differential equations. Using the initial values of the variables of the differential equations the system has a solution for a final point. The integration of these equations solves the system over a given time period. We used an embedded RUNGE-KulTA method of 4th(5th) order for the integration of the greenhouse climate model.
climate
Co,
injeclion vcnr.i.lation
Greenhouse climate temperature
air humidity
CCh concentration
-
healing injection
C~
Profit
(1)
3 DESCRIPTION OF THE OPTIMIZATION ALGORITHM
Plant transpiratIOn
co, exchange (biomass)
+
For the greenhouse climate model a control should be calculated. Thus, methods of optimization of dynamic systems must be used .
yield
(biomass)
Evolutionary algorithms were used as optImization algorithm, an alternative to deterministic optimization algorithms. Evolutionary algorithms differ from deterministic search methods (for instance gradient
Figure 2: Scheme of profit calculation showing all dependencies
114
The ESEA represents a local search algorithm. The mutation operator adapts individual step sizes. After a number of generations, a more directed search can be executed. Because ESEA is a local search strategy it could become trapped in local minima.
methods) mainly in the manner in which variables are changed. Whereas gradient methods change the variables according to deterministic rules, evolutionary algorithms are based on random transition rules. Thus, evolutionary algorithms do not depend on special properties of the objective function . The design of the objective function is not constrained by special requirements. This allows straightforward implementation and use of the evolutionary algorithm for optimization of large and complex systems. For a further discussion of evolutionary algorithms refer to (Pohlheim, 1996).
Both algorithms are able to solve the problem at hand. Because of their different properties each algorithm excels at different points of the optimization. The MSCEA is best suited for initial optimization to find promising areas for the following searches or to gather and adjust problem specific knowledge. The MSCEA is a robust search and produces good results all the time. The ESEA is very good at searching in a smaller area, because of the local search properties. At the later stages of the optimization the problem often incorporates correlated variables - a condition much easier for ESEA than for MSCEA.
3.1 Parameters ofthe evolutionary algorithm For optimization we employed two evolutionary algorithms: the Multi Strategy Competition Evolutionary Algorithm (MSCEA) and the Evolution Strategy Evolutionary Algorithm (ESEA). Both algorithms are part of the Genetic and Evolutionary Algorithm Too/box for use with MATLAB (Pohlheim, 1996), which was used for all computations.
Both algorithms were used during the optimization process. The initial optimizations were mostly carried out using the MSCEA. In later stages of the optimization process, when problem specific knowledge was incorporated into the search, the ESEA was mainly used. However, without the MSCEA it would have been difficult to gather all this problem specific knowledge.
The following operators and parameters were used for the MSCEA: • 4 subpopulations with 50 individuals each over 100-250 generations, • fitness assignment by linear ranking (selective pressure: 2), • elitest truncation selection, generation gap: 0.9, • discrete recombination and line recombination, • real valued mutation, different precision (rough, middle , fine) and range settings (large, middle, small), • unrestricted migration every 20 generations, • competition between subpopulations every 8 generations.
Each individual in the evolutionary algorithm represents the control variables of the simulation period. As shown in Section 2 the greenhouse climate model can be controlled employing 4 control variables. Currently we are using 3 control variables: heating, ventilation and CO 2 enrichment. Vapor injection is set to zero all the time.
The MSCEA represents a global search algorithm. Every subpopulation implements a different search strategy, from a rough search (large mutation steps) to a fine local search (small mutation steps). All these different search strategies work at the same time.
The control variables are discretized at equidistant time points. For the simulation a first order hold is employed to obtam control values between the discretization points. The number of variables per individual can be obtained using equation 2:
3.2 Representation of individuals and Cost function
The following operators and parameters were used for the ESEA: • 3 subpopulations with 2 individuals each over 200-400 generations, • no fitness assignment between individuals (selective pressure: 1), • every individual produces 6 offspring (generation gap: 6), • best two offspring of every subpopulation replace parents forming new subpopulation, • no recombination, • mutation by mutation operator of an evolution strategy (Hansen, et al., 1995) using different initial sizes of individual mutation steps (large, medium and small).
Num Var = ( SimTime + Contro/Step Contro/Step =O.2Sh
1). NumControl;
(2)
NumCOnlro/ =3
A control step every 15 minutes is small enough for the simulation and keeps the number of variables as small as reasonable. Thus, for a simulation time of 4 hours an individual consists of 51 variables. To keep the number of variables and the optimization time acceptable a simulation period of 4 hours was normally employed. To optimize longer time periods the optimization was divided into 4-hour-pieces and the end states of one simulation were used as start values of the next period. Thus, arbitrarily long
115
every month of the year boundaries for all three control variables were defined. The boundaries were further specified down to one hour of a day. During optimization the operators worked over this specifically defined domain of the variables.
simulation periods could be computed using standard hardware (PC Pentium 120 MHz, 32MB RAM). The cost function used in the model is the maximization of profit, equation 1, under fulfillment of all constraints. As the Genetic and Evolutionary Algorithm Toolbox optimizes by minimization in equation 3 the profit is multiplied by -1. To enforce the constraints the cost function assigns a penalty to individuals which do not meet the defined constraints.
Another possibility is the use of other heuristics known from practice. If heating is high, ventilation is not really useful, the same is true for CO2 enrichment and vice versa. However, at the moment such heuristics are not used.
TE
Cost
=-
f
PROFIT dt + Penalty
Using the special initialization and the specification of the search domain for every month better solutions for the control values could be obtained in a smaller number of generations. Additionally, using problem specific knowledge the search was more robust and reached consistently better results, even compared to a much longer running uninitialized evolutionary algorithm.
(3)
Ts
For the penalty function a weighted sum was utilized, equation 4. Val is either one of the state variables of the greenhouse climate or a control value, Constr the corresponding constraint. In choosing the weights W the importance of every constraint can be defined.
All this shows that the evolutionary algorithm is only one part of the optimization algorithm. In particular, if online response time requirements in practical use of the model and optimization should be met, all possibilities for enhancing the control must be used. 3.3 Incorporation of domain specific knowledge
4 First optimizations of the greenhouse climate model were done without using any problem specific heuristics. However, the computation could be accelerated considerably by incorporating domain specific knowledge.
EXPER~ENTALRESULTS
In this section an example of the results of simulation experiments using the greenhouse climate model, evolutionary algorithms and problem specific knowledge is presented. The weather data used in this report are measured weather data for GroBbeeren (Berlin), Germany for 1995.
In a standard evolutionary algorithm the initialization of the individuals is done uniformly at random in the domain of every variable. Here, a special initialization function was employed. The initialization of the variables of the individuals was restricted to a small band of the domain. This band was defined by good control strategies for standard weather conditions of the respective time of year. Using the MSCEA, solutions for every month of the year were calculated. These good solutions formed the center of the initialization area. Not only a good solution for the respective month was used as initialization base. Additionally, good starting solutions of the previous and following two months were included. The rationale for this is that these days are similar under different weather conditions. A cold day in June could be very similar to a normal day in April and a hot day in June is similar to a normal day in August.
The optimizations were carried out for all available weather data, April - September 1995. Because of space limitations one example is presented only. This example gives a good impression of the possibilities and power of the presented system. The four graphs in figure 3 show all relevant data from the simulation of the system using the optimized control values. All graphs employ the same time scale, day of the year. The fourth graph contains the real world weather data. The most important information is the value of the solar radiation, IGLOB. The solar radiation is high on all days except the third. The third day shows almost no solar radiation. The third graph shows the optimized control values over the whole time scale. The third day is striking: high heating and only a short period of CO 2 injection are used. The top graph presents the resulting states of the greenhouse climate. The second graph shows the cumulative biomass production and the resulting profit according to equation 1. All four graphs together give a compact overview of the states of the system.
Another area of incorporation of problem specific knowledge is changing the domain of the variables depending on the time of year. For example, in winter the range of ventilation is much smaller than in summer. The converse is true for heating. Thus, the search could be further narrowed down and the guiding of the evolutionary algorithm enhanced. For
116
Further simulation results for other days (not presented here) show further characteristics. If ventilation is on, no or less CO2 is injected, because the cost to maintain a higher CO2 concentration with ventilation on is higher than the increased yield. When the inside temperature gets too high, due to high solar radiation, ventilation is opened.
Some results are similar for all five days. Heating is on overnight to maintain the lower constraint, 16°C, for the inside temperature, TEMl. The heating is not higher than is necessary to keep this temperature. During the day CO2 injection is on to increase the C02 concentration.
greenhouse climate ~40r-----.------r----~-----'------.-----.------r----~-----'----~
U
71 30 ..!....
CS o
20
:il w
I-
0 130
130.5
131
131 .5
132
132.5 133 time [d] biomass and profit
134
133.5
134.5
135
134.5
135
1.5
]
biomass/l00 profit
e
Q.
I
- --
0.5
1
..!.... (/'J (/'J
-------
0
as E 0 15
-0.5 130
130.5
131
---------------
131 .5
132
132.5 133 time [d] control equipment
133.5
-
-
134
-
~120r-~--~------,_~\"\r=========~======:,~--~---r--1r----~~-.--~------,
8 100
,If
I' / ,
/r,
-'::1 /"\ ; ~ 80 ': : ,
L
c:
':-~_
60
;:
·.l
T
: ~I j
>
..!....
ro
~
20
heating
- .
I. ..
C:. ::
,
fA.'
i:::::::
IN""
,~\~ i ),,1
I
".
~'
j : : .. '.
... ,;
:1
\
~
1
/I
r\
I
I~l
I, .'
"
, ."
.
,:::
,
:.. ...i
f
t.' : :"-"
:.•
\i
I,
;t'/\\V~/,~,\ ::~. Y
'
t :t:t·--:: 11'/
,I
~
\
ventil. C02*10
,\
j: " . i::
~ 40
- -
: :~ I'
:. :,:.::. 11.,
: 1·•
11 1
o~--~~~~~------~~~~~~~~~--~--~~~~~~~~~~---
130
130.5
131
131.5
132
132.5 time [d] climate: 11 ,05. 0:00 - 15.05, 23:52
133
133.5
134
134.5
135
100r-------~--------~--------~------~------~
80
,..
\
,
----
---
\ \
/
\
I
\
.- . - . - - - a
130
131
132
133
134
JC
0 .. ·
.. 0
+-
. -+
TEMB TEMG TEMA FA CAll 0 IGLOB/l0 U*10
135
time[d]
Figure 3: Results of optimization of the greenhouse climate model under real world weather conditions over five consecutive days in May 1995
117
various states. The plant models will also be enhanced.
It is difficult to compare the calculated control strategies to strategies derived using different models or optimization techniques. At the moment we are looking for a comparable system or implementation. One possibility could be a strategy that computes optimal controller set points for day and night or every hour, as is often employed in current greenhouse control systems. However, these strategies must still be implemented and calculated.
REFERENCES Amold, E. (1987). Zur optimalen Steuerung zeitdiskreter dynamischer Prozesse mittels nichtlinearer Optimierung mit Anwendungen auf die Klimasteuerung von Gewachshausern. Dissertation, Technische Universitat Ilmenau. Bailey, B. J. and Z. S. Chalabi (1994). Improving the cost effectiveness of greenhouse climate control. Computers and Electronics in Agriculture, 10, 203-214. Chalabi, Z. S., B. J. Bailey and D. J. Wilkinson (1996). A real-time optimal control algorithm for greenhouse heating. Computers and Electronics in Agriculture, 15, 1-13. Hansen, N., A. Ostermeier and A. Gawelczyk (1995). On the Adaptation of Arbitrary Mutation Distributions in Evolution Strategies: The Generating Set Adaptation. In: Proceedings of the Sixth International Conference on Genetic Algorithms (L. J. Eshelman, Ed.), pp. 57-64, Morgan Kaufmann Publishers, San Francisco, California, USA. HeiBner, A. (1996). Ein einfaches Gewachshausklimamodell flir die Kurzfriststeuerung von Temperatur, Luftfeuchte und COrKonzentration. Gartenbauwissenschafi, 61 (6), 289-300. HeiBner, A. (1997). Der COrGaswechsel von Paprikapflanzen in Abhangigkeit von der Bestrahlungsstlirke, der C02-Konzentration, der LUfttemperatur und dem Dampfdrucksattigungsdefizit der Luft: Messungen und Model!. Gartenbauwissenschafi, 62 (2), 78-90. Markert, A. (1990). Aggregation pflanzenphysiologischer Wachstumsmodelle und Berechnung von Steuerstrategien fliT das Gewachshausinnenklima mittels Verfahren der nichtlinearen Optimierung. Dissertation, Technische Universitat Ilmenau. Pohlheim, H. and A. HeiBner (1996). Optimale Steuerung der Zustandsgr6Ben im Gewiichshaus mit Genetischen Algorithmen: Grundlagen, Vecfahren und Ergebnisse. Bericht, Technische Universitiit Ilmenau. Pohlheim, H. (1996). Genetic Algorithm Toolbox for use with Matlab. Technical Report, Technische Universitiit Ilmenau. Schmidt, M. (1985). Bestimmung optimaler klimatischer Wachstumsfaktoren von Gewiichshauskulturen auf der Basis pflanzenphysiologischer Beschreibungsmodelle. Dissertation, Technische Universitiit Ilmenau. van Straten, G. and H. Challa. (1995). Greenhouse climate control systems. In: Greenhouse climate control- an integrated approach (Bakker, J. c., G. P. A. Bot, H. Challa, and N. J. Van de Braak, Ed.). Chap. 6.3, pp. 249-261, Wageningen Press, Wageningen.
5 CONCLUDING REMARKS In this paper experiments on control of greenhouse climate were presented. The results show the applicability of evolutionary algorithms for calculation of the optimal control. The calculated control strategies for heating, ventilation and CO 2 injection to adjust optimal climate inside the greenhouse depending on real world weather conditions agree with experience and theoretical knowledge. The integrated greenhouse system is regarded as one complete system for the optimization. The greenhouse climate model used and the crop growth model integrate all necessary components of the system. Any changes in one of the parameters or equations is without any further adjustments and immediately effective. The evolutionary algorithms used provides an direct application, compared to classical optimization methods. The adaptation to new greenhouses or different plant models is straightforward. No special adjustment of the optimization task is necessary. Another advantage is the detailed and easy definition of the cost function. Problem specific knowledge can directly be incorporated. All this ensures easy usage. This paper presented one example of optimization results for the control of the greenhouse climate using r~al world weather conditions. The results showed the fine grained reaction of the optimization to changing weather conditions, during one day or from day to day. The experiments presented are just one small example of the experiments carried out. The optimization was done for all available weather data of 1995, April to September. All this justifies the further development of the underlying optimization method and its application to specific tasks of control of greenhouse climate. However, to use the method for online optimization, the current computing times (30-45 minutes for a simulation interval of 4 hours) should be reduced further. Promising directions are the further enhancement of the evolutionary algorithm and the incorporation of an extended repetitive optimization strategy. In future research we will consider the incorporation of long time-scale models and strategies to define the actual best climate conditions and the constraints for
118