# Anti-Jamming Power Control Algorithm for Wireless Communication Systems Based on MPC
## 3 Design of the MPC Controller
The predicted value of the state variable at time \(k+1\) is:  
\[\widetilde{x}(k+1|k)={\mathrm{A}_{\mathrm{m}}}\widetilde{x}(k|k)+{\mathrm{B}_ {\mathrm{m}}}\widetilde{u}(k|k)={\mathrm{A}_{\mathrm{m}}}\widetilde{x}_{k}+{ \mathrm{B}_{\mathrm{m}}}\widetilde{u}(k|k) \tag{14}\]  
Here, \(\widetilde{u}(k|k)\) denotes the transmission power of the system at time \(k\). The predicted value of the state variable at time \(k+2\) is:  
\[\widetilde{x}(k+2|k)={\mathrm{A}_{\mathrm{m}}}\widetilde{x}(k+1|k)+{\mathrm{B} _{\mathrm{m}}}\widetilde{u}(k+1|k) \tag{15}\]  
Upon substituting Equation (14) into Equation (15), the following result is obtained:  
\[\widetilde{x}(k+2\Big{|}k)={\mathrm{A}_{\mathrm{m}}^{2}}\widetilde{x}_{k}+{ \mathrm{A}_{\mathrm{m}}}{\mathrm{B}_{\mathrm{m}}}\widetilde{u}(k\Big{|}k)+{ \mathrm{B}_{\mathrm{m}}}\widetilde{u}(k+1\Big{|}k) \tag{16}\]  
By proceeding in this manner, the state at time \(k+N\) can be obtained as:  
\[\widetilde{x}(k+N\Big{|}k)={\mathrm{A}_{\mathrm{m}}^{\mathrm{N}}}\widetilde{x }_{k}+{\mathrm{A}_{\mathrm{m}}^{\mathrm{N-1}}}{\mathrm{B}_{\mathrm{m}}} \widetilde{u}(k|k)+\cdots+{\mathrm{B}_{\mathrm{m}}}\widetilde{u}(k+N-1|k) \tag{17}\]  
To simplify the system analysis, define:  
\[\widetilde{\mathbf{X}}_{k}=\left[ \begin{array}{c}\widetilde{x}(k|k)\\ \widetilde{x}(k+1|k)\\ \cdots\\ \widetilde{x}(k+i|k)\\ \widetilde{x}(k+N|k)\end{array} \right] \tag{18}\]  
\[\widetilde{\mathbf{U}}_{k}=\left[ \begin{array}{c}\widetilde{u}(k|k)\\ \widetilde{u}(k+1|k)\\ \cdots\\ \widetilde{u}(k+i|k)\\ \widetilde{u}(k+N|k)\end{array} \right] \tag{19}\]Equation (18) can also be expressed as:  
\[\widetilde{\mathbf{X}}_{k}=\left[ \begin{array}{c}1\\ A_{m}\\ A_{m}\\ \cdots\\ A_{m}\end{array} \right]\widetilde{x}_{k}+\left[ \begin{array}{cccc}0&0&\cdots&0 \\ B_{m}&\cdots&\ddots&0\\ A_{m}B_{m}&B_{m}&\vdots&\vdots&\vdots\\ \vdots&\vdots&\cdots&0\\ A_{m}{}^{N-1}B_{m}&A_{m}{}^{N-2}B_{m}&\cdots&B_{m}\end{array} \right]\widetilde {\mathbf{X}}_{k} \tag{20}\]  
\(\widetilde{\mathbf{X}}_{k}\) represents the state variables predicted over the entire prediction horizon at time \(k\), and \(\widetilde{\mathbf{U}}_{k}\) denotes the control sequence computed at time \(k\). For simplification purposes, Equation (20) can be reduced to:  
\[\widetilde{\mathbf{X}}_{k}=\mathbf{M}\widetilde{x}_{k}+\mathbf{P}\widetilde{ \mathbf{U}}_{k} \tag{21}\]  
The variable \(\widetilde{x}_{k}\) is defined by Equation (13), while the other variables are as follows:  
\[\mathbf{M}=\left[ \begin{array}{c}1\\ A_{m}\\ A_{m}{}^{2}\\ \cdots\\ A_{m}{}^{N}\end{array} \right],\ \mathbf{P}=\left[ \begin{array}{cccc}0&0&\cdots&0 \\ B_{m}&\cdots&\ddots&0\\ A_{m}B_{m}&B_{m}&\vdots&\vdots\\ \vdots&\vdots&\cdots&0\\ A_{m}{}^{N-1}B_{m}&A_{m}{}^{N-2}B_{m}&\cdots&B_{m}\end{array} \right] \tag{22}\]  
The objective of designing the controller is to find the optimal transmission power sequence \(U(k)^{*}\) and to minimize the performance index \(J\) in Equation (13). To achieve this, the performance index \(J\) needs to be expressed in terms of \(\widetilde{\mathbf{U}}_{k}\) and formulated as a standard quadratic programming problem. From Equations (12), (14), (16), (17) and (21), we obtain:  
\[J=\widetilde{\mathbf{X}}_{k}^{\mathrm{T}}\overline{\mathbf{Q}}\widetilde{ \mathbf{X}}_{k}+\widetilde{\mathbf{U}}_{k}^{\mathrm{T}}\overline{\mathbf{R} }\widetilde{\mathbf{U}}_{k} \tag{23}\]  
The state weight matrix and input weight matrix is defined as:  
\[\overline{\mathbf{Q}}=\left[ \begin{matrix}Q&0&\cdots&0\\ 0&Q&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&F\end{matrix} \right],\ \overline{\mathbf{R}}=\left[ \begin{matrix}R&0&\cdots&0\\ 0&R&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&R\end{matrix}