# Tuning of Multivariable Model Predictive Control for Industrial Tasks
## 2 MPC Problem Formulation  
In this work, we deal with MIMO processes that have as many as \(n_{\text{u}}\) manipulated variables (inputs) and \(n_{\text{y}}\) controlled variables (outputs). Hence, the following vectors are used: \(u=[u_{1}\ldots u_{\text{u}_{\text{u}}}]^{\text{T}}\) and \(y=\left[y_{1}\ldots y_{n_{\text{y}}}\right]^{\text{T}}\). At each discrete sampling instant, \(k=0,1,\ldots\), the MPC algorithm calculates on-line the vector of decision variables, which is defined by the increments of the future manipulated variables [6]:  
\[\triangle u(k)=\left[ \begin{array}{c}\triangle u(k|k)\\ \vdots\\ \triangle u(k+N_{\text{u}}-1|k)\end{array} \right] \tag{1}\]  
where \(N_{\text{u}}\) is the control horizon. The MPC decision variables (1) are found as a result of a computational procedure in which the predicted control quality is optimised. An example of the minimised MPC cost function is:  
\[J(k)=\sum_{p=1}^{N}\sum_{n=1}^{n_{\text{y}}}\psi_{p,n}\Big{(}y_{n}^{\text{sp }}(k+p|k)-\hat{y}_{n}(k+p|k)\Big{)}^{2}+\sum_{p=0}^{N_{\text{u}}-1}\sum_{n=1} ^{n_{\text{u}}}\lambda_{p,n}(\triangle u_{n}(k+p|k))^{2} \tag{2}\]The first part of the cost function measures the control errors predicted over the prediction horizon \(N\). The set-points and predicted values for the future sampling instant \(k+p\) known at the sampling instant \(k\) are denoted by \(y_{n}^{\text{SP}}(k+p|k)\) and \(\hat{y}_{n}(k+p|k)\), respectively, for all process outputs, i.e., \(n=1,\ldots,n_{\text{y}}\). The role of the second part of the cost function is to minimise unwanted big changes of the manipulated variables. In some applications for the cost function (2), the predicted squared values of the future manipulated variables may be also taken into account. The tuning coefficients are: \(\psi_{p,n}\geq 0\) for \(p=1,\ldots,N\), \(n=1,\ldots,n_{\text{y}}\) and \(\lambda_{p,n}>0\) for \(p=0,\ldots,N_{\text{u}}-1\), \(n=1,\ldots,n_{\text{u}}\). Typically, the penalties \(\lambda_{p,n}\) are chosen in such a way that the manipulated variables do not change rapidly. As far as the coefficients \(\psi_{p,n}\) are concerned, the choice is more difficult. This is because these coefficients prioritiise the predicted control errors of the consecutive controlled variables. Additionally, predicted control errors for different sampling instants over the prediction horizon may be taken into account in a different way. In practice, however, for simplicity, all coefficients \(\psi_{p,n}\) are set to a constant value. Unfortunately, as is shown in Section 4, this may deteriorate the resulting control quality. The cost function (2) may be conveniently rewritten in a compact form:  
\[J(k)=\sum_{p=1}^{N}\|y^{\text{SP}}(k+p|k)-\hat{y}(k+p|k)\|_{\mathbf{\pi}_{p}}^{ 2}+\sum_{p=0}^{N_{\text{u}}-1}\|\triangle u(k+p|k)\|_{\mathbf{\Lambda}_{p}}^{2} \tag{3}\]  
where the set-point vector for the sampling instant \(k+p\) is denoted by \(y^{\text{SP}}(k+p|k)\), the predicted vector of the output variables for the sampling instant \(k+p\) is denoted by \(\hat{y}(k+p|k)\) and both vectors are of length \(n_{\text{y}}\). The semidefinite-positive matrix \(\mathbf{\Psi}_{p}=\text{diag}(\psi_{p,1},\ldots,\psi_{p,n_{\text{y}}})\) is of dimensionality \(n_{\text{y}}\times n_{\text{y}}\), and the definite-positive matrix \(\mathbf{\Lambda}_{p}=\text{diag}(\lambda_{p,1},\ldots,\lambda_{p,n_{\text{u}}})\) is of dimensionality \(n_{\text{u}}\times n_{\text{u}}\). In practice, we usually consider some constraints put on process variables.