## 2 GPC Problem Formulation
### Construction of GPC Algorithm  
In the GPC algorithm, the dynamics of the control object are modeled in the form of a discrete transfer function. In order to simplify the explanation, the model in the structure of Multiple Input Single Output (MISO) is presented in (3):  
\[\hat{y}_{k}=-A^{T}Y_{k-1}+B\Delta U_{k}^{MV\_P}+D\Delta U_{k}^{DV\_P} \tag{3}\]\(A\) is a vector of model coefficients associated with historical values of the output given by (4):  
\[A=\left[\begin{array}{c}a_{1}\\ \vdots\\ a_{max\_n}\end{array}\right] \tag{4}\]  
where \(max\_n\) defines the number of the coefficients and order of the model denominator. \(Y_{k-1}\) is a vector of the past values of model outputs given by (5):  
\[Y_{k-1}=\left[\begin{array}{c}y_{k-1}\\ \vdots\\ y_{k-max\_n}\end{array}\right] \tag{5}\]  
\(B\) is a vector of model coefficients associated with historical values of the inputs (MVs signals) given by (6):  
\[B=\left[\begin{array}{c}B^{(0)}\\ \vdots\\ B^{(max\_m)}\end{array}\right]=\left[\begin{array}{c}b^{(1)}_{0}\\ \vdots\\ b^{(nMV)}_{0}\\ \vdots\\ \left[\begin{array}{c}b^{(1)}_{max\_m}\\ \vdots\\ b^{(nMV)}_{max\_m}\end{array}\right]\end{array}\right] \tag{6}\]  
\(max\_m\) defines the maximum number of coefficients for the MV inputs (model order), \(nMV\) defines number of MVs inputs. Vector of the past values of MVs is given by (7), where \(mv1\) to \(nMV\) define index of MV inputs, \(delay_{mv1}\) to \(delay_{nMV}\) defines delay values for each MV inputs.  
\[\Delta U^{MV\_P}_{k}=\left[\begin{array}{c}\Delta u^{(mv1)}_{k-delay_{mv1}} \\ \vdots\\ \Delta u^{(nMV)}_{k-delay_{nMV}}\\ \vdots\\ \left[\begin{array}{c}\Delta u^{(mv1)}_{k-max\_m-delay_{mv1}}\\ \vdots\\ \Delta u^{(nMV)}_{k-max\_m-delay_{nMV}}\end{array}\right]\end{array}\right] \tag{7}\]  
\(D\) is a vector of model coefficients associated with the historical value of the Disturbance Variable inputs (DV signals) given by (8):  
\[D=\left[\begin{array}{c}D^{(0)}\\ \vdots\\ D^{(max\_l)}\end{array}\right]=\left[\begin{array}{c}d^{(1)}_{0}\\ \vdots\\ d^{(nDV)}_{0}\\ \vdots\\ \left[\begin{array}{c}d^{(1)}_{max\_l}\\ \vdots\\ d^{(nDV)}_{max\_l}\end{array}\right]\end{array}\right] \tag{8}\]\(max\_l\) defines the maximum number of coefficients for the DV inputs (model order), \(nDV\) defines number of DV inputs. The vector of the past values of DVs is given by (9), where \(dv1\) to \(nDV\) define the index of DV inputs, \(delay_{dv1}\) to \(delay_{nDV}\) defines delay values for each of the DV inputs.  
\[\Delta U_{k}^{DV-P}=\left[\begin{array}{c}\Delta u_{k-delay_{dv1}}^{(dv1)}\\ \vdots\\ \Delta u_{k-delay_{nDV}}^{(nDV)}\\ \vdots\\ \left[\begin{array}{c}\Delta u_{k-max,l-delay_{dv1}}^{(dv1)}\\ \vdots\\ \Delta u_{k-max,l-delay_{nDV}}^{(nDV)}\\ \end{array}\right]\\ \end{array}\right] \tag{9}\]  
In each timestep, the GPC algorithm solves the optimization problem defined by (2). The algorithm calculates the optimal trajectory of the CVs, which minimizes the difference between setpoint and predicted model outputs while minimizing the changes of MVs signals. The predicted model outputs are calculated using general model formula (3) based on past outputs of MVs and DVs values and predicted (i.e., calculated by GPC algorithm) MVs. The accuracy of the model predictions is critical to the correct operation of the GPC algorithm.