Application of dynamic programming algorithm in winter heating control of greenhouse

Fei Gao, Hongbin Tu, Zhu Delan, Mengyang Liu, Shi Changyang, Rui Zhang, Ruixin Wang, Zhu LiInternational Journal of Agricultural and Biological Engineering 2024 · DOI

This paper presents a practical application of dynamic programming and model predictive control to one of agriculture's most energy-intensive challenges: keeping greenhouses warm during harsh winters without breaking the bank.

TL;DR

Researchers developed an IoT-based greenhouse heating system that uses a dynamic programming algorithm to predict and optimize heating cycles. By looking 10 steps into the future and "distilling" complex optimizations into a simple linear control strategy, they reduced energy consumption by 14.5% while significantly stabilizing indoor temperatures.

What Problem Does This Paper Address?

Winter greenhouse production is a balancing act. If the temperature drops too low, crops die; if it fluctuates too much, growth is stunted. Most current systems use "threshold control"—a simple thermostat-style logic that turns heat on at a minimum temperature and off at a maximum.

The problem? Threshold control is reactive. It doesn't account for the thermal lag of the building, the specific heat capacity of the air, or the rapidly changing outdoor environment. This leads to "overshooting" targets, large temperature swings, and wasted electricity. The authors sought a proactive mathematical approach that could minimize both temperature deviation and energy costs simultaneously.

Methods

The authors framed greenhouse heating as a multi-stage decision process. Their approach involved three main layers:

  1. Physical Modeling: They established a state transition equation based on thermodynamics. This model accounts for the heat supplied by air-source heat pumps, heat lost through the greenhouse enclosure (walls/roof), and the specific heat capacity of the air.
  2. Optimization via Dynamic Programming (DP): Using a Model Predictive Control (MPC) framework, the system looks ahead 150 minutes (ten 15-minute steps). It uses a quadratic objective function to find the "cheapest" way to keep the temperature near the target. They solved this using the quadprog solver in Matlab.
  3. Strategy Distillation: Recognizing that running complex optimizations in real-time on simple field controllers is difficult, the authors used the DP results to train a linear regression model. This created a lightweight "policy function" that a local PLC (Programmable Logic Controller) can execute instantly based on current sensor data.

The system was deployed via an IoT architecture: sensors send data to a cloud server (running Python), which calculates the optimal heating time and sends instructions back to the field controller.

Datasets

  • Training/Calibration Data: Collected between December 6th and 20th, 2021, at the China Arid Area Water-saving Agricultural Research Institute. This data was used to calculate the greenhouse's specific heat transfer coefficient ($K$) and the heating system's performance parameters ($h$).
  • Optimization Dataset: 1,034 groups of optimized control sequences were generated to train the final linear regression model.
  • Validation Data: A real-world test run on January 10th–11th, 2022, with outdoor temperatures ranging from -4.0°C to 8.0°C.

Key Insights and Ideas

  • The "Smart" Shortcut: The most innovative aspect is not just using Dynamic Programming, but using it to "teach" a simpler linear model. This allows for sophisticated, forward-looking control logic to run on low-power hardware.
  • Physiology-Based Targets: The system doesn't just aim for a static number. It implements "variable temperature management"—lowering targets at night to assist in plant nutrient transport and raising them in the early morning to "prime" the plants for photosynthesis.
  • Thermodynamic Grounding: Unlike many "black-box" AI approaches, this model is grounded in physical constants (air density, heat transfer coefficients), making it more predictable and easier to troubleshoot for engineers.

Key Results

  • Energy Savings: The optimized method saved 7.83 kW·h of electricity compared to threshold control, representing a 14.56% reduction in energy use.
  • Superior Stability: The temperature fluctuation range was reduced by 0.9°C. While the old system saw swings of 4.3°C (exceeding its own set limits), the new system kept maximum fluctuations to just 1.4°C.
  • High Fidelity: The simplified linear policy function achieved an $R^2$ of 0.895, proving it could mimic the complex dynamic programming solution with high accuracy.

Limitations and Future Work

  • Single-Variable Focus: The current model focuses almost exclusively on temperature. In a real-world setting, humidity, $CO_2$ concentration, and light levels are also critical and often coupled with temperature (e.g., heating air changes its relative humidity).
  • Model Specificity: The heat transfer coefficients are specific to the "double-arch, double-film" structure used in the study. Applying this to a glass or polycarbonate greenhouse would require recalibrating the physical constants.
  • Scaling Complexity: The authors note that as more variables (like humidity) are added, the relationship may become non-linear, potentially requiring deep neural networks instead of the simple linear regression used here.

Summary updated

Abstract

In order to solve the immaturity of decision-making methods in the regulation of winter heating in greenhouses, this study proposed a solution to the problem of greenhouse winter heating regulation using a dynamic programming algorithm. A mathematical model that included indoor environmental state variables, optimization decision variables, and outdoor random variables was established. The temperature is kept close to the expected value and the energy consumption is low. The model predicts the control solution by considering the cost function within the next 10 steps. The two-stage planning method was used to optimize the state of each moment step by step. The temperature control strategy model was obtained by training the relationship between indoor temperature, outdoor temperature, and heating time after optimization using a regression algorithm. Based on a typical Internet of Things (IoT) structure, the greenhouse control system was designed to regulate the optimal control according to the feedback of the current environment. Through testing and verification, the optimized control method could stabilize the temperature near the target value. Compared to the threshold control (threshold interval of 2.0°C) under similar weather conditions, the optimized control method reduced the temperature fluctuation range by 0.9°C and saved 7.83 kW•h of electricity, which is about 14.56% of the total experimental electricity consumption. This shows that the dynamic programming method is feasible for environmental regulation in actual greenhouse production, and further research can be expanded in terms of decision variables and policy models to achieve a more comprehensive, scientific, and precise regulation. Key words: greenhouse; dynamic programming; heating control; model predictive control; Internet of Things DOI: 10.25165/j.ijabe.20241704.8221 Citation: Gao F, Tu H B, Zhu D L, Liu M Y, Shi C Y, Zhang R, et al. Application of dynamic programming algorithm in winter heating control of greenhouse. Int J Agric & Biol Eng, 2024; 17(4): 60–66.
BibTeX
@article{gao2024application,
  author = {Fei Gao and Hongbin Tu and Zhu Delan and Mengyang Liu and Shi Changyang and Rui Zhang and Ruixin Wang and Zhu Li},
  title = {{Application of dynamic programming algorithm in winter heating control of greenhouse}},
  journal = {International Journal of Agricultural and Biological Engineering},
  year = {2024},
  doi = {10.25165/j.ijabe.20241704.8221},
}
Figure