## 3 Solution Algorithm Design
### MPC Framework
\tag{16}\]  
By substituting the \({\mathbf{u^{\prime}}}_{t}(t_{k})\) obtained from the above prediction model into the target motion model, the predicted motion state of the target \({\mathbf{x^{\prime}}}_{t}(t_{k}+h)\) at \(t_{k}+h\) can be obtained. The calculation steps of the UCAV autonomous attack guidance using the MPC framework are as follows:  
1. Initialize the motion states of the UCAV and the target, \({\mathbf{x}}_{u0}\) and \({\mathbf{x}}_{t0}\). Preset the ideal attack range \(R\) and the corresponding average velocity \(v_{m}\) of the BVR AAM. Moreover, initialize the aiming error angle and its rate of change, \(\delta_{y0}\), \(\delta_{z0}\), \(\dot{\delta}_{y0}\), and \(\dot{\delta}_{z0}\). 2. Through the prediction model in Equation (16), the predicted control vector of the target \({\mathbf{u^{\prime}}}_{t}(t_{k})\) in the next time step \(t\in[t_{k},t_{k}+h]\) and the predicted motion state of the target \({\mathbf{x^{\prime}}}_{t}(t_{k}+h)\) at \(t_{k}+h\) can be obtained. 3. Based on the motion states of the UCAV and the target at the current moment, \({\mathbf{x}}_{u}(t_{k})\) and \({\mathbf{x}}_{t}(t_{k})\), the aiming model of BVR attack fire control in Equation (8) is used to calculate the current aiming error angle, \(\delta_{y}(t_{k})\) and \(\delta_{z}(t_{k})\). Besides, \(\dot{\delta}_{y}(t_{k})\) and \(\dot{\delta}_{z}(t_{k})\) can be obtained by the variation of the aiming error angles in the last two time steps. Then, with \(\delta_{y}(t_{k})\), \(\delta_{z}(t_{k})\), \(\dot{\delta}_{y}(t_{k})\) and \(\dot{\delta}_{z}(t_{k})\) as inputs, the adaptive fuzzy guidance controller in the below is used to generate the control vector \({\mathbf{u^{\prime}}}_{u}(t_{k})=[{n^{\prime}}_{xu}(t_{k})\), \({n^{\prime}}_{yu}(t_{k})\), \({n^{\prime}}_{zu}(t_{k})]^{\rm T}\), where \({n^{\prime}}_{xu}(t_{k})\) is kept to zero during the attack guidance process. Thus the motion state of the UCAV \({\mathbf{x^{\prime}}}_{u}(t_{k}+h)\) at \(t_{k}+h\) can be obtained. 4. Based on the motion states of the UCAV and the target at the next time step, \({\mathbf{x^{\prime}}}_{u}(t_{k}+h)\) and \({\mathbf{x^{\prime}}}_{t}(t_{k}+h)\), the predicted aiming error angle information at \(t_{k}+h\), \(\delta^{\prime}_{y}(t_{k}+h)\), \(\delta^{\prime}_{z}(t_{k}+h)\), \(\delta^{\prime}_{y}(t_{k}+h)\), and \(\delta^{\prime}_{z}(t_{k}+h)\) can be obtained by the same method as the previous step. 5. If \(\delta^{\prime}_{y}(t_{k}+h)\) and \(\delta^{\prime}_{z}(t_{k}+h)\) meet the high-precision aiming condition, that is \[\sqrt{{\delta^{\prime}}^{2}{}_{y}(t_{k}+h){+}{\delta^{\prime}}^{2}{}_{z}(t_{k }+h)}\leq\delta_{\max}\] (17) where \(\delta_{\max}\) is the maximum allowable aiming error angle under high-precision aiming condition. Other than that, or the number of iteration optimization reaches a preset number \(G\). Then take \({\mathbf{u^{\prime}}}_{u}(t_{k})\) as the control vector of the current time step \(t_{k}\) to guide the UCAV. Otherwise, assign \(\delta^{\prime}_{y}(t_{k}+h)\), \(\delta^{\prime}_{z}(t_{k}+h)\), \(\dot{\delta}^{\prime}_{y}(t_{k}+h)\), and \(\dot{\delta}^{\prime}_{z}(t_{k}+h)\) to \(\delta_{y}(t_{k})\), \(\delta_{z}(t_{k})\), \(\dot{\delta}_{y}(t_{k})\) and \(\dot{\delta}_{z}(t_{k})\) in turn, and return to the Step (3). 6. If the current distance between the UCAV and the target meets the terminal constraint in Equation (13), then the calculation is finished. Otherwise, update the motion states of the UCAV and the target, and return to the Step (2).