You are currently viewing a new version of our website. To view the old version click .
Applied Sciences
  • Article
  • Open Access

17 July 2025

AI-Enhanced Nonlinear Predictive Control for Smart Greenhouses: A Performance Comparison of Forecast and Warm-Start Strategies

and
Faculty of Engineering and Technology, Thai Nguyen University of Information and Communication Technology, Thai Nguyen 250000, Vietnam
*
Author to whom correspondence should be addressed.
This article belongs to the Special Issue Future of Smart Greenhouses: Automation, IoT, and AI Applications

Abstract

Accurate, energy-efficient climate regulation is crucial for scaling smart greenhouse production. While nonlinear model predictive control (NMPC) can co-optimize yield and resource use, its efficacy hinges on short-range weather information and real-time solver feasibility. This paper investigates the performance of advanced NMPC strategies for smart greenhouse climate control, with particular emphasis on the roles of AI-driven disturbance prediction and warm-start initialization for real-time optimization. Six controller configurations, including feedback-only, LSTM-based forecast, and ideal disturbance models, each with and without warm-start, were tested in a 40-day simulation of a lettuce smart greenhouse. Performance metrics included final biomass, constraint violations, resource costs, profit, and solver time. Results show that feedback-only controllers maximize yield and profit, incurring higher CO2 costs but lower heating costs, alongside greater constraint violations compared to the predictive strategies. Predictive and ideal disturbance-aware controllers effectively reduce resource consumption and improve constraint compliance at the expense of lower yields. Importantly, warm-start initialization significantly accelerates computation without affecting control quality. The study also demonstrates that penalty parameters, rather than economic weight settings, predominantly determine aggregate constraint violation. The findings provide actionable insights for designing and deploying NMPC-based greenhouse controllers, highlighting the importance of warm-start techniques and the trade-offs between productivity, resource efficiency, and environmental compliance.

1. Introduction

Smart greenhouse agriculture plays an increasingly critical role in addressing global challenges such as food security, climate change, and sustainable development. These systems integrate automation, IoT technologies, and AI-driven control strategies to enable year-round, resource-efficient crop production. To achieve precise climate regulation in smart greenhouses, advanced control techniques have become essential, allowing growers to optimize yield and quality while minimizing energy and CO2 consumption.
NMPC has emerged as a leading solution for greenhouse climate management, thanks to its capacity to handle nonlinear system dynamics, operational constraints, and multi-objective optimization [1,2,3]. Nevertheless, the effectiveness of NMPC relies heavily on the accurate prediction of environmental disturbances and the computational efficiency required for real-time implementation.
Recent advances in artificial intelligence and machine learning—especially deep neural networks such as Long Short-Term Memory (LSTM)—have enabled more accurate, data-driven forecasting of environmental variables [4,5]. Integrating such forecasts into NMPC frameworks offers the potential to anticipate and proactively mitigate external disturbances, improving both climate regulation and resource efficiency. However, most prior studies focus on single-variable prediction, and few have assessed the impact of multi-variable, AI-based forecasts on NMPC performance. In parallel, real-time NMPC is often hindered by the computational burden of repeatedly solving large-scale, constrained nonlinear optimization problems. Warm-start techniques, which leverage previous solutions to accelerate convergence, have shown significant promise in other application domains [6], but their practical impact in greenhouse NMPC—especially when coupled with advanced disturbance prediction—remains largely unexplored.
While progress has been made, there is still no systematic study that jointly evaluates the control and computational performance of NMPC under different disturbance forecasting strategies. To address these limitations, this study proposes an AI-enhanced NMPC framework in which a single multi-output LSTM network is trained to jointly forecast all major external disturbances—outdoor temperature, humidity, CO2 concentration, and solar radiation—relevant to greenhouse climate control. By capturing temporal dependencies and nonlinear relationships among these variables, the LSTM model delivers comprehensive, realistic forecasts for proactive climate regulation. Furthermore, to provide a thorough and fair assessment, this work conducts a unified comparative study of three NMPC configurations: (1) feedback-only NMPC, assuming constant disturbances; (2) LSTM-based predictive disturbance NMPC, utilizing joint multi-variable AI-based disturbance prediction; and (3) ideal predictive disturbance NMPC, using true future disturbance profiles as an upper-bound benchmark. The practical value of warm-start optimization is also systematically investigated across all configurations. Utilizing a detailed lettuce greenhouse model [7] and extensive 40-day simulations, the effectiveness of feedback-only, predictive, and ideal preview controllers—with and without warm-start—is rigorously assessed using comprehensive key performance indicators (KPIs) such as final biomass yield, setpoint adherence, resource consumption, net profit, and solver computation time.
The findings of this research are expected to provide valuable, actionable insights for both researchers in control engineering and agricultural systems, as well as practitioners seeking to implement advanced AI-enabled control solutions for optimal greenhouse environmental management. The remainder of this paper is organized as follows: Section 2 reviews related literature. Section 3 details the greenhouse model. Section 4 describes the NMPC formulation, controller variants, and performance metrics. Section 5 outlines the simulation setup. Section 6 presents and discusses the results, and Section 7 concludes the paper.

3. Lettuce Greenhouse Model

This work uses a validated greenhouse model by van Henten [7,8] to describe climate dynamics and lettuce growth. An overview of the model is presented in Figure 1. The model includes four state variables: lettuce dry weight (biomass), indoor CO2 concentration, air temperature, and humidity. The control inputs are CO2 injection rate, ventilation opening, and heating power. In Figure 1, labels and connections distinguish the control inputs, system measurements (derived from state variables), and external disturbances, with interactions represented by dashed lines. The discrete-time state-space model is formulated as:
x k + 1 = f x k , u k , d k , p y k = g x k , p
Figure 1. The employed lettuce greenhouse model [7].
Here, k Z + denotes the discrete time, x k R 𝟜 represents the state variables, y k R 𝟜 is the output, u k R 𝟛 denotes the control inputs, and d k R 𝟜 represents the (weather) disturbances. Table 1 provides the meaning of all signals. The parameter vector p R 𝟚𝟠 , along with the nonlinear functions f and g , is detailed in (2) and (4), respectively.
Table 1. Explanation of the state variables x , system outputs y , control inputs u , and weather disturbances d .
The dynamic model of the lettuce greenhouse is detailed with the nonlinear functions f   a s :
d x 1 t d t = p 1 ϕ p h o t , c t p 2 x 1 t 2 x 3 t / 10 5 / 2 d x 2 t d t = 1 p 9 ϕ p h o t , c t + p 10 x 1 t 2 x 3 t / 10 5 / 2 + 10 6 u 1 t ϕ vent , c t d x 3 t d t = 1 p 16 u 3 t 10 3 p 17 u 2 t + p 18 x 3 t d 3 t + p 19 d 1 t d x 4 t d t = 1 p 20 ϕ transp , h t ϕ vent , h t
with the flux terms are defined as:
ϕ phot , c t = 1 e p 3 x 1 t p 4 d 1 t p 5 x 3 2 t + p 6 x 3 t p 7 x 2 t p 8 p 4 d 1 t + p 5 x 3 2 t + p 6 x 3 t p 7 x 2 t p 8 ϕ transp , h t = p 21 1 e p 3 x 1 t p 22 p 23 x 3 t + p 24 e p 25 x 3 t x 3 t + p 26 x 4 t ϕ vent , c t = 10 3 u 2 t + p 11 x 2 t d 2 t ϕ vent , h t = 10 3 u 2 t + p 11 x 4 t d 4 t
Here, t R represents continuous time. The terms ϕ phot , c t ,   ϕ vent , c t , ϕ transp , h t , and ϕ vent , h   t correspond to the gross photosynthesis rate, C O 2 mass exchange through ventilation, canopy transpiration, and H 2 O exchange through ventilation, respectively.
The output equations g are defined as:
y 1 t = 10 3 x 1 t g   m 2 y 2 t = 10 6 p 12 x 3 t + p 13 p 14 p 15 x 2 t , p p m y 3 t = x 3 t , °C y 4 t = 10 2 p 12 x 3 t + p 13 11 e p 27 x 3 t x 3 t + p 28 x 4 t , %
The specific values adopted for the model parameters p are summarized in Table 2.
Table 2. Model parameters and their values [7].

4. NMPC Formulation

This section details the NMPC framework employed for precision climate control in smart greenhouse environments. It outlines the specific control objectives, describes the economic and operational constraints, and the strategies used to integrate AI-based disturbance forecasting and real-time computational acceleration.

4.1. Control Objectives and Constraints

The primary objective of the NMPC controller is to maximize crop profitability while ensuring precision environmental control. This profit is defined as the revenue from the accumulated shoot biomass minus the operational costs associated with CO2 injection and heating power usage. To formulate this control objective, an NMPC problem is defined as follows.
At each time instant t , the NMPC controller solves the following finite-horizon optimization problem:
m i n { u ( t + k | t ) , ε ( t + k | t ) } k = 0 N p 1 J subject   to :          x ( t + k + 1 | t ) = f x ( t + k | t ) , u ( t + k | t ) , d ( t + k | t ) ,          y ( t + k | t ) = g x ( t + k | t ) ,          u m i n u ( t + k | t ) u m a x ,          u ( t + k | t ) u ( t + k 1 | t ) Δ u m a x ,          y m i n ( t + k ) ε ( t + k | t ) y ( t + k | t ) y m a x ( t + k ) + ε t + k t          ε ( t + k | t ) 0 , for   k = 0 , , N p 1 .
Here, x ( t + k | t ) denotes the predicted state at time t + k based on information available at time t , u ( t + k | t ) is the control input, d ( t + k | t ) is the disturbance prediction, y ( t + k | t ) is the predicted output, and ε j ( t + k | t ) are slack variables associated with the soft output constraints.
The cost function J to be minimized is given by:
J = k = 0 N p 1 q y 1 y 1 t + k + 1 t y 1 t + k t + i = 1 3 q u i u i t + k t + i = 1 4 ρ i ε i 2 t + k + 1 t
where
y 1 ( t + k | t ) is the predicted shoot dry biomass at stage t + k ( k = 0 , , N p 1 ).
q y 1 > 0 is the economic weight associated with incremental biomass production.
q u i > 0 are economic weights reflecting the costs of CO2 injection ( u 1 ) and heating ( u 3 ); ventilation ( u 2 ) is omitted from penalization, as the employed model assumes natural ventilation with the ventilation rate determined by the window opening actuated by a motor; consequently, the energy cost associated with ventilation control is considered negligible [7,8,9].
ρ i > 0 are penalty weights on the squared slack variables ε i to regulate the extent and frequency of output constraint violations.
Penalty weight selection: In this study, the slack penalty weights for output constraints were not set to a single large value for all outputs, as is common in some related works. Instead, we assigned penalty weights inversely proportional to the amplitude of each output’s constraint bounds. This normalization ensures balanced treatment of constraint violations, regardless of output units or scales. For instance, outputs with large feasible ranges (e.g., biomass) are assigned smaller penalty weights, while those with narrow ranges (e.g., temperature, humidity) are assigned higher penalties. This strategy allows the optimizer to penalize relative violations consistently, improving interpretability and controlling fairness across heterogeneous outputs. Notably, the biomass constraint was always satisfied in all simulations, consistent with biological principles and the model structure; hence, its penalty was set arbitrarily high, with no effect on control outcomes. As a result, the penalties were set as follows: ρ1 = 105, ρ2 = 103, ρ3 = 105, ρ4 = 104.
Output Constraints: Time-varying constraints on temperature, humidity, and CO2—adapted dynamically based on solar radiation—reflect horticultural best practices for energy-efficient regulation. The bounds for the full output vector are given by:
y m i n ( t + k ) = 0 , f c o 2 , m i n ( t + k ) , f t e m p , m i n ( t + k ) , 50 T y m a x ( t + k ) = , f c o 2 , m a x ( t + k ) , f t e m p , m a x ( t + k ) , 80 T
Temperature bounds are time-varying functions of solar radiation d 1 ( t + k | t ) :
f temp , min   t + k = 10   if   d 1 ( t + k | t ) < 10   W / m 2 22   otherwise   f temp , max   t + k = 15   if   d 1 ( t + k | t ) < 10   W / m 2 27   otherwise  
CO2 bounds are time-varying functions of solar radiation d 1 ( t + k | t ) :
f co 2 , min   t + k = 0   if   d 1 ( t + k | t ) < 10   W / m 2 500   otherwise   f co 2 , max   t + k = 1600
This radiation-dependent setpoint strategy aims to optimize crop growth conditions while promoting energy conservation, based on established horticultural principles. During periods of low incident solar radiation ( d 1 ( t + k | t )  < 10 W / m 2 ), typically corresponding to night-time or heavily overcast conditions where photosynthetic activity is minimal, a cooler temperature range (10–15 °C for lettuce, as per Equation (8)) is maintained to reduce heating costs [29,30,31]. Conversely, under higher solar radiation levels, the permissible temperature range is elevated (22–27 °C, as per Equation (8)) to better support active photosynthesis, aligning with reported optimal daytime temperatures [29,30,31].
For CO2 management (as Equation (9), a radiation-dependent approach sets the minimum concentration ( f co 2 , min   ) at 0 ppm during very low light conditions ( d 1 ( t + k | t ) < 10 W / m 2 ), and 500 ppm otherwise, with an upper limit ( f co 2 , max   ) of 1600 ppm. This strategy, particularly the enrichment up to 1600 ppm during active photosynthesis, aligns with horticultural recommendations for optimal lettuce growth, which often suggest levels between 1000 and 1500 ppm [29,30], while reducing enrichment in low light conserves resources [30].
Furthermore, the relative humidity range of 50–80% is supported by findings suggesting optimal ranges within this span [29,30].

4.2. Disturbance Handling Approaches

Three approaches for handling external weather disturbances d ( k ) within the NMPC framework are implemented:
  • Feedback-Only Control (NMPC-C): This approach incorporates the currently measured disturbance d ( t ) and assumes it remains constant over the entire prediction horizon N p : d ( t + k t ) = d ( t ) , for k = 0 , , N p 1 . This represents a reactive control strategy with no foresight.
  • ML-Based Preview (NMPC-P): This controller utilizes current disturbance measurements d ( t | t ) = d ( t ) for the initial control step ( k = 0 ). For the remainder of the prediction horizon ( k = 1 , , N p 1 ), it integrates multivariate disturbance forecasts generated by an LSTM neural network. Thus, the combined sequence matches the full NMPC prediction horizon.
    The LSTM leverages a sequence of recent historical disturbance measurements (defined by a lookback window of L steps) to predict the future evolution of key weather variables ( d 1 , , d 4 ) over the subsequent N p 1 steps.
    At each control interval, the NMPC controller collects the most recent L measurements of all disturbance variables, feeds them to the LSTM, receives a multi-step forecast of length N p 1 , and concatenates this forecast with the current measured disturbance to form the disturbance trajectory of length N p used in the NMPC optimization problem:
    [ d ( t | t ) , d ( t + 1 | t ) , , d ( t + N p 1 | t ) ]
    Here, d ( t | t ) is the current measured disturbance, and d ( t + k | t ) ( k = 1 , , N p 1 ) are the LSTM-generated forecasts. Details on the LSTM architecture, input features, and training data are provided in Section 5.1.
  • Ideal Preview (NMPC-I): This ideal scenario assumes perfect, error-free knowledge of future disturbances d ( t + k ) over the prediction horizon. This serves as an upper-bound benchmark for the potential benefits of disturbance prediction.
The implementation of these strategies allows for a direct comparison of feedback, data-driven preview, and ideal disturbance information in greenhouse NMPC.

4.3. Warm-Start Initialization

To improve computational efficiency and solver convergence, a warm-start initialization strategy is employed for selected NMPC configurations (CW, PW, IW). At each control interval at time t , the optimal solution from the previous time step t 1 is used as the initial guess for the current optimization problem. The solution horizon shifted forward by one step, and the last value was duplicated to maintain horizon length.
Formally, if the previous solution was:
U t 1 = [ u ( t 1 ) , , u ( t 1 + N p 1 ) ]
then the warm start at time t is constructed as, denoted with a superscript (0):
U t ( 0 ) = [ u ( t ) , , u ( t + N p 2 ) , u ( t + N p 2 ) ]
This warm-start mechanism preserves the temporal structure of the control sequence and has been shown to substantially reduce solver iterations and computation time, particularly in scenarios with slow system dynamics or small setpoint changes. In this study, both cold-start and warm-start options are systematically compared across all disturbance-handling strategies to assess their impacts on computational and control performance.

5. Simulation Setup

This section details the generation of environmental disturbances, the performance metrics, the controller comparison approaches, and the parameters used for the NMPC simulations for evaluating the different control strategies.

5.1. Disturbance Generation and Pre-Processing

The NMPC controllers were evaluated using realistic environmental disturbances generated as follows:
Outdoor air temperature, relative humidity, and global solar radiation data were retrieved from the NASA POWER (Prediction Of Worldwide Energy Resources) database [32] for the location of Thai Nguyen, Vietnam (21.5962° N, 105.8471° E). This database served as the source for two distinct datasets:
Simulation Dataset: For the purpose of controller evaluation via simulation, data were collected for the period 1 November 2020 to 10 December 2020 (40 days). This period was selected as it represents typical conditions for an early winter cultivation cycle in this region. The original hourly data for this 40-day period were linearly interpolated to achieve a 15 min resolution, matching the NMPC control interval.
LSTM Training and Validation Dataset: The LSTM model, responsible for generating weather previews (as described in Section 4.2), was trained and validated using historical data from the period 12 November 2016 to 31 October 2020 (i.e., all data prior to the simulation/test period). This extensive dataset was also processed to a 15 min resolution.
Daily averaged atmospheric CO2 concentrations were initially extracted from OCO-2 (Orbiting Carbon Observatory 2) Level 3 data products [33]. To introduce more realistic diurnal variations crucial for greenhouse control, a Gaussian-modulated model was applied to these daily averages:
CO 2 t = C b a s e + A e T o u t T o p t 2 2 σ 2 α R t
where
CO 2 t is the synthesized outdoor CO2 concentration (ppm) at time t;
C b a s e : Base CO2 concentration (daily averages) (ppm);
A : Scaling factor for temperature impact;
T o u t ( t ) is the outdoor temperature (°C);
T o p t : Optimal temperature for photosynthesis (°C);
σ : Standard deviation for temperature effect;
α : Sensitivity factor for solar radiation impact;
R t : Incident solar radiation (W/m2).
The parameters were set as: A = 100, Topt = 22 °C, σ = 5, α = 0.04 ppm/(W/m2), chosen to reflect typical ambient variations and plant uptake influences, consistent with literature values for similar environments [29]. The resulting disturbance profiles used for the 40-day NMPC simulations are shown in Figure 2.
Figure 2. Disturbance Profiles used in 40-day greenhouse NMPC simulations. Dashed gray lines indicate lower and upper operational limits for CO2, temperature, and RH, enabling direct visual assessment of when and how much the external disturbances violate desired setpoints.
LSTM-based Weather Preview (for NMPC-P/PW): The 5.75 h (23-step) weather preview for the four disturbance variables ( d 1 , d 2 , d 3 , d 4 ) was generated using an LSTM model. The model architecture consisted of three LSTM layers with 128, 64, and 32 units, respectively. Dropout layers with a rate of 0.2 were included after the first two LSTM layers for regularization. These were followed by a separate dense output layer with a ReLU activation function for each predicted disturbance variable. The model used a lookback window of L = 20 steps (5 h) with 15 min interval data to predict the next W = 23 steps. The LSTM model was trained using an 80/10/10 train/validation/test split and optimized with the Adam algorithm, minimizing the mean squared error loss function. Training was conducted for up to 50 epochs, with a batch size of 32.
Upon completion of training, the LSTM disturbance forecast model demonstrated robust predictive performance across all weather variables. Table 3 summarizes the MAE and RMSE metrics for the train, validation, and test sets. Low error values were achieved for temperature, humidity, and CO2, whereas higher errors were observed for solar radiation due to its greater variability.
Table 3. Predictive performance of the LSTM model on train, validation, and test sets.

5.2. Controller Comparison Approaches

To facilitate direct comparison, Table 4 summarizes the six NMPC controller variants evaluated in this study. These configurations differ in their approaches to disturbance handling (feedback, ML-based preview, ideal preview) and solver initialization (cold-start, warm-start). This systematic classification enables a clear assessment of the individual and combined effects of forecast strategy and warm-start initialization on greenhouse control performance. Detailed analysis and discussion of these variants are provided in Section 6.
Table 4. Summary of the NMPC controller variants evaluated.

5.3. Performance Metrics

Controller performance was evaluated using the following KPIs:
Final Biomass ( B f , g/m2)
Total shoot dry mass of lettuce at harvest (end of simulation):
B f = y 1 ( N s )
where y 1 ( k ) is the shoot dry mass (g/m2) at simulation step k , and N s is the total number of simulation steps.
Net Profit ( P n e t , Hfl/m2)
Net profit is calculated as the revenue from harvested lettuce minus the total operating costs for CO2 and heating:
P n e t = R b i o ( C CO 2 + C h e a t )
where
Revenue from biomass ( R b i o , Hfl/m2):
R b i o = c p B f 10 3
CO2 cost ( C C O 2 , Hfl/m2):
C C O 2 = c C O 2 k = 0 N s 1 u 1 ( k ) Δ t 10 6
Heating cost ( C h e a t , Hfl/m2):
C h e a t = c h k = 0 N s 1 u 3 ( k ) Δ t
where c p is the lettuce price (Hfl/kg), c C O 2 the CO2 cost (Hfl/kg), and c h the heating cost (Hfl/J). The term B f 10 3 converts biomass from g/m2 to kg/m2; u 1 ( k ) Δ t 10 6 is total CO2 supplied (kg/m2); and u 3 ( k ) Δ t is total heating energy used (J/m2). All other variables are as defined in Section 2.
Biomass Cost ( C b i o , Hfl/kg)
Operating cost per kilogram of harvested biomass:
C b i o = C C O 2 + C h e a t B f 10 3
Constraint Violation Index ( V i , %)
The average normalized violation of each output constraint y i , i [ 1 , 4 ] , is calculated as:
V i = 100 N s k = 0 N s 1 v i ( k )
where the normalized violation at each time step v i ( k ) is defined as:
v i ( k ) = 0 , if   y i , m i n ( k ) y i ( k ) y i , m a x ( k ) y i ( k ) y i , m a x ( k ) y i , m a x ( k ) y i , m i n ( k ) , if   y i ( k ) > y i , m a x ( k ) y i , m i n ( k ) y i ( k ) y i , m a x ( k ) y i , m i n ( k ) , if   y i ( k ) < y i , m i n ( k )
where y i ( k ) is the value of output i at time step k , and y i , m a x ( k ) , y i , m i n ( k ) are its time-varying upper and lower bounds, respectively.
The primary indices reported are: V B = V 1 , V C = V 2 , V T = V 3 , V H = V 4 .
Aggregated Constraint Violation Index ( V t o t a l ,   % )
An aggregated measure of all individual constraint violation indices:
V t o t a l = i = 1 4 V i
This value provides an overall measure of constraint adherence.
Average Solver Time ( T s o l , s)
The mean CPU time required by the IPOPT solver to find the solution to the NMPC optimization problem at each control interval.

5.4. Simulation Parameters

Key parameters for the NMPC simulations are summarized in Table 5. The prediction horizon ( N p = 24 steps, 6 h) was selected to effectively capture daily environmental variability, enabling proactive climate control while maintaining computational feasibility at a 15 min control interval. This horizon also aligns with the effective forecast window of typical short-term weather prediction models [21,23].
Table 5. Core simulation parameters for NMPC evaluation.
Economic weights in the objective function were chosen to prioritize biomass accumulation ( q y 1 ) , while relatively smaller weights for CO2 injection ( q u 1 ) and heating input ( q u 3 ) were assigned to penalize excessive resource consumption, reflecting their operational costs and promoting resource efficiency (Equation (6)). The control signal ranges and rate limits are based on standard actuator capacities and established horticultural practices for lettuce production [18,20,21]. Cost coefficients for profit calculation, including lettuce price and unit costs for heating energy and CO2, are adopted from the literature [18,20].
The nonlinear optimization problem arising from the NMPC formulation is solved using a direct multiple shooting approach, implemented in Python (version 3.11.9) via the CasADi automatic differentiation framework [34]. The IPOPT solver [35] is used for nonlinear programming. The system dynamics (Equations (1)–(3)) are discretized using a fixed-step forward Euler method with a sampling time of 15 min (900 s), which also corresponds to the control interval. For controller configurations that employ warm-start initialization (Section 4.3), IPOPT’s warm-start features are activated by providing the shifted solution from the previous time step as the initial guess. All simulations are run on an Intel i7-4810MQ CPU with 20GB RAM.

6. Results and Discussion

This section presents and discusses the comparative performance of the six NMPC configurations (C, CW, P, PW, I, and IW) detailed in Section 5.2. The evaluation focuses on agronomic outcomes (biomass yield, constraint satisfaction), economic efficiency (net profit, operational costs), and computational performance (solver time). The discussion is organized based on two primary timescales: short-term (first 3 days) and full-cycle (40 days), followed by a general discussion of trade-offs and controller selection.

6.1. Short-Term (3-Day) Performance

Figure 3 presents the time evolution of four key system outputs—biomass, internal CO2 concentration, temperature, and relative humidity—over a 72 h simulation for six NMPC configurations (C, CW, P, PW, I, IW). The biomass plot shows similar growth patterns among all controllers, indicating comparable crop development. The CO2 concentration plot reveals that C and CW maintain higher and more stable daytime CO2 levels, supporting enhanced photosynthetic activity, while the other configurations regulate CO2 more conservatively. The temperature and humidity plots demonstrate that all controllers keep these variables within safe bounds, with some fluctuations corresponding to environmental changes and control actions. Overall, this figure highlights the ability of all NMPC configurations to maintain suitable conditions for crop growth, with clear differences in resource management and environmental stability.
Figure 3. System outputs for all six NMPC controllers over the first 3 days of simulation. Gray dashed lines indicate operational bounds for CO2, temperature, and RH.
Figure 4 illustrates the control signals generated by the NMPC controllers for CO2 injection, ventilation, and heating during the same simulation period for the six configurations. The C and CW controllers apply CO2 in large, stable pulses, while the predictive configurations (P, PW, I, IW) use smaller, more frequent, and dispersed doses to optimize CO2 usage. Ventilation signals show that C and CW often adopt an on/off approach, whereas the predictive controllers adjust ventilation with higher frequency and smaller amplitude to more precisely regulate the internal climate. Heating is activated in cycles, mainly during cooler periods, with predictive controllers exhibiting more frequent and flexible power adjustments. These results demonstrate distinct control strategies, where C and CW focus on maximizing growth, while P, PW, I, and IW prioritize efficient resource utilization and operational cost savings.
Figure 4. System control signals for all six NMPC controllers over the first 3 days of simulation.
Table 6 summarizes the short-term performance (first 72 h) of all six NMPC controllers. Final biomass after 3 days is highest for NMPC-C and NMPC-CW controllers (7.489 and 7.490 g/m2), slightly higher than for the predictive (P, PW: 7.369 g/m2) and ideal controllers (I, IW: 7.347, 7.348 g/m2). Total constraint violation ( V t o t a l ) is similar across all controllers (≈8.7%). The average solver time is substantially reduced in warm-started controllers (CW: 0.299 s, PW: 0.404 s, IW: 0.302 s) compared to their non-warm-started counterparts (C: 0.489 s, P: 1.188 s, I: 0.897 s). Furthermore, for each pair of controllers with and without warm-start, the output values are nearly identical, as visually confirmed by the almost overlapping trajectories in Figure 3 and Figure 4, and quantitatively reinforced by the summarized data in Table 6, where performance metrics such as biomass, constraint violations, and profit differ by less than 0.1% between each pair. This demonstrates that, under the tested conditions, the use of warm-start mainly improves computational efficiency without significantly affecting the control quality or agronomic outcomes. For subsequent full-cycle analysis, only the warm-started controllers (CW, PW, IW) are visualized for clarity.
Table 6. KPIs over the first 3 days.

6.2. Full Horizon (40-Day) Performance

The full 40-day cultivation cycle simulation provided comprehensive performance data for all six NMPC controller variants. Table 7 presents the KPIs, including final biomass, constraint violation indices, net profit, and average solver times. Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10 and Figure 11 offer detailed visualizations of the system’s dynamic behavior, economic outcomes, constraint adherence, resource utilization, and computational performance across these configurations.
Table 7. Full-cycle (40-day) performance of all controller strategies.
Figure 5. System outputs over the full 40-day cycle for three representative warm-started NMPC controllers (CW, PW, IW). Gray dashed lines show operational constraints for CO2, temperature, and RH.
Figure 6. System control actions over the full 40-day cycle for three representative warm-started NMPC controllers (CW, PW, IW).
Figure 7. Bar chart of key economic performance indicators for all NMPC controllers: CO2 cost, heating cost, and total biomass revenue.
Figure 8. Stacked bar chart of constraint violations for all NMPC controllers, decomposed into CO2, temperature, and relative humidity components.
Figure 9. Trade-off between final biomass yield and total CO2 cost for all NMPC controllers over the 40-day cycle.
Figure 10. CO2 budget decomposition for each NMPC configuration, showing total CO2 supplied, CO2 lost through ventilation, and CO2 assimilated by the crop.
Figure 11. Histogram of solver times for each NMPC configuration over the 40-day simulation horizon. Warm-started controllers (CW, PW, IW) achieve lower and more concentrated solve times.

6.2.1. Disturbance Handling Strategy Performance

As detailed in Table 7, NMPC-C and NMPC-CW achieved the highest final biomass (approximately 217.4 g m−2 and 217.5 g m−2, respectively) and, consequently, the highest net profit (approximately 2.658 Hfl m−2 and 2.663 Hfl m−2, respectively). This superior productivity can be attributed to the controllers’ tendency to maintain high CO2 concentrations during periods of sufficient light, thereby maximizing photosynthetic activity, as evidenced by the higher assimilation rates shown in Figure 10. However, this reactive and aggressive approach—due to the controllers’ lack of future disturbance information—resulted in the highest rates of constraint violations among all strategies, particularly for temperature and humidity setpoints (Figure 8). While these controllers incurred the greatest operational costs related to CO2 injection (Figure 7 and Figure 9), their heating costs were lower than those of the predictive controllers (Figure 7). This suggests that C and CW responded only to current conditions and did not proactively increase heating in anticipation of future humidity or temperature violations. Despite higher CO2 consumption, their biomass cost ( C b i o ) remains competitive due to substantial yield gains.
The integration of future disturbance information, whether from an ML-based preview (P, PW) or an ideal forecast (I, IW), enabled these controllers to proactively adjust control actions in anticipation of upcoming environmental fluctuations. As a result, they achieved lower overall constraint violations—particularly for temperature and relative humidity—compared to the feedback-only controllers (Figure 8). This improved constraint adherence was primarily accomplished through more conservative CO2 dosing as well as strategic increases in heating to preempt periods of elevated humidity or temperature (Figure 6). While these controllers reduced total CO2 costs (Figure 7 and Figure 9), they exhibited slightly higher heating costs than their feedback-only counterparts (Figure 7), reflecting a deliberate trade-off between resource efficiency and stricter climate control.

6.2.2. Warm-Start Initialization Performance

Across all disturbance handling approaches, warm-starting the solver (CW, PW, IW) consistently yielded substantial improvements in computational efficiency without adverse effects on agronomic or economic outcomes. Average solver times, as shown in Table 7 and Figure 11, were reduced by approximately 30–60% compared to their cold-start counterparts. For instance, NMPC-CW (0.320 s) was considerably faster than NMPC-C (0.457 s), and NMPC-IW (0.308 s) outperformed NMPC-I (0.908 s). This reduction in both the mean and variance of solver times is crucial for ensuring the feasibility and reliability of NMPC in real-time greenhouse operations. The warm-started controllers (CW, PW, IW) exhibited both lower average solver times and a more concentrated distribution of solution times compared to their non-warm-started counterparts, as illustrated in Figure 11.

6.3. Discussion of Trade-Offs and Controller Selection

The comparative analysis conducted in Section 6.2 clearly reveals a fundamental trade-off inherent in the selection of NMPC strategies. On one hand, feedback-only controllers (C, CW) excel at maximizing final yield and profit by aggressively managing CO2 enrichment and overall climate conditions to consistently favor robust plant growth. However, this approach inherently leads to higher CO2 consumption and a greater tendency for the system to operate at or occasionally slightly beyond predefined operational constraint boundaries (Figure 8 and Figure 9). Heating expenditures for these controllers are generally lower, as they do not proactively compensate for future environmental changes (Figure 7). On the other hand, predictive controllers (P, PW, I, IW) demonstrate superior performance in minimizing constraint violations and reducing CO2 costs (Figure 7 and Figure 8). This enhanced efficiency and constraint safety is achieved through more cautious and anticipatory control actions, supported by access to future disturbance information, albeit typically involving a modest sacrifice in maximum potential yield, and consequently, net profit (Table 7). This observed trade-off between productivity and strict constraint adherence is a common challenge in greenhouse climate control, as highlighted by recent studies [15,20].
The choice of an optimal NMPC strategy should therefore be guided by the specific operational priorities and economic context of the greenhouse. If maximizing output is paramount and the system can tolerate minor deviations from setpoints, NMPC-CW presents a compelling option due to its high yield, profitability, and computational efficiency. This aligns with recent research emphasizing yield optimization in horticulture [20]. If, however, strict adherence to climate setpoints, energy conservation, or CO2 emission reduction is the primary concern, a predictive strategy such as NMPC-PW may be more suitable, offering a favorable balance between proactive control, resource savings, and computational feasibility. The ideal preview controllers (I, IW) serve as important theoretical benchmarks, highlighting the potential gains from perfect foresight. The results also suggest that while the economic weights in the NMPC objective function influence the trade-off between productivity and resource use, the penalty factors for constraint violations predominantly determine the overall degree of constraint violation and play a crucial role in ensuring system safety. With appropriately tuned penalties, all evaluated controllers maintained the greenhouse environment within broadly acceptable limits for lettuce cultivation.
To evaluate the practical implications of measurement uncertainty, we conducted a sensitivity analysis examining how a ±10% error in final biomass ( B f ) estimation impacts net profit calculations for each NMPC controller. Our findings, summarized in Table 8, show that while net profit is linearly related to B f (Equations (14) and (15)) and, thus, fluctuates directly with measurement error, the relative ranking of controller performance remains robust. This indicates that our main conclusions are valid even under realistic measurement uncertainties in crop yield, reinforcing the robustness of the proposed NMPC strategies for practical application.
Table 8. Net profit ( P n e t ) intervals for all controller strategies, accounting for ±10% biomass measurement error.

7. Conclusions

This study comprehensively evaluated advanced NMPC strategies integrating AI-driven components for climate control in smart greenhouse systems, emphasizing the impacts of disturbance prediction and warm-start initialization through extensive 40-day simulations of a lettuce greenhouse model across six distinct controller configurations. The findings revealed a clear trade-off: controllers employing only real-time feedback (NMPC-C, NMPC-CW) consistently maximized final biomass and profit by maintaining elevated CO2 levels, which facilitated greater CO2 assimilation; however, this approach also increased constraint violations. Conversely, strategies utilizing LSTM-based disturbance prediction (NMPC-P, NMPC-PW) or ideal foresight (NMPC-I, NMPC-IW) demonstrated improved resource efficiency and enhanced adherence to operational constraints, often by adopting more cautious CO2 supplementation, albeit at the expense of slightly lower yields. Crucially, warm-start initialization proved highly effective across all controller types, significantly reducing average solver computation times by up to 60% without any discernible impact on control performance or output quality, thereby underscoring its practical value for real-time automation in smart greenhouse control. Furthermore, the study highlighted that while economic objective weights influence the balance between productivity and resource expenditure, the satisfaction of operational constraints is predominantly governed by the selection of appropriate penalty parameters. The selection of an optimal NMPC strategy should therefore be guided by specific operational priorities, whether that is maximizing yield and economic returns, minimizing resource consumption and environmental impact, or strictly enforcing climate setpoints; regardless of the chosen control logic, the adoption of warm-start techniques is strongly recommended to ensure computational feasibility in practical real-time AI-driven smart greenhouse applications.
While this research provides valuable insights, its foundation on simulation-based evaluations using a specific lettuce crop model, a validated greenhouse climate model from Wageningen Agricultural University, and particular environmental conditions (Thai Nguyen, Vietnam) underscores the necessity for further investigation. Key limitations include the simplification of real-world atmospheric CO2 dynamics and microclimate variations by the synthetic CO2 model and gridded NASA POWER weather data, respectively, as well as the use of a pre-trained, static ML-based weather predictor. Additionally, the NMPC formulation did not incorporate online model parameter adaptation to address potential model–plant mismatch over extended cultivation periods, focused on a single set of tuning parameters (economic weights and constraint penalties), excluded the energy cost associated with natural ventilation as it is considered negligible in the assumed model, and excluded considerations of external economic factors like market price volatility or detailed physiological aspects such as air circulation’s impact on tipburn. Building upon these limitations, future research should prioritize on-site experimental validation in diverse greenhouse settings and across different crop types. Developing adaptive NMPC frameworks that integrate online learning for both process models and disturbance predictors, performing comprehensive sensitivity analyses for tuning parameters, and incorporating broader economic and parametric uncertainties will be crucial for advancing more resilient, efficient, and economically optimal greenhouse control systems for sustainable horticulture.

Author Contributions

Conceptualization, H.L.L. and V.-T.B.; methodology, H.L.L. and V.-T.B.; software, V.-T.B.; validation, H.L.L. and V.-T.B.; formal analysis, H.L.L. and V.-T.B.; resources, V.-T.B.; data curation, V.-T.B.; writing—original draft preparation, V.-T.B.; writing—review and editing, H.L.L.; visualization, H.L.L. and V.-T.B.; project administration, H.L.L.; funding acquisition, H.L.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Ministry of Education and Training, Vietnam, under grant number B2023-TNA-21.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The input data for environmental drivers and atmospheric CO2 concentrations are publicly available from the NASA POWER Project (https://power.larc.nasa.gov, accessed on 15 April 2025) and the NASA OCO-2 Science Team (https://oco2.gesdisc.eosdis.nasa.gov, accessed on 15 April 2025), respectively, as cited in the manuscript. The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Findeisen, R.; Allgöwer, F. An Introduction to Nonlinear Model Predictive Control. In Proceedings of the 21st Benelux Meeting on Systems and Control, Veldhoven, The Netherlands, 19–21 March 2002; pp. 119–141. [Google Scholar]
  2. Kouvaritakis, B.; Cannon, M. Model Predictive Control: Classical, Robust and Stochastic; Springer: Berlin/Heidelberg, Germany, 2016. [Google Scholar]
  3. García-Mañas, F.; Rodríguez, F.; Berenguel, M.; Maestre, J.M. Multi-Scenario Model Predictive Control for Greenhouse Crop Production Considering Market Price Uncertainty. IEEE Trans. Autom. Sci. Eng. 2024, 21, 2936–2948. [Google Scholar] [CrossRef]
  4. Esparza-Gómez, J.M.; Guerrero-Osuna, H.A.; Ornelas-Vargas, G.; Luque-Vega, L.F. RNN-LSTM Applied in a Temperature Prediction Model for Greenhouses. Res. Comput. Sci. 2021, 150, 31–41. [Google Scholar]
  5. Chen, L.; Han, B.; Wang, X.; Zhao, J.; Yang, W.; Yang, Z. Machine Learning Methods in Weather and Climate Applications: A Survey. Appl. Sci. 2023, 13, 12019. [Google Scholar] [CrossRef]
  6. Diehl, M.; Bock, H.G.; Schlöder, J.P. A Real-Time Iteration Scheme for Nonlinear Optimization in Optimal Feedback Control. SIAM J. Control Optim. 2005, 43, 1714–1736. [Google Scholar] [CrossRef]
  7. Van Henten, E.J. Greenhouse Climate Management: An Optimal Control Approach; Landbouwuniversiteit Wageningen: Wageningen, The Netherlands, 1994. [Google Scholar]
  8. Van Henten, E.J. Sensitivity Analysis of an Optimal Control Problem in Greenhouse Climate Management. Biosyst. Eng. 2003, 85, 355–364. [Google Scholar] [CrossRef]
  9. Van Henten, E.J.; Bontsema, J. Time-Scale Decomposition of an Optimal Control Problem in Greenhouse Climate Management. Control Eng. Pract. 2009, 17, 88–96. [Google Scholar] [CrossRef]
  10. Blasco, X.; Martinez, M.; Herrero, J.M.; Ramos, C.; Sanchis, J. Model-Based Predictive Control of Greenhouse Climate for Reducing Energy and Water Consumption. Comput. Electron. Agric. 2007, 55, 49–70. [Google Scholar] [CrossRef]
  11. Mahmood, F.; Govindan, R.; Bermak, A.; Yang, D.; Al-Ansari, T. Data-Driven Robust Model Predictive Control for Greenhouse Temperature Control and Energy Utilisation Assessment. Appl. Energy 2023, 343, 121190. [Google Scholar] [CrossRef]
  12. Hu, G.; You, F. AI-Enabled Cyber-Physical-Biological Systems for Smart Energy Management and Sustainable Food Production in a Plant Factory. Appl. Energy 2024, 356, 122334. [Google Scholar] [CrossRef]
  13. Gruber, J.K.; Guzmán, J.L.; Rodríguez, F.; Bordons, C.; Berenguel, M.; Sánchez, J.A. Nonlinear MPC Based on a Volterra Series Model for Greenhouse Temperature Control Using Natural Ventilation. Control Eng. Pract. 2011, 19, 354–366. [Google Scholar] [CrossRef]
  14. Boersma, S.; Sun, C.; Van Mourik, S. Robust Sample-Based Model Predictive Control of a Greenhouse System with Parametric Uncertainty. In Proceedings of the IFAC AGRICONTROL 2022, Munich, Germany, 14–16 September 2022. [Google Scholar]
  15. Svensen, J.L.; Cheng, X.; Boersma, S.; Sun, C. Chance-Constrained Stochastic MPC of Greenhouse Production Systems with Parametric Uncertainty. Comput. Electron. Agric. 2024, 217, 108578. [Google Scholar] [CrossRef]
  16. Zavala, V.M.; Biegler, L.T. The Advanced-Step NMPC Controller: Optimality, Stability and Robustness. Automatica 2009, 45, 86–93. [Google Scholar] [CrossRef]
  17. Gros, S.; Zanon, M. Data-Driven Economic NMPC Using Reinforcement Learning. IEEE Trans. Automat. Control 2020, 65, 636–648. [Google Scholar] [CrossRef]
  18. Mallick, S.; Airaldi, F.; Dabiri, A.; Sun, C.; De Schutter, B. Reinforcement Learning-Based Model Predictive Control for Greenhouse Climate Control. Smart Agric. Technol. 2025, 10, 100751. [Google Scholar] [CrossRef]
  19. Mallick, S.; Airaldi, F.; Dabiri, A.; Sun, C.; De Schutter, B. Deep Neural Network Based Optimal Control of Greenhouses. In Proceedings of the 2024 European Control Conference (ECC), Stockholm, Sweden, 25–28 June 2024. [Google Scholar] [CrossRef]
  20. Morcego, B.; Yin, W.; Boersma, S.; Van Henten, E.; Puig, V.; Sun, C. Reinforcement Learning Versus Model Predictive Control on Greenhouse Climate Control. Comput. Electron. Agric. 2023, 215, 108372. [Google Scholar] [CrossRef]
  21. Jansen, Y.T.G. Optimal Control of Lettuce Greenhouse Horticulture Using Model-Free Reinforcement Learning: An Investigation on the Effect of Short-Term Weather Forecast Horizons. Master’s Thesis, Utrecht University, Utrecht, The Netherlands, 2022. [Google Scholar]
  22. Kuijpers, W.J.P.; Antunes, D.J.; Van Mourik, S.; Van Henten, E.J.; Van De Molengraft, M.J.G. Weather Forecast Error Modelling and Performance Analysis of Automatic Greenhouse Climate Control. Biosyst. Eng. 2022, 214, 207–229. [Google Scholar] [CrossRef]
  23. Zhang, H.; Liu, Y.; Zhang, C.; Li, N. Machine Learning Methods for Weather Forecasting: A Survey. Atmosphere 2025, 16, 82. [Google Scholar] [CrossRef]
  24. Boersma, S.; Cheng, X. A Bayesian Neural ODE for a Lettuce Greenhouse. In Proceedings of the 2024 IEEE Conference on Control Technology and Applications (CCTA), Newcastle upon Tyne, UK, 21–23 August 2024; pp. 782–786. [Google Scholar] [CrossRef]
  25. Zavala, V.M.; Anitescu, M. Real-Time Nonlinear Optimization as a Generalized Equation. SIAM J. Control Optim. 2010, 48, 5444–5467. [Google Scholar] [CrossRef]
  26. Quirynen, R.; Vukov, M.; Zanon, M.; Diehl, M. Autogenerating Microsecond Solvers for Nonlinear MPC: A Tutorial Using ACADO Integrators. Optim. Control Appl. Methods 2014, 36, 685–704. [Google Scholar] [CrossRef]
  27. Kirches, C.; Wirsching, L.; Bock, H.G.; Schlöder, J.P. Efficient Direct Multiple Shooting for Nonlinear Model Predictive Control on Long Horizons. J. Process. Control 2012, 22, 540–550. [Google Scholar] [CrossRef]
  28. Gros, S.; Mario, Z.; Rien, Q.; Alberto, B.; Diehl, M. From Linear to Nonlinear MPC: Bridging the Gap via the Real-time Iteration. Int. J. Control 2016, 93, 62–80. [Google Scholar] [CrossRef]
  29. Ahmed, H.A.; Yu-Xin, T.; Qi-Changa, Y. Optimal Control of Environmental Conditions Affecting Lettuce Plant Growth in a Controlled Environment with Artificial Lighting: A Review. S. Afr. J. Bot. 2020, 130, 75–89. [Google Scholar] [CrossRef]
  30. Brechner, M.; Both, A.J.; Staff, C.E.A. Hydroponic Lettuce Handbook; Cornell University CEA Program: Ithaca, NY, USA, 2013. [Google Scholar]
  31. Dai, M.; Tan, X.; Ye, Z.; Ren, J.; Chen, X.; Kong, D. Optimal Light Intensity for Lettuce Growth, Quality, and Photosynthesis in Plant Factories. Plants 2024, 13, 2616. [Google Scholar] [CrossRef] [PubMed]
  32. Zhang, T.; Chandler, W.S.; Hoell, J.M.; Westberg, D.; Whitlock, C.H.; Stackhouse, P.W. A Global Perspective on Renewable Energy Resources: Nasa’s Prediction of Worldwide Energy Resources (Power) Project. In Proceedings of the Proceedings of ISES World Congress 2007 (Vol. I–Vol. V), Beijing, China, 8–21 September 2007; Goswami, D.Y., Zhao, Y., Eds.; Springer: Berlin/Heidelberg, Germany, 2009; pp. 2636–2640. [Google Scholar]
  33. Brad Weir, L.O. and O.-2 S.T. OCO-2 GEOS Level 3 Daily, 0.5×0.625 Assimilated CO2 V10r. Available online: https://oco2.gesdisc.eosdis.nasa.gov/ (accessed on 15 April 2025).
  34. Andersson, J.A.E.; Gillis, J.; Horn, G.; Rawlings, J.B.; Diehl, M. CasADi: A Software Framework for Nonlinear Optimization and Optimal Control. Math. Program. Comput. 2019, 11, 1–36. [Google Scholar] [CrossRef]
  35. Wächter, A.; Biegler, L.T. On the Implementation of an Interior-Point Filter Line-Search Algorithm for Large-Scale Nonlinear Programming. Math Program. 2006, 106, 25–57. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.