# Maximization of Average Achievable Rate for NOMA-UAV Dual-User Communication System Assisted by RIS
## 6 Numerical Results  
The following are the settings for the simulation parameters. The ground users is located at \(L_{G1}=[800,70]^{T}\) and \(L_{G2}=[700,70]^{T}\), respectively. And the RIS is positioned at \(L_{R}=[500,0]^{T}\), with the RIS standing at a height of \(Z_{RIS}=40\) m. For the UAV, its flight altitude remains constant at \(Z_{UAV}=80\) m, starting from the position \(q_{s}=[0,20]^{T}\) and concluding its journey at \(q_{e}=[1000,20]^{T}\). The parameter settings are as follows: In the current configuration, both the ground users and the UAV each have one antenna. The Rician factor is \(\sigma=3\) dB. The remaining parameter settings are \(V_{m}=30\) m/s, \(c_{0}=-20\) dB, \(J=K=300\), \(\delta=1\) s, \(\alpha=3.5\), \(\kappa=2\), \(\tau=2.8\), \(d=\frac{\lambda}{2}\), \(P_{max}=100\) mw, \(\xi^{2}=-80\) dBm. For Algorithm 1, the threshold value of \(\epsilon\) is established at \(10^{-4}\). We set the maximum number of iterations to 20.  
We demonstrate the simulation findings acquired through implementing our devised algorithm (abbreviated as OT&OP&OW). For the purpose of comparative analysis, we introduce three additional benchmark algorithms. The trajectory optimization design that also optimizes phase shifts (abbreviated as OT&OP), aiming to find the optimal trajectory while considering phase-shift optimization. The initial trajectory design that optimizes phase shifts (abbreviated as T&OP), aiming to enhance signal performance through phase adjustment. The power optimization design with optimized phase shifts (abbreviated as OW&OP), which focuses on optimizing power allocation while adjusting phase shifts. The initial trajectory design based on random phase (abbreviated as T&RP), where the phase values are randomly assigned. If the duration is sufficiently long, the UAV follows the initially planned trajectory. However, if the available time is limited, the UAV will deviate from the set trajectory and proceed directly to the endpoint at maximum speed.  
Initial feasible solutions for the OT&OP&OW, OT&OP, and OW&OP algorithms are generated using the T&RP algorithm. These initial solutions act as a starting point for further optimization. During the flight cycle, the initial power values for these algorithms are randomly generated, with the condition that the power of \(P_{1}\) exceeds that of \(P_{2}\).  
In Figure 2, we look at the UAV's initial trajectory and optimized trajectories, with number of array elements \(M\) varying. This helps us see how \(M\) impacts the UAV's flight path. The UAV initially chooses to hover over User 2 to achieve the maximum average rate and flies directly to User 2. As the quantity of RIS array elements rises, the UAV's trajectory bends and gradually shifts towards the RIS position in the middle. When the RIS array elements are sufficient, the UAV will hover between RIS and User 2.  
Figure 2: UAV Trajectories: Initial and optimized for different \(M\).  
Figure 4: Theaverage achievable rate at different maximum power \(P_{max}\) when the number of RIS array elements is \(M=8\times 8\).