# The Optimization of UAV-Assisted Downlink Transmission Based on RSMA
## 4 Optimization Problem Solving
### Memory-Based Dynamic Artificial Fish Swarm Algorithm
\begin{array}{l}\begin{array}{l} dir_{c}=\frac{\mu_{t}\big{(}X_{1}^{\text{best}}-X_{i}^{t}\big{)}+\mu_{t-1}\big{(}X_{1}^{ \text{best}}-X_{i}^{t-1}\big{)}}{\big{|}\mu_{t}\big{(}X_{1}^{\text{best}}-X_{ i}^{t}\big{)}+\mu_{t-1}\big{(}X_{1}^{\text{best}}-X_{i}^{t-1}\big{)}}\\ \mu_{t}=\frac{\mu_{t}\big{(}X_{1}^{\text{best}}-X_{i}^{t}\big{)}+\mu_{t-1} \big{(}X_{1}^{\text{best}}-X_{i}^{t-1}\big{)}}{\big{|}\mu_{t}\big{(}X_{1}^{ \text{best}}-X_{i}^{t}\big{)}+\mu_{t-1}\big{(}X_{1}^{\text{best}}-X_{i}^{t-1} \big{)}}\\ \mu_{t}=\frac{\big{|}f\big{(}X_{i}^{t}\big{)}-f\big{(}X_{i}^{\text{best}}\big{)} \big{|}}{\big{|}f(X_{i}^{t})-f\big{(}X_{i}^{\text{best}}\big{)}\big{|}+\big{|} f\big{(}X_{i}^{t-1}\big{)}-f\big{(}X_{i}^{\text{best}}\big{)}\big{|}}\\ \mu_{t-1}=\frac{\big{|}f\big{(}X_{i}^{t-1}\big{)}-f\big{(}X_{i}^{\text{best}} \big{)}\big{|}}{\big{|}f(X_{i}^{t})-f\big{(}X_{i}^{\text{best}}\big{)}\big{|} +\big{|}f\big{(}X_{i}^{t-1}\big{)}-f\big{(}X_{i}^{\text{best}}\big{)}\big{|} }\end{array}\right.\end{array} \right. \tag{9}\]  
If condition is met, use \(X_{i}^{t+1}=X_{i}^{t}+rand[0,1]\times step_{i}^{t}*\frac{X_{j}-X_{i}^{t}}{|X_{j} -X_{i}^{t}|}\) to execute Rear-End behavior. Conversely, trying to perform Foraging behavior. In particular, the standard AFSA uses a fixed field of view and a step size, however, early in the algorithm iteration process, larger _visual_ and _step_ are required to enhance the search capability and the convergence speed, but later it need smaller _visual_ and _step_ to improve the search accuracy [25]. To address this problem, MD-AFSA designs a separate field of view as well as a step size for each artificial fish, and the field of view and step size of the artificial fish are updated after each iteration in the manner of (10) and (11), where \(t_{m}\) is the algorithm's maximum allowed number of iterations. \(step_{i}^{t}\) is the step length after \(t\) iterations. \(visual_{i}^{t}\) is the field of view after \(t\) iterations. \(sth_{i}^{\min}\) is the lower limit of the step size of artificial fish \(i\) and \(vth_{i}^{\min}\) is the lower limit of the field of view of the artificial fish \(i\). It is easy to prove that \(step_{i}^{t}\) and \(visual_{i}^{t}\) are non-increasing and will eventually reach the lower limit. \[step_{i}^{t+1}=\min\Bigg{(}\cos\Bigg{(}\frac{t\sqrt{t}}{t_{m}\sqrt{t_{m}}}*\frac {pi}{2}\Bigg{)}*step_{i}^{t}+sth_{i}^{\min},step_{i}^{t}\Bigg{)} \tag{10}\]  
\[visual_{i}^{t+1}=\min\Bigg{(}\cos\Bigg{(}\frac{t\sqrt{t}}{t_{m}\sqrt{t_{m}}}* \frac{pi}{2}\Bigg{)}*visual_{i}^{t}+vth_{i}^{\min},visual_{i}^{t}\Bigg{)} \tag{11}\]  
In addition, based on the behavioral performance of artificial fish, MD-AFSA provides an updated strategy for \(sth_{i}^{\min}\) and \(vth_{i}^{\min}\):  
1. After consecutive \(t_{th}\) iterations, if the current artificial fish view cannot capture the optimal solution after the previous iteration and no better position is found: \[\left\{ \begin{array}{l}\begin{array}{l}\widehat{sth}_{i}^{\min}=\frac{vth_ {i}^{\min}}{\widehat{sth}_{i}^{\min}}\\ \widehat{vth}_{i}^{\min}=\frac{vth_{i}^{\min}}{\widehat{sth}_{i}^{\min}}\end{array} \right.\end{array} \right.\] (12)
2. After consecutive \(t_{th}\) iterations, if the current artificial fish field of view captures the optimal solution after the previous iteration: \[\left\{\begin{array}{l}\begin{array}{l}\begin{array}{l}\begin{array}{l} \begin{array}  
In this paper, the inequality problem of UAV position is transformed into an unconstrained problem by ALM in Section 3, which is solved by MD-AFSA in this section, and the complete algorithm flow is shown in Figure 2.