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.
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,
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.
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.