Next Article in Journal
Real-Hardware Deployment of a Nussbaum-Function PID Controller on a Current-Controlled Low-Cost Actuator via Hardware-Aware Optuna Tuning
Previous Article in Journal
Integrated Multi-Sensor Assessment System for Objective Muscle Recovery Monitoring: Application of Isokinetic Dynamometry, Infrared Thermometry, and Multi-Biomarker ELISA in Exercise-Induced Muscle Damage Surveillance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Data-Driven Algorithm for Prediction Horizon Estimation in Model Predictive Control

by
Bojan Jorgovanović
1,2,*,
Nikola Jorgovanović
1,2,
Darko Stanišić
2 and
Luka Mejić
1
1
Faculty of Technical Sciences, University of Novi Sad, 21000 Novi Sad, Serbia
2
Global Electronic Solutions doo, 21000 Novi Sad, Serbia
*
Author to whom correspondence should be addressed.
Sensors 2026, 26(13), 4214; https://doi.org/10.3390/s26134214
Submission received: 21 May 2026 / Revised: 30 June 2026 / Accepted: 30 June 2026 / Published: 3 July 2026
(This article belongs to the Section Sensor Networks)

Highlights

What are the main findings?
  • A novel algorithm for prediction horizon estimation in MPC is proposed, based on cross-correlation analysis of data simulated by a trained LSTM model, requiring no experiments on the physical system.
  • The algorithm is validated on two nonlinear industrial benchmark systems (CSTR and single tank), with closed-loop MPC simulations confirming strong control performance with the estimated prediction horizons.
What are the implications of the main findings?
  • LSTM-based process models can be leveraged not only for control but also for systematic MPC tuning, offering a practical and fully data-driven alternative to manual or heuristic parameter selection.
  • The offline nature of the method allows the prediction horizon to be determined systematically prior to deployment, rather than through iterative trial-and-error adjustment.

Abstract

Model predictive control (MPC) is a widely used advanced control strategy in industrial applications. The prediction horizon is one of its most influential tuning parameters, as it directly affects both control performance and computational demand. Despite its importance, systematic methods for its configuration remain scarce in the literature. This paper proposes a novel algorithm for prediction horizon estimation based on cross-correlation analysis of input and output data simulated by a trained long short-term memory (LSTM) network model of the controlled process. The use of LSTM networks allows the method to simulate process behaviour directly, eliminating the need for experiments on the physical system. Furthermore, this enables the method to work entirely offline, allowing the prediction horizon to be determined prior to deployment. The proposed algorithm is evaluated on two representative benchmark systems: a continuous stirred-tank reactor and a single tank system. LSTM models are trained for both benchmark systems and are subsequently integrated into an MPC framework. Closed-loop simulations demonstrate that MPC controllers designed with the estimated prediction horizons achieve strong control performance across both benchmark systems. The results suggest that cross-correlation analysis of LSTM-simulated data provides a reliable and systematic basis for prediction horizon estimation, contributing a practical tool for MPC tuning in industrial process control.

1. Introduction

Model predictive control (MPC) is an advanced control technique that determines the optimal input sequence by solving an optimization problem based on a predictive model of the controlled system [1]. At each sampling instant, the controller determines an optimal sequence of control inputs that minimizes a specified cost function while respecting system constraints. A defining feature of MPC is the use of the receding horizon principle. At each time step, the optimization problem is solved over a finite future time window, and only the first element of the optimized control sequence is applied to the system. At the next sampling instant, the horizon is shifted forward, and the optimization is repeated using updated measurements.
In classical MPC formulations, models are typically derived from first principles, resulting in linear or nonlinear state-space representations based on physical laws. While such models describe the system dynamics using physical relationships, their development can be challenging for complex and highly nonlinear processes [2]. As an alternative, data-driven modelling approaches have gained significant attention in MPC [3,4,5]. These methods rely on measured input and output data to construct predictive models without requiring explicit knowledge of the underlying governing equations. Among data-driven techniques, artificial neural networks have proven particularly effective due to their universal approximation capability and flexibility in capturing nonlinear dynamics. Feedforward neural networks (FFNNs) have been widely used for both modelling industrial processes [6,7,8] and providing real-time estimations as soft sensors [9,10]. However, as pointed out in [2], their ability to represent temporal dependencies is limited when applied to dynamic systems. In contrast, recurrent neural networks (RNNs) provide a natural framework for modelling dynamical systems due to their internal memory structure. As a result, they have been extensively used for dynamic system identification and nonlinear process modelling. For instance, in [11], the authors developed a simple RNN-based model of a fixed-bed reactor and used it in an MPC framework, achieving a robust and effective process control approach. Similar results were presented in [12], where the authors modelled a continuous stirred-tank reactor for pharmaceutical manufacturing. In [13] the authors presented a new way of utilizing simple RNNs by slightly altering the architecture by incorporating a priori knowledge about the modelled process. In [14], the authors presented an MPC framework which utilizes simple RNNs for modelling batch crystallization processes. Even though they are widely used for modelling, simple RNNs suffer from the vanishing and exploding gradient problem, which can hinder their ability to learn long-term temporal dependencies. Long short-term memory (LSTM) networks are specifically designed to capture long-term temporal dependencies and mitigate the mentioned issues, making them well suited for systems with delays, slow dynamics, or strong temporal correlations [15]. As a result, LSTM-based models have been increasingly adopted as prediction models within MPC frameworks, enabling accurate multi-step predictions directly from historical data [3]. In [16], the authors provide a stability analysis of LSTM networks when used as process models in MPC and give an example with a pH neutralization process. In [17], LSTM networks were used to model a reverse osmosis desalination plant which was used for MPC to successfully track the reference signal. In [18], the authors developed an algorithm for training LSTM networks with noisy data, thereby teaching the networks to predict the underlying process dynamics. The algorithm’s effectiveness was tested by performing MPC on a chemical reactor process. Other than industrial processes, LSTMs have also been used for MPC of heating, ventilation and air conditioning (HVAC) systems, where they have shown significant reductions in energy consumption [19,20,21].
In addition to the choice of the prediction model, the performance of an MPC controller strongly depends on the selection of a suitable prediction horizon. The prediction horizon determines how far into the future the system behaviour is predicted and optimized, and therefore directly influences the controller’s ability to anticipate system dynamics, constraints, and disturbances. An inadequately short prediction horizon may prevent the controller from accounting for slow dynamics, transport delays, or long-term effects of control actions, leading to suboptimal or even unstable closed-loop behaviour. Conversely, an excessively long prediction horizon can significantly increase computational complexity without necessarily providing proportional improvements in control performance. From a control perspective, the horizon should be sufficiently long to capture the dominant dynamics of the system and allow the controller to foresee the impact of current control actions on future outputs [22,23]. This is particularly important for systems with transport delays, integrating behaviour, or strong nonlinearities, where the effect of an input may only become apparent after several sampling intervals. From a computational standpoint, increasing the prediction horizon enlarges the underlying optimization problem, which may limit real-time applicability, especially for nonlinear MPC formulations. Despite being an important parameter, its selection is often based on heuristic rules [24], empirical tuning [25], or simply prior experience. In many cases, determining a suitable prediction horizon requires experimental analysis of the system, where sufficiently exciting input signals are applied in order to reveal the relevant dynamic behaviour. However, such experiments may be costly, time-consuming, or even infeasible in practice, particularly for industrial processes operating under strict constraints. As a result, the prediction horizon is frequently chosen in an ad hoc manner, without a systematic guarantee that it provides an appropriate balance between control performance and computational complexity. In recent years, most methods found in the literature revolve around dynamically adjusting the prediction horizon in order to optimize the MPC performance rather than setting it beforehand. In [26,27], the authors showed how reinforcement learning and proximal policy optimization, respectively, can be used for these adjustments. In these situations, the optimal prediction horizon is learned and depends on the state of the controlled system. Similarly, Ref. [28] utilized an FFNN to dynamically set the prediction horizon based on the system state. Alternatively, in [29,30,31], the authors used different optimization methods to determine optimal prediction horizons in their respective control problems. In [32], the authors used the autoregressive model with exogenous inputs of a building’s thermal inertia to dynamically update the prediction horizon for MPC in HVAC cases. A different approach is proposed in [33,34,35], where Laguerre functions are used to parameterise the degrees of freedom in MPC, implicitly embedding an infinite prediction horizon through the Laguerre basis without requiring the user to specify it explicitly.
While the mentioned approaches demonstrate promising results, they also exhibit certain limitations that may restrict their applicability in practical process industry settings. Methods based on reinforcement learning inherently require the system to be excited and driven through a wide range of operating regimes in order to explore the state space and converge to an optimal prediction horizon policy. Similarly, training an FFNN to dynamically adjust the prediction horizon requires the collection of a sufficiently rich and representative dataset, which can only be generated by deliberately perturbing the system across diverse conditions. In process industry applications, such exploratory excitation is not permissible, as industrial systems must operate continuously and safely within tightly constrained bounds. Furthermore, several of the reviewed methods still rely on an arbitrarily chosen initial prediction horizon from which the adaptation procedure is initialized. In an industrial context, even temporarily operating under a poorly chosen prediction horizon can lead to degraded control performance or constraint violations before the method converges to a suitable value. Therefore, the objective of this paper is to propose a new, practical method for estimating an appropriate prediction horizon for MPC applied to industrial processes characterized by significant transport delays and pronounced nonlinearities. The proposed approach determines the prediction horizon directly from the available process model utilizing cross-correlation, which allows the estimation procedure to be performed offline, without requiring additional experiments on the physical process. Furthermore, the proposed method automatically determines a suitable prediction horizon, without requiring subsequent tuning or manual adjustment.
The paper is structured as follows. In Section 2, the methodology of the work is presented, starting with the description of the two benchmark systems used, the generation of data through open-loop simulations and fitting LSTM networks to model the two systems. Then, the cross-correlation based algorithm for prediction horizon estimation is presented along with the evaluation procedure. The results are then presented in Section 3, and the paper is concluded in Section 4.

2. Method

This section presents the methodology used to develop and evaluate the proposed prediction horizon estimation algorithm. Firstly, two dynamic nonlinear benchmark systems and their descriptions and associated assumptions are introduced. Secondly, the data generation and model training and testing procedures used to obtain representative system input–output behaviour are described. Thirdly, the proposed prediction horizon estimation algorithm is described in detail. Finally, the algorithm is evaluated by running MPC test case simulations with the trained models and the estimated prediction horizons.

2.1. System Descriptions and Assumptions

To evaluate the proposed algorithm in a controlled and reproducible manner, two nonlinear dynamic systems commonly used in MPC-related research are considered. The selected benchmark processes exhibit strong nonlinear behaviour and include non-manipulated inputs. Additionally, artificial transport delays were introduced at each system’s inputs to enable the analysis of the algorithm’s performance on systems with significant time delays. Although transport delays of this nature are commonly encountered in practical industrial applications, the delay values used in this study were selected arbitrarily for benchmarking purposes and do not necessarily correspond to specific physical mechanisms. The transport delays introduced in the benchmark systems were selected such that their magnitudes are of a similar order as the characteristic dynamics of the respective processes. Because of this, neither the transport delay nor the dynamic lag dominate the overall system behaviour. All these characteristics make the benchmark systems suitable for assessing controller performance under realistic operating conditions.

2.1.1. Continuous Stirred-Tank Reactor

The continuous stirred-tank reactor (CSTR) considered in this work is non-isothermal and well mixed. It represents a nonlinear dynamic system which is commonly used as a benchmark in process control research [2]. The reactor performs a reversible first-order exothermic reaction, and its dynamics are described by coupled nonlinear mass and energy balance Equations (1)–(5), discretized in time.
C A ( k + 1 ) = C A ( k ) + T p ( 1 τ ( C A 0 ( k 200 ) C A ( k ) ) r A ( k ) + r B ( k ) )
C B ( k + 1 ) = C B ( k ) + T p ( 1 τ C B ( k ) + r A ( k ) r B ( k ) )
T ( k + 1 ) = T ( k ) + T p ( 1 τ ( T 0 T ( k ) ) + H ρ C p ( r A ( k ) r B ( k ) ) + Q ( k 400 ) ρ C p v )
r A ( k ) = k A e E A R T ( k ) C A ( k )
r B ( k ) = k B e E B R T ( k ) C B ( k )
The reactor temperature T is selected as the controlled variable, while the heating rate Q serves as the manipulated variable. The inlet concentration CA0 is considered a non-manipulated external input with unknown dynamics. Transport delays are introduced to both input signals, a delay of 400 sampling instants is applied to the heating rate, and a delay of 200 sampling instants is applied to the inlet concentration. The system is simulated in discrete time with a sampling period of 0.1 s. All system parameter values are summarized in Table 1, and the input ranges are presented in Table 2.

2.1.2. Single Tank System

The second benchmark process used in this study is a single tank system based on a standard tank with modifications which include a nonlinear relationship between the liquid level and the tank cross-sectional area, as well as a nonlinear outflow valve characteristic. The system dynamics are described by time-discretized nonlinear Equations (6)–(8) derived from mass balance principles. A diagram of the system is presented in Figure 1.
h ( k + 1 ) = h ( k ) + T p ( ( q i n ( k 1000 ) q o u t ( k ) ) A ( h ( k ) ) )
q o u t ( k ) = x v a l v e ( k 500 ) 100 % · C d ( D o u t 2 ) 2 π 2 g h ( k )
A ( h ( k ) ) = { r 2 π 0 h ( k ) < H 1 ( r + a ( cos ( 2 π f r ( h ( k ) H 1 ) ) 1 ) ) 2 π H 1 h ( k ) H m a x
The liquid level h is chosen as the controlled variable, while the inflow rate qin is considered the manipulated input. The outflow valve opening xvalve is included as a non-manipulated input and is not subject to direct control. A delay of 1000 sampling instants is applied to the inflow rate, and a delay of 500 sampling instants is applied to the valve opening. The system is simulated using a sampling period of 0.1 s. All system parameter values are summarized in Table 3, and the input ranges are presented in Table 4.

2.2. Data Generation and Model Creation

2.2.1. Data Generation

Data for model identification and subsequent MPC evaluation were generated through open-loop simulations of the two benchmark systems described in Section 2.1.1 and Section 2.1.2. Open-loop operation was selected to ensure sufficient excitation of the system dynamics over the relevant operating ranges, without the influence of feedback control. All input signals were generated as multi-level pseudo-random binary sequences with randomly varying dwell times between amplitude changes. This type of excitation is commonly used in system identification [36] due to its ability to sufficiently excite nonlinear dynamics. To obtain data at sampling rates suitable for MPC implementation, the simulated trajectories were downsampled after generation. In the case of the CSTR, every 25th data point was retained, resulting in an effective sampling period of 2.5 s. For the single tank system, every 100th data point was retained, corresponding to an effective sampling period of 10 s. The downsampling was performed to ensure that sufficient computational time would be available between consecutive samples for solving the MPC optimization problem. The different sampling periods reflect the distinct dynamic characteristics of the two systems. After downsampling, each dataset consisted of 12,500 data points. For both systems, the first 10,000 samples were used for training and validation, while the remaining 2500 samples were reserved exclusively for testing and were not used during model training. All input and output variables were normalized to the range [ 1,1 ] prior to model training.

2.2.2. Long Short-Term Memory Networks

LSTM networks [15] are a special type of RNN which were developed to address the vanishing and exploding gradient problem. Unlike a simple RNN, an LSTM network can capture both long-term and short-term temporal dependencies, which has made it one of the most widely used tools for modelling time-dependent sequential data. In addition to the hidden state h, LSTMs also include a cell state C, which greatly improves the network’s ability to retain long-term information. Furthermore, LSTM neurons introduce gating mechanisms that regulate the flow of data and help limit gradient magnitude during training. In particular, an LSTM neuron contains three gates: the input gate, forget gate, and output gate. The input gate i determines how the new input vector x influences the hidden and cell states, the forget gate f determines what proportion of the previous cell state is retained, and the output gate o computes the value of the new hidden state [3]. Figure 2 depicts a schematic representation of an LSTM neuron, and the corresponding equations are given in (9)–(14). The symbols Wi, Wh, and b represent the input weights, recurrent (hidden state) weights, and biases for each gate, respectively. The current time step is represented by k. It should be noted that the use of LSTM networks in this work is motivated by the advantages they offer compared to FFNNs and simple RNNs mentioned in the Introduction. However, the proposed method is not restricted to this architecture and can be applied to any model class capable of faithfully representing the system dynamics.
i k = σ ( W i i x k + W h i h k 1 + b i )
f k = σ ( W i f x k + W h f h k 1 + b f )
C ~ k = tanh ( W i c x k + W h c h k 1 + b c )
C k = f k C k 1 + i k C ~ k
o k = σ ( W i o x k + W h o h k 1 + b o )
h k = o k tanh ( C k )

2.2.3. Model Training and Testing

Multiple LSTM network configurations with varying numbers of hidden layers and neurons per hidden layer were considered. Additionally, two variants were implemented for each configuration, motivated by the experiments presented in [37]: one with an output feedback loop and one without it. In the variant with feedback, the output from the previous time step was fed back as an additional input to the network. The output layer consisted of a single fully connected neuron with a linear activation function. All models were trained using the generated datasets described in Section 2.2.1. The mean squared error (MSE) was used as the training loss function, while the coefficient of determination (R2) was employed as the validation metric to assess predictive performance. For each system, 85% of the available training data was used for parameter optimization, and the remaining 15% was reserved for validation. A comprehensive hyperparameter optimization was not performed, as the primary objective of this work is not to obtain the best possible predictive model but rather to evaluate the proposed algorithm. Consequently, the selected architectures are intended to provide sufficiently accurate models while maintaining a reasonable training complexity. After training, all candidate models were evaluated using the previously unseen test dataset described in Section 2.2.1. The model achieving the highest R2 score on the test data was selected for subsequent use in the MPC framework.

2.3. Prediction Horizon Estimation Algorithm

Selecting an appropriate prediction horizon is a crucial step in MPC design, especially for systems with significant transport delay. As stated earlier, the prediction horizon must be sufficiently long to capture the effect of manipulated inputs on the controlled output. This means that if the chosen prediction horizon is shorter than the input–output delay, the controller is unable to anticipate the system response, leading to degraded closed-loop performance. Cross-correlation is a well-established method for analysing the temporal relationship between two signals. Formally, cross-correlation between two discrete signals x(k) and y(k) is a function of the lag n that measures the similarity between x(k) and a shifted version of y(k). The mathematical formula is given by (15) [38], where n represents the lag expressed in samples, Rxy(n) the resulting cross-correlation function, and N the length of the signals. By definition, n ranges from −(N − 1) to (N − 1); however, it should be noted that only the lags greater than or equal to 0 are considered in this algorithm, as negative lags do not correspond to a causal system.
R x y ( n ) = k = m a x { 0 , n } m i n { N 1 ,   N 1 + n } x ( k ) y ( k n )
In the context of dynamic systems, cross-correlation has been used for determining the delay between input and output signals [39,40]. Since the total delay of the output signal with respect to the input signal is the result of both transport delay and the dynamic lag, the latter arising from the system dynamics, the estimated delay covers a time window where the effects of the input signal on the output signal are clearly observable. An example of this is illustrated in Figure 3. Following [41], the prediction horizon should be long enough to capture the significant dynamics of the process. Selecting the prediction horizon based on the combined effect of the transport delay and the dynamic lag ensures that the dominant transient behaviour is captured within the optimization window. Therefore, this work proposes a new method for estimating a suitable prediction horizon for MPC by analysing the cross-correlation function of the manipulated input and the controlled variable of the controlled system. The proposed algorithm operates on simulated input and output data generated using the previously trained LSTM model of the system. The simulations are based on exciting the LSTM model by changing the manipulated input while keeping the non-manipulated inputs at a fixed, constant value, and analysing the temporal relationship between the input signal and the model’s response. Specifically, variations of a step signal with different initial values and step amplitudes are used. Before applying the step change to the manipulated input signal, the model is first warmed up by running simulations with the initial value of the step signal until steady state is reached. Upon reaching steady state, the step change is applied, and the simulation is run further until steady state is reached again. Depending on the applied input signals, the model takes a different amount of time to reach steady state, which affects the lengths of the signals. The lengths of the signals in turn affect the resulting cross-correlation function. However, given that this approach ensures the dynamics of the model are captured, the position of the peak of the cross-correlation function should not be affected by different lengths of the signals. During simulations, all inputs represent normalized values of the input variables in order to suit the trained LSTM network’s input range of [−1, 1]. The proposed initial values and step changes of the manipulated input as well as the values of the non-manipulated inputs are selected to sufficiently excite the LSTM model and enable the observation of representative responses over the majority of its dynamic range. The values are presented in Table 5. Simulations are run for each combination of the manipulated input initial values, step change values and non-manipulated input values, and the corresponding output trajectories of the LSTM model are saved. For the benchmark systems used in this work, with one manipulated and one non-manipulated input, a total of 280 input–output signal pairs are obtained.
Prior to cross-correlation analysis, both input and output signals are zero-centred to remove any constant offsets. For each input–output pair, the cross-correlation function is first computed. Its absolute value is then taken to account for both direct and indirect proportionality between signals. Next, the lag corresponding to the maximum value of the absolute cross-correlation is determined. Once all lags corresponding to the maximum value are obtained, their mean value is computed. The prediction horizon is finally selected as the ceiling of this mean value expressed in discrete time steps. A flowchart of the proposed algorithm is presented in Figure 4.

2.4. Evaluation Process

The proposed algorithm is evaluated by using the estimated prediction horizons in an MPC framework applied to the two benchmark systems described in Section 2.1.1 and Section 2.1.2. It should be noted that the MPC framework employed in this work is chosen purely for demonstration purposes, serving as a platform on which the effectiveness of the proposed prediction horizon estimation algorithm can be evaluated. No claim is made regarding the superiority of this formulation over other existing MPC methods, as such a comparison falls outside the scope of this work. The used MPC formulation is given by (16)–(20).
min { u ( k + 1 ) , , u ( k + N c ) } i = 1 N p ( x ( k + i ) x ^ ( k + i ) ) 2 + P
s . t .   u ( n + 1 ) = u ( n ) + u ( n + 1 )
x ^ ( n + 1 ) = f L S T M ( x ^ ( n ) ,   u ( n ) )
| u ( n ) | u m a x
P = { 0 u m i n u ( k + n ) u m a x ,   n { 1 , , N p } C m a x e l s e
The objective is to minimize the cost function over the prediction horizon Np, with respect to the system dynamics and actuator constraints, starting from the current time step k. A genetic algorithm (GA) is employed to solve the nonlinear MPC optimization problem. The GA is chosen as the optimization method because it allows the MPC formulation to handle nonlinear dynamics and nonconvex objective functions without requiring gradient information [42,43,44]. The decision variables are defined as arrays of increments of the manipulated input over the control horizon Nc (Equation (21)) rather than absolute input values. This formulation implicitly limits the rate of change of the control action without introducing an additional tuning parameter for rate penalization. The first element is the increment at time step k + 1, the second at time step k + 2, and so on until the final element which is the increment at step k + Nc.
u = [ u ( k + 1 ) , u ( k + 2 ) , , u ( k + N c ) ]
The input increments are constrained to ±10% of the full range of the manipulated input, ±8000.0 cal·s−1 for the CSTR and ±4.0 L·s−1 for the single tank system. The cost function Equation (15) is defined as the sum of squared errors between the predicted output x ^ and the reference trajectory x* over the prediction horizon. To enforce actuator constraints, a hard penalty is applied if the manipulated input exceeds its admissible range at any point over the prediction horizon. The penalty, represented by P in Equations (15) and (19), is implemented by adding the maximum cost value of the current generation Cmax to the individual’s cost. This way, the penalized individuals become less feasible than the least feasible solution which effectively lowers their probability of influencing individuals of the next generation. In this study, the control horizon is set to the same value as the prediction horizon in order to avoid including additional adjustable parameters. The GA parameters are selected empirically through preliminary experimentation and are summarized in Table 6. In all evaluation experiments, MPC is executed on the corresponding first-principles models, which served as the reference representations of the true system dynamics. The LSTM models are used exclusively for multi-step ahead predictions during optimization within the MPC algorithm, thereby introducing a realistic model–plant mismatch. For each benchmark system, two control scenarios are considered. In the first scenario, the system is regulated to a constant setpoint, while a sudden change is introduced in a non-manipulated input, representing an external disturbance. In the second scenario, a change in the setpoint is applied, while the non-manipulated input is kept at a constant value. In both cases, the control objective is to regulate the controlled variable to the desired setpoint, while rejecting the effects of the non-manipulated inputs. Each scenario is simulated for a duration of 300 sampling instants. Quantitative performance is evaluated using the following metrics: integral of time-weighted absolute error (ITAE), settling time, and overshoot.

2.5. Evaluation with Alternative Prediction Horizon Choices

To assess the effectiveness of the proposed prediction horizon estimation method, the MPC performance results obtained using the estimated prediction horizons are compared with multiple alternative prediction horizon selections. Specifically, 3 shorter and 3 longer prediction horizons are considered for each benchmark system. For each prediction horizon, closed-loop MPC simulations are performed under the same test scenarios as described in Section 2.4. The same performance metrics as in the previous section are used, with the addition of mean computation time. All simulations were performed on a PC equipped with an 11th Gen Intel Core i5-11400H CPU (6 cores, 2.69 GHz base frequency; Intel Corporation, Santa Clara, CA, USA) and 32 GB of RAM.

3. Results

This section presents the results obtained using the proposed prediction horizon estimation algorithm. First, the predictive accuracy of the trained LSTM models is briefly assessed to verify their suitability for MPC prediction. The estimated prediction horizons are then reported, followed by an evaluation of closed-loop MPC performance using these horizons. Finally, the results are compared with alternative horizon choices to highlight the effectiveness of the proposed approach.

3.1. LSTM Model Prediction Performance

The predictive performance of the trained LSTM models was evaluated using the test datasets described in Section 2.2. The configurations of the selected models are reported in Table 7, while the corresponding performance metrics for both benchmark systems are summarized in Table 8. The formulas for the performance metrics are given in Equations (22)–(26), where y represents the measured signal value, y ^ the predicted value, µ the mean value of the measured signal, and N the length of the signal. The LSTM models for both systems exhibit similar overall architectures; however, the CSTR model showed better performance without a feedback loop, whereas the single tank system performed better with feedback. For both the CSTR and the single tank system, the models achieve high R2 values, as well as low error-based metrics, on previously unseen test data, indicating that the system dynamics are captured with sufficient accuracy for use in MPC prediction. Figure 5 shows a comparison between the predicted and measured output trajectories for the CSTR, while Figure 6 presents the corresponding results for the single tank system. In both cases, the LSTM models accurately reproduce the behaviour of the systems, including the delayed responses to input changes. These results confirm that the selected models are suitable for multi-step prediction within the MPC framework.
M S E = i = 1 N ( y i y i ^ ) 2
N M S E = M S E i = 1 N ( y i μ ) 2
R M S E = M S E
N R M S E = R M S E max i [ 1 , N ] ( y i ) min i [ 1 , N ] ( y i )
R 2 = 1 i = 1 N ( y i y i ^ ) 2 i = 1 N ( y i μ ) 2

3.2. Estimated Prediction Horizons

The proposed cross-correlation-based algorithm was applied to the trained LSTM models to estimate suitable prediction horizons for both benchmark systems. Using the step–response simulations described in Section 2.3, a representative prediction horizon was obtained for each system by averaging the lags which maximize the cross-correlation function across all simulations, with the final horizon selected as the ceiling of this average expressed in discrete time steps. An example of the scaled step signal and the model’s response, as well as the corresponding normalized cross-correlation function is presented in Figure 7. The resulting prediction horizons are summarized in Table 9 and are used in the subsequent closed-loop MPC performance evaluation. For the first benchmark system, the obtained results exhibit relatively low variability, as suggested by the small standard deviation. In contrast, the second benchmark system exhibits a considerably larger standard deviation. This increased variability can be attributed to the stronger nonlinear behaviour of the system, which causes its dynamics to vary across different states. As a result, the system’s response is less uniform over the operating range, leading to greater dispersion in the obtained results.
To further investigate the influence of prediction model accuracy, the results obtained using models with lower predictive performance than the selected models are presented in Table 10. The results indicate that the prediction horizons estimated using these models are nearly identical to those obtained with the best-performing model, suggesting that the proposed approach does not rely on a perfectly accurate prediction model. The only noticeable deviation is observed for the second benchmark system, where a slightly larger prediction horizon is estimated. However, the difference remains small, and the estimated value is still in close agreement with that obtained using the best-performing model.

3.3. Closed-Loop MPC Performance Using the Estimated Prediction Horizons

Closed-loop MPC simulations were conducted using the prediction horizons obtained in Section 3.2. Figure 8 and Figure 9 present the inputs and closed-loop responses of the controlled variables for the CSTR and the single tank system, respectively, in the first evaluation scenario, in which the setpoint was held constant while the non-manipulated input was subjected to a change. Figure 10 and Figure 11 show the results for the two benchmark systems in the second evaluation scenario, where the non-manipulated input was held constant and the setpoint was varied. The metrics used to evaluate MPC performance are the ITAE, settling time, and overshoot. The obtained results are presented in Table 11 for the first test scenario, and in Table 12 for the second test scenario.
In the disturbance rejection scenario, both benchmark systems exhibit satisfactory closed-loop performance, with the MPC controller successfully rejecting the effects of the change in the non-manipulated input and driving the controlled variable to steady state. For the CSTR, the effect of the disturbance is minimal, which is also reflected in the settling time of 0. The controlled variable never crossed the ±2% boundary of the setpoint, however, based on the drop in the mean value of the manipulated input signal, it is clear that the MPC controller responded accordingly to the disturbance. In the case of the single tank, similar behaviour was observed, with the difference being a more pronounced effect of the disturbance on the controlled variable. This difference is mainly due to the differences in system dynamics between the two systems. In the setpoint tracking scenario, both the CSTR and the single tank system achieve accurate tracking of the setpoint change and reach steady state. Furthermore, the controlled variables of both systems reach their respective steady states without producing an overshoot.
The overall responses remain stable and demonstrate the ability of the estimated prediction horizons to immediately react on both disturbances and setpoint changes.

3.4. Comparison with Alternative Prediction Horizon Choices

Closed-loop MPC simulations were conducted using the alternative prediction horizons as stated in Section 2.5. The resulting performance metrics for all tested prediction horizons are summarized in Table 13 for both systems in the first test scenario and in Table 14 for the second test scenario. When shorter prediction horizons were used, the two systems exhibited different behaviour. For the CSTR, the MPC controller could not keep the controlled variable at the setpoint in either of the test scenarios. The results show that the ITAE decreased with each increase in the prediction horizon up to the value estimated in Section 3.2; however, none were enough to enable successful control. The single tank system exhibited similar behaviour for the shortest prediction horizon of nine time steps, where neither the effect of the disturbance was rejected nor was the change in the setpoint tracked. The remaining two shorter prediction horizons, 12 and 15 time steps, were able to successfully reject the effects of the disturbance and lead the controlled variable to the new setpoint. In these cases, however, the setpoint was reached with delay compared to the prediction horizon estimated in Section 3.2, which is reflected in both the ITAE and settling time values.
Increasing the prediction horizon beyond the estimated value also led to different effects across the two systems. For the CSTR, longer prediction horizons resulted in reduced settling times and lower ITAE values, although at the cost of slight overshoots, particularly in the second test scenario. Additionally, the ITAE values started rising with the increase in the prediction horizon beyond 23 time steps. For the single tank system, the ITAE values remained largely unchanged, exhibiting slight increases, while the settling time was reduced by a few time steps in both evaluation scenarios. As expected, the mean computation time increased with longer prediction horizons for both systems; however, all evaluated prediction horizons remained computationally feasible with respect to the available sampling period.
The increase in ITAE values for both systems when using longer prediction horizons can be attributed to the parameters of the GA, such as insufficient number of generations or individuals in a population, as well as to the model accuracy. Because the control horizon was set equal to the prediction horizon, increasing the prediction horizon also increased the dimensionality of the optimization problem, potentially degrading the performance of the GA. To address this issue, additional simulations were performed for the three longest prediction horizons for both benchmark systems where the control horizon was set to the value determined by the proposed method and the number of generations and individuals in a population were increased by 50%. Since the resulting ITAE values showed no significant improvement, it was concluded that the degradation in performance was primarily caused by model inaccuracies rather than insufficient GA tuning. Furthermore, the increased parameters of the GA led to longer computation times and rendered the MPC algorithm infeasible for the CSTR with respect to its sampling period.
Given that the transport delays for these systems are known and measure 16 and 10 time steps for the CSTR and single tank system, respectively, a further conclusion can be drawn. The prediction horizons of 11 and 14 time steps for the CSTR and nine time steps for the single tank system are lower than the transport delays of their respective manipulated inputs. Therefore, it is not surprising that the MPC controller failed to control the systems using these prediction horizons, as they are insufficient to capture the effects of the manipulated input over the prediction horizon. For the CSTR, even the prediction horizon of 17 time steps, which effectively predicts one time step influenced by the manipulated input, was insufficient to establish successful control. This result confirms that prediction horizons should cover multiple time steps affected by the manipulated input.
Overall, the quantitative results reported in Table 13 and Table 14 indicate that the prediction horizons obtained using the proposed algorithm are sufficiently long to ensure effective closed-loop control despite the presence of transport delay. The estimated prediction horizons consistently achieve performance comparable to that of longer prediction horizons, while avoiding the performance degradation associated with shorter prediction horizon choices.

4. Discussion

The results presented in this paper demonstrate that the proposed cross-correlation-based prediction horizon estimation algorithm provides a practical and reliable means of selecting an appropriate prediction horizon for MPC control of nonlinear systems with transport delay. The key novelty of the method lies in training a data-driven model on data collected during normal process operation, which is then used to simulate the system’s response to step-based inputs, eliminating the need to apply potentially disruptive excitation signals directly to the system, as would be required by conventional identification methods. This is particularly significant in real industrial environments, where such excitation is often both impractical and unsafe. Consequently, the presented method can determine a suitable prediction horizon beforehand, which is another important advantage. Unlike the approach in [37], where the prediction horizon is chosen and refined experimentally, the proposed method yields a clear and well-defined prediction horizon without the need for additional adjustment procedures. Furthermore, in applications where the system dynamics vary over time or where the process operates in multiple regimes with distinct dynamic characteristics, adjustment of the prediction horizon may become necessary. In such cases, several of the methods discussed in the Introduction could be employed. Nevertheless, the proposed method still provides a suitable initial prediction horizon, enabling safe and immediate deployment while reducing the need for extensive preliminary tuning.
The obtained results clearly indicate that prediction horizons shorter than the estimated value are often insufficient to capture the dominant process dynamics, particularly in the presence of transport delay. In both benchmark systems, the use of overly short horizons led to slow convergence or complete failure to reach the desired setpoint, with this effect being especially pronounced in the CSTR system. These observations confirm that the prediction horizon must exceed the transport delay associated with the manipulated input to enable the MPC to formulate an effective control strategy. At the same time, increasing the prediction horizon beyond the estimated value yielded diminishing performance improvements. For the CSTR system, longer horizons reduced settling times and ITAE values but introduced overshoot, while for the single tank system, the impact on ITAE was marginal, and only limited improvements in settling time were observed. These findings suggest that excessively long prediction horizons may not yield meaningful performance improvements, while inevitably increasing computational cost. However, it is important to emphasize that the proposed method does not provide a globally optimal prediction horizon, but rather a feasible and suitable one that ensures the optimization window is long enough to capture the dynamic response of the controlled variable to changes in the manipulated input, thereby yielding satisfactory control performance. While longer horizons may in some cases produce improved ITAE values, the estimated horizon is intended to provide a reliable and practically viable starting point, without any requirement for system excitation or arbitrary initialization. Although the method relies on the availability of a sufficiently accurate prediction model, the observed robustness to model–plant mismatch across both benchmark systems suggests that the approach can be effectively applied in practical MPC settings. Furthermore, gradual changes in the system dynamics due to aging or wear or changes in working conditions do not represent a limitation of the proposed approach. In such cases, the prediction model can be retrained using newly acquired process data to accurately capture the current system behaviour. The proposed prediction horizon estimation procedure can then be repeated to determine a prediction horizon appropriate for the updated dynamics.
Overall, the results support the proposed prediction horizon estimation algorithm as an effective and practical approach for determining a suitable prediction horizon in MPC design for nonlinear systems with transport delay. However, several limitations of the present study should be acknowledged. First, the proposed method has been evaluated only on benchmark systems, and its performance on real industrial processes remains to be validated experimentally. Second, the current analysis was performed on systems with one manipulated input and one controlled variable, which are very common in the process industry. Future work will investigate the extension of this method to systems with multiple manipulated inputs and controlled variables. Thirdly, this method relies heavily on the availability of a model of the controlled process. If a process is controlled manually or by a conventional controller, the gathered data may not contain much information about the dynamic behaviour of the process, which makes training a model difficult. Finally, because the prediction horizon determination procedure operates on data generated by a trained LSTM model, measurement noise affects the method indirectly through the model training stage rather than the horizon estimation process itself. Therefore, the impact of noisy or uncertain training data on the resulting prediction horizon should be examined in future work.

Author Contributions

Conceptualization, B.J., N.J., D.S. and L.M.; methodology, B.J., N.J., D.S. and L.M.; software, B.J. and L.M.; validation, B.J. and D.S.; investigation, B.J.; resources, D.S. and L.M.; data curation, B.J. and L.M.; writing—original draft preparation, B.J.; writing—review and editing, B.J., N.J., D.S. and L.M.; visualization, B.J. and D.S.; supervision, N.J., D.S. and L.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

Author Bojan Jorgovanović, Nikola Jorgovanović and Darko Stanišić were employed by the company Global Electronic Solutions. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as potential conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MPCModel predictive control
FFNNFeedforward neural network
RNNRecurrent neural network
LSTMLong short-term memory
HVACHeating, ventilation and air conditioning
CSTRContinuous stirred-tank reactor
MSEMean squared error
GAGenetic algorithm
ITAEIntegral of time-weighted absolute error
NMSENormalized mean squared error
RMSERoot mean squared error
NRMSENormalized root mean squared error

References

  1. Camacho, E.F.; Bordons, A.C. Model Predictive Control; Springer: London, UK, 2013; 423p. [Google Scholar]
  2. Ren, Y.M.; Alhajeri, M.S.; Luo, J.; Chen, S.; Abdullah, F.; Wu, Z.; Christofides, P.D. A Tutorial Review of Neural Network Modeling Approaches for Model Predictive Control. Comput. Chem. Eng. 2022, 165, 107956. [Google Scholar] [CrossRef]
  3. Jung, M.; da Costa Mendes, P.R.; Önnheim, M.; Gustavsson, E. Model Predictive Control When Utilizing LSTM as Dynamic Models. Eng. Appl. Artif. Intell. 2023, 123, 106226. [Google Scholar] [CrossRef]
  4. Ławryńczuk, M. Neural Networks in Model Predictive Control. Stud. Comput. Intell. 2009, 252, 31–63. [Google Scholar] [CrossRef]
  5. Bonassi, F.; Farina, M.; Xie, J.; Scattolini, R. On Recurrent Neural Networks for Learning-Based Control: Recent Results and Ideas for Future Developments. J. Process Control 2022, 114, 92–104. [Google Scholar] [CrossRef]
  6. Banerjee, A.; Varshney, D.; Kumar, S.; Chaudhary, P.; Gupta, V.K. Biodiesel Production from Castor Oil: ANN Modeling and Kinetic Parameter Estimation. Int. J. Ind. Chem. 2017, 8, 253–262. [Google Scholar] [CrossRef]
  7. Cheng, L.; Liu, W.; Hou, Z.G.; Yu, J.; Tan, M. Neural-Network-Based Nonlinear Model Predictive Control for Piezoelectric Actuators. IEEE Trans. Ind. Electron. 2015, 62, 7717–7727. [Google Scholar] [CrossRef]
  8. Talib, A.; Park, S.; Im, P.; Joe, J. Grey-Box and ANN-Based Building Models for Multistep-Ahead Prediction of Indoor Temperature to Implement Model Predictive Control. Eng. Appl. Artif. Intell. 2023, 126, 107115. [Google Scholar] [CrossRef]
  9. Stanišić, D.; Jorgovanović, N.; Popov, N.; Čongradac, V. Soft Sensor for Real-Time Cement Fineness Estimation. ISA Trans. 2015, 55, 250–259. [Google Scholar] [CrossRef] [PubMed]
  10. Stanišić, D.; Mejić, L.; Jorgovanović, B.; Ilić, V.; Jorgovanović, N. An Algorithm for Soft Sensor Development for a Class of Processes with Distinct Operating Conditions. Sensors 2024, 24, 1948. [Google Scholar] [CrossRef] [PubMed]
  11. Wu, Z.; Tran, A.; Ren, Y.M.; Barnes, C.S.; Chen, S.; Christofides, P.D. Model Predictive Control of Phthalic Anhydride Synthesis in a Fixed-Bed Catalytic Reactor via Machine Learning Modeling. Chem. Eng. Res. Des. 2019, 145, 173–183. [Google Scholar] [CrossRef]
  12. Wong, W.C.; Chee, E.; Li, J.; Wang, X. Recurrent Neural Network-Based Model Predictive Control for Continuous Pharmaceutical Manufacturing. Mathematics 2018, 6, 242. [Google Scholar] [CrossRef]
  13. Wu, Z.; Rincon, D.; Christofides, P.D. Process Structure-Based Recurrent Neural Network Modeling for Model Predictive Control of Nonlinear Processes. J. Process Control 2020, 89, 74–84. [Google Scholar] [CrossRef]
  14. Zheng, Y.; Wang, X.; Wu, Z. Machine Learning Modeling and Predictive Control of the Batch Crystallization Process. Ind. Eng. Chem. Res. 2022, 61, 5578–5592. [Google Scholar] [CrossRef]
  15. Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  16. Terzi, E.; Bonassi, F.; Farina, M.; Scattolini, R. Learning Model Predictive Control with Long Short-Term Memory Networks. Int. J. Robust Nonlinear Control 2021, 31, 8877–8896. [Google Scholar] [CrossRef]
  17. Karimanzira, D.; Rauschenbach, T.; Karimanzira, D.; Rauschenbach, T. Deep Learning Based Model Predictive Control for a Reverse Osmosis Desalination Plant. J. Appl. Math. Phys. 2020, 8, 2713–2731. [Google Scholar] [CrossRef]
  18. Wu, Z.; Luo, J.; Rincon, D.; Christofides, P.D. Machine Learning-Based Predictive Control Using Noisy Data: Evaluating Performance and Robustness via a Large-Scale Process Simulator. Chem. Eng. Res. Des. 2021, 168, 275–287. [Google Scholar] [CrossRef]
  19. Mtibaa, F.; Nguyen, K.K.; Dermardiros, V.; Cheriet, M. Context-Aware Model Predictive Control Framework for Multi-Zone Buildings. J. Build. Eng. 2021, 42, 102340. [Google Scholar] [CrossRef]
  20. Jeon, B.K.; Kim, E.J. LSTM-Based Model Predictive Control for Optimal Temperature Set-Point Planning. Sustainability 2021, 13, 894. [Google Scholar] [CrossRef]
  21. Safari, A.; Kharrati, H.; Rahimi, A. A Hybrid Attention-Based Long Short-Term Memory Fast Model for Thermal Regulation of Smart Residential Buildings. IET Smart Cities 2024, 6, 361–371. [Google Scholar] [CrossRef]
  22. Qin, S.J.; Badgwell, T.A. An Overview of Nonlinear Model Predictive Control Applications. Nonlinear Model Predict. Control 2000, 369–392. [Google Scholar] [CrossRef]
  23. Schwenzer, M.; Ay, M.; Bergs, T.; Abel, D. Review on Model Predictive Control: An Engineering Perspective. Int. J. Adv. Manuf. Technol. 2021, 117, 1327–1349. [Google Scholar] [CrossRef]
  24. Alhajeri, M.; Soroush, M. Tuning Guidelines for Model-Predictive Control. Ind. Eng. Chem. Res. 2021, 59, 4177–4191. [Google Scholar]
  25. Kaiser, M.S.; Iida, T.; Taniguchi, T.; Katayama, T.; Yoshimura, R.; Irifune, K. Optimal Prediction Horizon Length in Model Predictive Control to Maximise Energy Absorption by a Point Absorber Wave Energy Converter. Ocean Eng. 2025, 329, 121130. [Google Scholar] [CrossRef]
  26. Bøhn, E.; Gros, S.; Moe, S.; Johansen, T.A. Reinforcement Learning of the Prediction Horizon in Model Predictive Control. IFAC-PapersOnLine 2021, 54, 314–320. [Google Scholar] [CrossRef]
  27. Chen, Z.; Lai, J.; Li, P.; Awad, O.I.; Zhu, Y. Prediction Horizon-Varying Model Predictive Control (MPC) for Autonomous Vehicle Control. Electronics 2024, 13, 1442. [Google Scholar] [CrossRef]
  28. Gardezi, M.S.M.; Hasan, A. Machine Learning Based Adaptive Prediction Horizon in Finite Control Set Model Predictive Control. IEEE Access 2018, 6, 32392–32400. [Google Scholar] [CrossRef]
  29. Mdoe, Z.; Krishnamoorthy, D.; Jäschke, J. Stability Properties of the Adaptive Horizon Multi-Stage MPC. J. Process Control 2023, 128, 103002. [Google Scholar] [CrossRef]
  30. Giraldo, S.A.C.; Melo, P.A.; Secchi, A.R. Tuning of Model Predictive Controllers Based on Hybrid Optimization. Processes 2022, 10, 351. [Google Scholar] [CrossRef]
  31. Liu, C.; Shi, S.; De Schutter, B. Stability and Performance Analysis of Model Predictive Control of Uncertain Linear Systems. Proc. IEEE Conf. Decis. Control 2024, 7356–7362. [Google Scholar] [CrossRef]
  32. Laguna, G.; Mor, G.; Lazzari, F.; Gabaldon, E.; Erfani, A.; Saelens, D.; Cipriano, J. Dynamic Horizon Selection Methodology for Model Predictive Control in Buildings. Energy Rep. 2022, 8, 10193–10202. [Google Scholar] [CrossRef]
  33. Valencia-Palomo, G.; Rossiter, J.A. Novel Programmable Logic Controller Implementation of a Predictive Controller Based on Laguerre Functions and Multiparametric Solutions. IET Control Theory Appl. 2012, 6, 1003–1014. [Google Scholar] [CrossRef]
  34. Valencia-Palomo, G.; Rossiter, J. Using Laguerre Functions to Improve Efficiency of Multi-Parametric Predictive Control. In Proceedings of the 2010 American Control Conference, ACC 2010, Baltimore, MD, USA, 30 June–2 July 2010. [Google Scholar] [CrossRef]
  35. Gutiérrez-Urquídez, R.C.; Valencia-Palomo, G.; Rodríguez-Elias, O.M.; Trujillo, L. Systematic Selection of Tuning Parameters for Efficient Predictive Controllers Using a Multiobjective Evolutionary Algorithm. Appl. Soft Comput. 2015, 31, 326–338. [Google Scholar] [CrossRef]
  36. Sanatel, Ç.; Günel, G.Ö. Long Short Term Memory Based Self Tuning Regulator Design for Nonlinear Systems. Neural Process. Lett. 2022, 55, 3045–3079. [Google Scholar] [CrossRef]
  37. Zarzycki, K.; Ławry´nczuk, M.; Ławry´nczuk, Ł.; Lenci, S. LSTM and GRU Neural Networks as Models of Dynamical Processes Used in Predictive Control: A Comparison of Models Developed for Two Chemical Reactors. Sensors 2021, 21, 5625. [Google Scholar] [CrossRef] [PubMed]
  38. Proakis, J.G.; Manolakis, D.G. Digital Signal Processing: Principles, Algorithms, and Applications; Prentice-Hall, Inc.: Hoboken, NJ, USA, 1996. [Google Scholar]
  39. Björklund, S. Experimental Evaluation of Some Cross Correlation Methods for Time-Delay Estimation in Linear Systems; Linköping University Electronic Press: Linköping, Sweden, 2003. [Google Scholar]
  40. Ni, B.; Xiao, D.; Shah, S.L. Time Delay Estimation for MIMO Dynamical Systems—With Time-Frequency Domain Analysis. J. Process Control 2010, 20, 83–94. [Google Scholar] [CrossRef]
  41. Rossiter, J.A. Model-Based Predictive Control: A Practical Approach; CRC Press: Boca Raton, FL, USA, 2003. [Google Scholar]
  42. Yao, Y.; Shekhar, D.K. State of the Art Review on Model Predictive Control (MPC) in Heating Ventilation and Air-Conditioning (HVAC) Field. Build. Environ. 2021, 200, 107952. [Google Scholar] [CrossRef]
  43. Afram, A.; Janabi-Sharifi, F.; Fung, A.S.; Raahemifar, K. Artificial Neural Network (ANN) Based Model Predictive Control (MPC) and Optimization of HVAC Systems: A State of the Art Review and Case Study of a Residential HVAC System. Energy Build. 2017, 141, 96–113. [Google Scholar] [CrossRef]
  44. Arrigoni, S.; Braghin, F.; Cheli, F. MPC Trajectory Planner for Autonomous Driving Solved by Genetic Algorithm Technique. Veh. Syst. Dyn. 2022, 60, 4118–4143. [Google Scholar] [CrossRef]
Figure 1. Schematic representation of the used single tank system.
Figure 1. Schematic representation of the used single tank system.
Sensors 26 04214 g001
Figure 2. Schematic representation of an LSTM.
Figure 2. Schematic representation of an LSTM.
Sensors 26 04214 g002
Figure 3. Example of the total delay of a system’s output signal with respect to the input signal.
Figure 3. Example of the total delay of a system’s output signal with respect to the input signal.
Sensors 26 04214 g003
Figure 4. Flowchart of the proposed algorithm.
Figure 4. Flowchart of the proposed algorithm.
Sensors 26 04214 g004
Figure 5. Comparison of the CSTR output predicted by the LSTM model and the simulated system output for the same input sequence.
Figure 5. Comparison of the CSTR output predicted by the LSTM model and the simulated system output for the same input sequence.
Sensors 26 04214 g005
Figure 6. Comparison of the single tank system output predicted by the LSTM model and the simulated system output for the same input sequence.
Figure 6. Comparison of the single tank system output predicted by the LSTM model and the simulated system output for the same input sequence.
Sensors 26 04214 g006
Figure 7. Top: Scaled values of the step signal applied to the manipulated input of the LSTM model and the corresponding model response. Bottom: Scaled cross-correlation function of the two signals and its maximum value.
Figure 7. Top: Scaled values of the step signal applied to the manipulated input of the LSTM model and the corresponding model response. Bottom: Scaled cross-correlation function of the two signals and its maximum value.
Sensors 26 04214 g007
Figure 8. Closed-loop MPC response of the CSTR system for the disturbance rejection scenario using the estimated prediction horizon.
Figure 8. Closed-loop MPC response of the CSTR system for the disturbance rejection scenario using the estimated prediction horizon.
Sensors 26 04214 g008
Figure 9. Closed-loop MPC response of the single tank system for the disturbance rejection scenario using the estimated prediction horizon.
Figure 9. Closed-loop MPC response of the single tank system for the disturbance rejection scenario using the estimated prediction horizon.
Sensors 26 04214 g009
Figure 10. Closed-loop MPC response of the CSTR system for the setpoint tracking scenario using the estimated prediction horizon.
Figure 10. Closed-loop MPC response of the CSTR system for the setpoint tracking scenario using the estimated prediction horizon.
Sensors 26 04214 g010
Figure 11. Closed-loop MPC response of the single tank system for the setpoint tracking scenario using the estimated prediction horizon.
Figure 11. Closed-loop MPC response of the single tank system for the setpoint tracking scenario using the estimated prediction horizon.
Sensors 26 04214 g011
Table 1. List of the parameters for the CSTR and their values.
Table 1. List of the parameters for the CSTR and their values.
Parameter Values
T 0 = 400   K τ = 60   s
k A = 5000   1 / s V = 100   L
k B = 10 6   1 / s E A = 1 · 10 4   c a l / m o l
R = 1.987   c a l / ( m o l · K ) E A = 1.5 · 10 4   c a l / m o l
ρ = 1   k g / L H = 5000   c a l / m o l
C p = 1000   c a l / ( k g · K )
Table 2. Input ranges for the CSTR.
Table 2. Input ranges for the CSTR.
Heating RateInlet Concentration
Q [ 386.0 ,   80,386.0 ]   c a l / s C A 0 [ 0.0 ,   3.0 ]   m o l / L
Table 3. List of the parameters for the single tank system and their values.
Table 3. List of the parameters for the single tank system and their values.
Parameter Values
C d = 0.6 a = 20   c m
D o u t = 11   c m H 1 = 50   c m
g = 9.81   m / s 2 H m a x = 346   c m
r = 199.5   c m
Table 4. Input ranges for the single tank system.
Table 4. Input ranges for the single tank system.
Inflow RateOutflow Valve Opening
q i n [ 0.0 ,   40.0 ]   L / s x v a l v e [ 0.0 ,   100.0 ] %
Table 5. Input data for the manipulated and non-manipulated inputs during simulations.
Table 5. Input data for the manipulated and non-manipulated inputs during simulations.
ParameterValues
Manipulated input initial values{0.0, ±0.25, ±0.65}
Step changes{±0.05, ±0.1, ±0.15, ±0.2}
Non-manipulated inputs values{0.0, ±0.3, ±0.6, ±0.9}
Table 6. The values of the parameters used for the GA.
Table 6. The values of the parameters used for the GA.
ParameterValue
Population size50
Generations10
Crossover fraction80%
Elitism fraction10%
Mutation fraction10%
Crossover methodBlend crossover (BLX-α)
α 0.2
Table 7. Configurations of the selected LSTM models used for the MPC simulations for each benchmark system.
Table 7. Configurations of the selected LSTM models used for the MPC simulations for each benchmark system.
HyperparameterCSTRSingle Tank System
No. of hidden layers33
No. of units per hidden layer812
No. of inputs23
Table 8. Predictive performance metrics of the selected LSTM models evaluated on the test datasets.
Table 8. Predictive performance metrics of the selected LSTM models evaluated on the test datasets.
MetricCSTRSingle Tank System
Mean squared error (MSE)1.40816.429
Normalized mean squared error (NMSE)0.01410.0026
Root mean squared error (RMSE)1.1864.053
Normalized root mean squared error (NRMSE)0.0330.0117
Coefficient of determination ( R 2 )0.9860.997
Table 9. Mean values and standard deviations of the lags that maximize the cross-correlation function and the corresponding estimated prediction horizons for the two benchmark systems.
Table 9. Mean values and standard deviations of the lags that maximize the cross-correlation function and the corresponding estimated prediction horizons for the two benchmark systems.
SystemMean Value and Standard
Deviation of the Lags That
Maximize the Cross-Correlation Function
Estimated Prediction Horizon
CSTR19.32 ± 1.1620
Single tank system17.50 ± 6.2618
Table 10. Coefficients of determination and mean values and standard deviations of the lags that maximize the cross-correlation function for the two benchmark systems using prediction models with lower predictive performance than the selected models.
Table 10. Coefficients of determination and mean values and standard deviations of the lags that maximize the cross-correlation function for the two benchmark systems using prediction models with lower predictive performance than the selected models.
SystemR2Mean Value and Standard Deviation of the Lags That Maximize the Cross-Correlation Function
CSTR0.935 19.92 ± 2.17
0.959 19.11 ± 1.26
0.962 19.56 ± 0.63
Single tank system0.835 19.61 ± 4.12
0.903 19.89 ± 6.33
0.981 18.56 ± 6.22
Table 11. Closed-loop MPC performance metrics for the disturbance rejection scenario using the estimated prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
Table 11. Closed-loop MPC performance metrics for the disturbance rejection scenario using the estimated prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
SystemITAESettling Time [Time Steps]Overshoot [%]
CSTR 9.23 · 10 4 0 0.300
Single tank system 1.76 · 10 5 17 0.149
Table 12. Closed-loop MPC performance metrics for the setpoint tracking scenario using the estimated prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
Table 12. Closed-loop MPC performance metrics for the setpoint tracking scenario using the estimated prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
SystemITAESettling Time [Time Steps]Overshoot [%]
CSTR 3.28 · 10 5 27 N / A
Single tank system 2.09 · 10 6 37 N / A
Table 13. Closed-loop MPC performance metrics for the disturbance rejection scenario obtained using the estimated prediction horizon and multiple shorter and longer prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
Table 13. Closed-loop MPC performance metrics for the disturbance rejection scenario obtained using the estimated prediction horizon and multiple shorter and longer prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
SystemPrediction Horizon [Time Steps]ITAESettling Time [Time Steps]Overshoot [%]Mean Execution Time per Sample [s]
CSTR 11 4.43 · 10 6 N / A N / A 1.10 ± 0.05
14 3.13 · 10 6 N / A N / A 1.28 ± 0.03
17 2.05 · 10 6 N / A N / A 1.48 ± 0.04
20 9.23 · 10 4 0 0.300 1.68 ± 0.04
23 1.86 · 10 4 0 0.117 1.87 ± 0.05
26 9.65 · 10 3 0 0.099 2.06 ± 0.07
29 1.12 · 10 4 0 0.147 2.24 ± 0.06
Single tank system 9 1.35 · 10 7 N / A N / A 1.41 ± 0.04
12 5.88 · 10 5 27 N / A 1.70 ± 0.04
15 2.95 · 10 5 18 N / A 1.99 ± 0.05
18 1.76 · 10 5 17 0.149 2.25 ± 0.05
21 1.96 · 10 5 17 0.407 2.51 ± 0.03
24 1.95 · 10 5 16 0.504 2.85 ± 0.06
27 1.89 · 10 5 16 0.405 3.15 ± 0.09
Table 14. Closed-loop MPC performance metrics for the setpoint tracking scenario obtained using the estimated prediction horizon and multiple shorter and longer prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
Table 14. Closed-loop MPC performance metrics for the setpoint tracking scenario obtained using the estimated prediction horizon and multiple shorter and longer prediction horizons. Entries marked as N/A indicate that the corresponding metric is not applicable, either because no overshoot occurred or steady state was not reached within the simulation interval.
SystemPrediction Horizon [Time Steps]ITAESettling Time [Time Steps]Overshoot [%]Mean Execution Time per Sample [s]
CSTR 11 2.79 · 10 6 N / A N / A 1.08 ± 0.02
14 1.85 · 10 6 N / A N / A 1.26 ± 0.04
17 6.96 · 10 5 N / A N / A 1.49 ± 0.06
20 3.28 · 10 5 27 N / A 1.66 ± 0.02
23 1.88 · 10 5 26 0.073 1.88 ± 0.04
26 1.96 · 10 5 25 0.428 2.05 ± 0.05
29 2.09 · 10 5 25 0.536 2.28 ± 0.09
Single tank system 9 1.19 · 10 7 N / A N / A 1.40 ± 0.03
12 2.79 · 10 6 52 N / A 1.70 ± 0.06
15 2.22 · 10 6 38 N / A 2.01 ± 0.01
18 2.09 · 10 6 37 N / A 2.28 ± 0.05
21 2.09 · 10 6 35 N / A 2.57 ± 0.07
24 2.11 · 10 6 34 N / A 2.78 ± 0.03
27 2.13 · 10 6 35 N / A 3.13 ± 0.06
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.

Share and Cite

MDPI and ACS Style

Jorgovanović, B.; Jorgovanović, N.; Stanišić, D.; Mejić, L. A Novel Data-Driven Algorithm for Prediction Horizon Estimation in Model Predictive Control. Sensors 2026, 26, 4214. https://doi.org/10.3390/s26134214

AMA Style

Jorgovanović B, Jorgovanović N, Stanišić D, Mejić L. A Novel Data-Driven Algorithm for Prediction Horizon Estimation in Model Predictive Control. Sensors. 2026; 26(13):4214. https://doi.org/10.3390/s26134214

Chicago/Turabian Style

Jorgovanović, Bojan, Nikola Jorgovanović, Darko Stanišić, and Luka Mejić. 2026. "A Novel Data-Driven Algorithm for Prediction Horizon Estimation in Model Predictive Control" Sensors 26, no. 13: 4214. https://doi.org/10.3390/s26134214

APA Style

Jorgovanović, B., Jorgovanović, N., Stanišić, D., & Mejić, L. (2026). A Novel Data-Driven Algorithm for Prediction Horizon Estimation in Model Predictive Control. Sensors, 26(13), 4214. https://doi.org/10.3390/s26134214

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop