# Analytical MPC Algorithm Using Steady-State Process Model
## 2 Materials and Methods
### Analytical DMC Algorithm  
The simplest MPC algorithms are based on linear process models; see e.g., [7]. One of them is the DMC algorithm, based on the process model in the form of the step response:  
\[\widehat{y}_{k}=\sum_{n=1}^{p_{d}-1}a_{n}\cdot\Delta u_{k-n}+a_{p_{d}}\cdot u _{k-p_{d}}, \tag{3}\]  
where \(a_{n}\) are the coefficients of the control plant step response, and \(p_{d}\) is the horizon of dynamics equal to the number of time instants, after which the step response coefficients can be considered fixed.  
The predicted output values, calculated from Model (3), are thus given by the following formula:  
\[y_{k+i|k}=\widehat{y}_{k+i}+d_{k}, \tag{4}\]  
where \(d_{k}=y_{k}-\widehat{y}_{k}\) is a model of unmeasured disturbances (it also includes the effect of modeling errors) acting on the process; it is calculated as the difference between the current process output measurement \(y_{k}\) and the output of the model described by (3). If no better information is available, it is assumed that it is constant over the entire prediction horizon. This model of unmeasurable disturbances is called a DMC-type disturbance model. After transformation of the prediction (4), one obtains the following:  
\[y_{k+i|k}=\sum_{n=1}^{i}a_{n}\cdot\Delta u_{k-n+i}+\sum_{n=i+1}^{p_{d}-1}a_{n }\cdot\Delta u_{k-n+i}+a_{p_{d}}\cdot u_{k-p_{d}}+d_{k}\, \tag{5}\]  
The prediction (5) can be transformed to the following form:  
\[y_{k+i|k}=y_{k} +\sum_{n=i+1}^{p_{d}-1}a_{n}\cdot\Delta u_{k-n+i}+a_{p_{d}}\cdot \sum_{n=p_{d}}^{p_{d}+i-1}\Delta u_{k-n+i}-\sum_{n=1}^{p_{d}-1}a_{n}\cdot \Delta u_{k-n}\] \[+\sum_{n=1}^{i}a_{n}\cdot\Delta u_{k-n+i|k}. \tag{6}\]  
Note that in Formula (6), only the last component depends on future control changes; the others depend on the past. Thus, the other components are elements of the free response:  
\[\widetilde{y}_{k+i|k}=y_{k}+\sum_{n=i+1}^{p_{d}-1}a_{n}\cdot\Delta u_{k-n+i}+ a_{p_{d}}\cdot\sum_{n=p_{d}}^{p_{d}+i-1}\Delta u_{k-n+i}-\sum_{n=1}^{p_{d}-1}a_{n }\cdot\Delta u_{k-n}. \tag{7}\]  
In such a case, the prediction of the process output values \(\mathbf{y}\) expressed in the matrix-vector form can be decomposed into two parts:  
If one assumes that reference trajectory is constant on the prediction horizon, then the vector \(\overline{y}\) from (2) becomes  
\[\overline{y}=\left[\overline{y}_{k},\ldots,\overline{y}_{k}\right]\,, \tag{18}\]  
where \(\overline{y}_{k}\) is the current setpoint value. In such a case, the following control law can be obtained:  
\[\Delta u_{k|k}=\Delta u_{k}=r_{0}\cdot e_{k}+\sum_{i=1}^{p_{d}-1}r_{i}\cdot \Delta u_{k-i}, \tag{19}\]  
where \(r_{0}=\sum_{j=1}^{p}K_{1j}\), \(\left[r_{1},\ldots,r_{p_{d}-1}\right]=\mathbf{K}_{1}\cdot\overline{\mathbf{A}}\,,\mathbf{K }_{1}=\left[K_{11},\ldots,K_{1p}\right]\).  
The output of the analytical DMC controller is the control increment. The following formula describes the control value:  
\[u_{k|k}=u_{k-1}+\Delta u_{k|k}\,. \tag{20}\]  
Applying an LMPC algorithm to a nonlinear process may result in unsatisfactory control performance, especially if the MPC algorithm should operate at different operating points. In such a case, the operation of the control system can be improved using an MPC algorithm based on a nonlinear model.