# Gain-Scheduled Model Predictive Control for
## 3 Controller Design
### Stability Proof  
The GSMPC consists of a series of single MPCs. The gain-schedule algorithm decides which single MPC is employed to control the CIPS during the control process. So, if the stability of all single MPCs can be proven, then the GSMPC is also stable. For the MPC-\(I\), the corresponding linearized model \((A_{i},B_{i},C_{i},D_{i})\) has the mathematical expression shown in (22). The continuous linearized model is transformed to the discrete form:  
\[ \begin{cases}X_{k+1}=AX_{k}+Bu_{k}\\ Z_{k}=CX_{k}\end{cases}  \tag{27}\]  
For each single linear MPC, the cost function is defined as (28) and the constraint is specified as \(-100\leqslant u\leqslant 100\)  
\[V_{k}=\sum_{j=0}^{p-1}\left(\left\|CX_{k+j|k}-Z_{k+j}^{d}\right\|_{2}^{2}+ \left\|u_{k+j|k}\right\|_{2}^{2}\right) \tag{28}\]  
Figure 5: The control system’s block diagram of the CIPS with a single MPC. Figure 6: The control system block diagram of the CIPS. Then, the optimal problem can be formulated as  
\[u_{k}^{*}=\min_{u_{k}}V_{k} \tag{29}\]  
which is subjected to the following constraints:  
\[ \begin{cases}X_{k+j|k}=AX_{k+j-1|k}+Bu_{k+j-1}\\ X_{k|k}=X_{k}\\ Z_{k+p}=CX_{k+p}=Z_{k+p}^{d}\\ -100\leqslant u_{k}\leqslant 100\end{cases}  \tag{30}\]  
where \(u_{k}^{*}\) is the optimal control input sequence at the moment \(k\). The optimal problem (29) is solved by the optimizer, shown in Figure 5. According to the optimal solution, the optimal control input sequence \(u_{k}^{*}\) and model predicted output \(Z_{k}^{*}\) at moment \(k\) are formulated as (31). In addition, the optimal value of \(V_{k}\) at moment \(k\) is defined as \(V_{k}^{*}\), which can be computed according to (28). \[ \begin{cases}u_{k}^{*}=\left[\begin{array}{llll}u_{k|k}^{*}&u_{k+1|k}^{*}& \ldots&u_{k+p-1|k}^{*}\end{array}\right]^{T}\\ Z_{k}^{*}=\left[\begin{array}{llll}Z_{k|k}^{*}&Z_{k+1|k}^{*}&\ldots&Z_{k+p-1| k}^{*}&Z_{k+p}^{*}\end{array}\right]^{T}\end{cases}  \tag{31}\]  
Then, at moment \(k+1\), \(Z_{k+p+1|k}^{*}=Z_{k+p+1}^{d}\), and \(u_{k+p|k+1}^{*}=u_{k+p|k}^{*}=0\). So, the control input sequence \(u_{k+1}\) can be selected as  
\[ \begin{cases}u_{k+1}=\left[\begin{array}{llll}u_{k+1|k}^{*}&u_{k+2|k}^{*}& \ldots&u_{k+p-1|k}^{*}&0\end{array}\right]^{T}\\ Z_{k+1}=\left[\begin{array}{llll}Z_{k+1|k}^{*}&Z_{k+2|k}^{*}&\ldots&Z_{k+p|k}^ {*}&Z_{k+p}^{d}\end{array}\right]^{T}\end{cases}  \tag{32}\]  
According to (28), \(V_{k+1}\) can be described as  
\[ \begin{split}& V_{k+1}=\sum_{j=0}^{p-1}\left(\left\|CX_{k+1+j|k+1}- Z_{k+1+j}^{d}\right\|_{2}^{2}+\left\|u_{k+1+j|k+1}\right\|_{2}^{2}\right)\\ &=\sum_{j=1}^{p}\left(\left\|CX_{k+j|k}-Z_{k+j}^{d}\right\|_{2}^{2}+ \left\|u_{k+j|k}\right\|_{2}^{2}\right)\end{split}  \tag{33}\]  
Substituting (32) into (33), it produces  
\[V_{k+1}=V_{k}^{*}-\left[\left(\left\|CX_{k|k}-Z_{k}^{d}\right\|_{2}^{2}+\left\| u_{k|k}\right\|_{2}^{2}\right)+\left(\left\|CX_{k+p|k}-Z_{k+p}^{d}\right\|_{2}^{2}+ \left\|u_{k+p|k}^{*}\right\|_{2}^{2}\right)\right]\leqslant V_{k}^{*} \tag{34}\]  
So, \(u_{k+1}\) is a feasible solution. The optimal solution \(u_{k+1}^{*}\) is more superior than \(u_{k+1}\). According to (28) and (29), \(V_{k+1}^{*}\leq V_{k+1}\). According to (34), we can obtain  
\[V_{k+1}^{*}\leqslant V_{k+1}\leqslant V_{k}^{*} \tag{35}\]  
Therefore, the system is asymptotically stable no matter which single MPC is applied. So, the system is also asymptotically stable when applying the GMPC. According to the above analysis, when the \(i\)th single MPC corresponding to the \(i\)th linearized model \((A_{i},B_{i},C_{i},D_{i})\) is applied, the control input applied to the CIPS is \(u_{i}=u_{k|k}^{*}\). So, for the GMPC, the control input applied to the CIPS is one element of set \(\{u_{1},\ldots,u_{n}\}\). According to the gain-schedule algorithm (26), the control input generated by the GSMPC is  
\[ \begin{cases}d_{i}=\left|\theta-\theta_{i}\right|\text{, }(i=1,\ldots,n)\\ d=\left\{d_{1},\ldots,d_{n}\right\}\\ d_{j}=\min\{d\}\text{, }(j=1,\text{or }j=2,\ldots,\text{or }j=n)\\ I=\min\{j\}\\ U=\{u_{1},\ldots,u_{n}\}\\ u=U(I)\end{cases}