## 5 Model-Based Predictive Control of the VSI
### Incremental Formulation  
Following the MPC formulation presented in [34], the quadratic cost function can be rewritten as follows:  
\[V_{2}(\mathbf{\tilde{x}},\mathbf{\tilde{u}})=\Delta\mathbf{\tilde{x}}_{ \mathrm{e},N}^{\top}\mathbf{Q}_{N}\Delta\mathbf{\tilde{x}}_{\mathrm{e},N}+ \sum_{k=0}^{N-1}\Delta\mathbf{\tilde{x}}_{\mathrm{e},k}^{\top}\mathbf{Q}\Delta \mathbf{\tilde{x}}_{\mathrm{e},k}+\Delta\mathbf{\tilde{u}}_{k}^{\top}\mathbf{R }\Delta\mathbf{\tilde{u}}_{k}, \tag{27}\]where,  
\[\Delta\tilde{\mathbf{x}}_{\mathrm{e},k} = \begin{bmatrix}\tilde{\mathbf{x}}_{t}\\ \mathbf{y}_{t-1}\end{bmatrix} - \begin{bmatrix}\tilde{\mathbf{x}}_{\mathrm{t-1}} \\ \mathbf{r}\end{bmatrix} , \tag{28}\] \[\Delta\tilde{\mathbf{u}}_{k} =\tilde{\mathbf{u}}_{t}-\tilde{\mathbf{u}}_{t-1}, \tag{29}\]  
represent the incremental variables. Given these transformations, the state and input constraints are given by the following:  
\[\Delta\tilde{\mathbf{x}}_{\mathrm{e},k+1} =\mathbf{A}_{\mathrm{e}}\Delta\tilde{\mathbf{x}}_{\mathrm{e},k}+ \mathbf{B}_{\mathrm{e}}\Delta\tilde{\mathbf{u}}_{k},\] \[\Delta\tilde{\mathbf{x}}_{\mathrm{min}} \leq\mathbf{J}\Delta\tilde{\mathbf{x}}_{k}\leq\Delta\tilde{ \mathbf{x}}_{\mathrm{max}},\] \[\Delta\tilde{\mathbf{u}}_{\mathrm{min}} \leq\mathbf{E}\Delta\tilde{\mathbf{u}}_{k}\leq\Delta\tilde{ \mathbf{u}}_{\mathrm{max}},\] \[\mathbf{x}_{0} =\mathbf{x}_{t},\]  
where  
\[\Delta\tilde{\mathbf{x}}_{\mathrm{min}} =\mathbf{I}_{\mathrm{x}}-\mathbf{J}(\mathbf{x}_{k-1}+\Delta \tilde{\mathbf{x}}_{\mathrm{e},t}), \tag{31}\] \[\Delta\tilde{\mathbf{x}}_{\mathrm{max}} =\mathbf{u}_{\mathrm{x}}-\mathbf{J}(\mathbf{x}_{k-1}+\Delta \tilde{\mathbf{x}}_{\mathrm{e},t}),\] (32) \[\Delta\tilde{\mathbf{u}}_{\mathrm{min}} =\mathbf{I}_{\mathrm{u}}-\mathbf{E}(\mathbf{u}_{k-1}+\Delta \tilde{\mathbf{u}}_{\mathrm{e},t}),\] (33) \[\Delta\tilde{\mathbf{u}}_{\mathrm{max}} =\mathbf{u}_{\mathrm{u}}-\mathbf{E}(\mathbf{u}_{k-1}+\Delta \tilde{\mathbf{u}}_{\mathrm{e},t}). \tag{34}\]  
The optimization problem must be reformulated to a standard form to be compatible with the OSQP solver [25], as follows:  
min \[\frac{1}{2}\boldsymbol{\psi}^{\top}\mathbf{H}\boldsymbol{\psi}+ \mathbf{h}^{\top}\boldsymbol{\psi},\] (35) s.t. \[\Delta\tilde{\mathbf{x}}_{\mathrm{e},k+1} =\mathbf{A}_{\mathrm{e}}\Delta\tilde{\mathbf{x}}_{\mathrm{e},k}+ \mathbf{B}_{\mathrm{e}}\Delta\tilde{\mathbf{u}}_{k},\]0 (36) \[\Delta\tilde{\mathbf{x}}_{\mathrm{e},k+1} =\mathbf{A}_{\mathrm{e}}\Delta\tilde{\mathbf{x}}_{\mathrm{e},k}+ \mathbf{B}_{\mathrm{e}}\Delta\tilde{\mathbf{u}}_{k},\]1 (37)  
There are two mathematically equivalent alternatives to express the problem (27)-(34): the condensed and non-condensed approaches [35]. However, each approach offers different numerical properties [35]. Following the more intuitive non-condensed approach, the problem of interest is described as follows:  
\[\boldsymbol{\psi}\!=\! \begin{bmatrix}\Delta\tilde{\mathbf{x}}_{o}\\ \vdots\\ \Delta\tilde{\mathbf{x}}_{N}\\ \Delta\tilde{\mathbf{u}}_{o}\\ \vdots\\ \Delta\tilde{\mathbf{u}}_{N-1}\end{bmatrix} ,\;\mathbf{H}\!=\! \begin{bmatrix} \mathbf{Q}&\mathbf{0}&\mathbf{0}&\mathbf{0}&\cdots&\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\ddots&\mathbf{0}&\mathbf{0}&\cdots&\vdots\\ \mathbf{0}&\mathbf{0}&\mathbf{Q}&\mathbf{0}&\cdots&\vdots\\ \mathbf{0}&\mathbf{0}&\mathbf{Q}_{N}&\mathbf{0}&\cdots&\vdots\\ \vdots&\vdots&\vdots&\mathbf{0}&\mathbf{R}&\vdots&\vdots\\ \mathbf{0}&\cdots&\cdots&\cdots&\cdots&\ddots&\vdots\\ \mathbf{0}&\cdots&\cdots&\cdots&\cdots&\cdots&\mathbf{R}\end{bmatrix} , \tag{38}\]\(\psi\) is the decision vector, \(\mathbf{H}\) is the Hessian matrix, and \(\mathbf{h}\in\) is a zero column vector. The initial condition of the QP problem and the predictive model (16) are formulated as the equality constraints in (36) with the following:  
\[\mathbf{F}=