## 2 Model Predictive Control
Therefore, the main objective of the cost function is to keep the output of the process and \((t+k\,|\,t)\) as close as possible to a reference trajectory \(w\)\((t+k)\) that describes how you want to guide the output from your current value and \((t)\) up to your future points of consignment. The cost function thus generally takes the form of a quadratic function of the errors between the predicted output and the reference trajectory. In addition, in most cases, it usually includes some term referring to the control effort [56]. Figure 2: The concept of a receding horizon. In the case of the optimizer, the vector of control actions that offers the best value of the cost function must be found. Generally, in this search process, the optimizer performs postulates of the control law and iteratively tries to approach the optimal control law. In addition, if the cost function that is defined is quadratic, the model used is linear and there are no restrictions for any signal involved, then it is possible to find an analytical solution for the optimization problem. Otherwise, it is necessary to use, in general, a numerical optimization method. Once the sequence of future control actions is calculated, which at that moment makes the cost function optimal, the concept called receding horizon is used [59]. Only the first of them is applied as input to the process \(u(t\,\wr t)\), neglecting the rest, since at the next instant \(t+1\), the output \(y\) (\(t+1\)) is already known, and with that new information the points are repeated 1, 2 and 3, obtaining in this way the control signal \(u(t+1\,\wr t+1)\) to apply at that moment (which is not equal to the one that had been postulated at the previous instant \(u(t+1\,\wr t)\)). The analysis of this control methodology shows that, whatever the implementation is, any predictive control based on models can be understood as an optimization problem in each sampling period (mobile horizon) that consists of three fundamental elements: predictor, cost function and optimizer. Combining different variations of these three fundamental elements can obtain many controllers that would be part of the family of predictive controllers. Thus, this diversity can be inferred, considering that different controllers will appear, depending on the type of model of the process used, according to the type of cost function used and according to the applied optimization method. To be able to propose any type of improvement, one must go through a first step of analyzing these three fundamental elements. Almost all possible ways of modeling a process appear in some MPC formulations, the most used being the following: finite impulse response, step response and state space model. The finite impulse response is also known by weighting sequence or convolution model. The output is related to the input by the equation:  
\[y(t)=\sum_{i=1}^{\infty}h_{i}u(t-i) \tag{1}\]  
where \(h_{i}\) are the sampled values obtained by subjecting the process to an impulse unit of amplitude equal to the sampling period. This sum is truncated and only \(N\) values are considered (therefore, it only allows representing stable processes and without integrators), having:  
Figure 3: The strategy of the MPC. \[y(t)=\sum_{i=1}^{N}h_{i}u(t-i)=H(z^{-1})u(t) \tag{2}\]  
where:  
\[H(z^{-1})=h_{1}z^{-1}+h_{2}z^{-2}+\ldots+h_{N}z^{-N} \tag{3}\]  
A disadvantage of this method is the many parameters you need, since \(N\) is usually a high value (in the order of 40-50). The prediction will be given by:  
\[y(t+k|t)=\sum_{i=1}^{N}h_{i}u(t+k-i|t)=H(z^{-1})u(t+k|t) \tag{4}\]  
This method is widely accepted in industrial practice because it is very intuitive and does not require prior information about the process, with which the identification procedure is simplified, while easily describing complex dynamics such as non-minimal phase or delays. The step response is very similar to the previous one only now that the input signal is a step.