# Research on Advancing Radio Wave Source Localization Technology Through UAV Path Optimization
## 3 Materials and Methods
### Particle Swarm Optimization (PSO)  
Particle swarm optimization (PSO) is a method proposed by [PERSON] and [PERSON] in 1995 [16]. Multiple particles are placed in the search space, and these particles  
Figure 5: Visualization of the LoS probability calculation process. The central dot represents a particle located at position \(\mathbf{u}_{i}\). Eight neighboring discrete points surrounding the particle are evaluated, with each point classified as either LoS (\(c_{k}=1\)) or NLoS (\(c_{k}=0\)). The weight \(w_{ijk}\), calculated as the inverse of the distance \(d_{ijk}\) between the particle and the \(k\)-th neighboring point, is used to compute the weighted average of LoS probabilities.  
explore the optimal solution by moving in parallel while sharing information with each other. PSO can be implemented as a relatively simple algorithm with few control parameters, and it has gained attention due to its high parallel computing capability and potential for various modifications [17]. The basic PSO algorithm is described below. Let \(\mathbf{u}\) be the parameter that determines the UAV flight path \(P\), as defined in Equation (9)  
\[\min_{\mathbf{u}}F(P(\mathbf{u})),\quad\mathbf{u}=(\mathbf{u}_{1},\ldots,\mathbf{u}_{M})\in\Gamma \tag{9}\]  
where \(\Gamma\) represents the three-dimensional space in which the UAV sensor positions can exist, and each component of \(\mathbf{u}\) is normalized such that \(0<u<1\). The positions and velocities of the particles are updated using the following equations:  
\[\mathbf{u}_{i}(t+1)=\mathbf{u}_{i}(t)+\mathbf{v}_{i}(t+1) \tag{10}\]  
\[\mathbf{v}_{i}(t+1)=w\mathbf{v}_{i}(t)+c_{1}\Big{(}\mathbf{u}_{i}^{\text{pbest}}(t)-\mathbf{u} _{i}(t)\Big{)}+c_{2}\Big{(}\mathbf{u}_{i}^{\text{gbest}}(t)-\mathbf{u}_{i}(t)\Big{)} \tag{11}\]  
where \(t\) is the current iteration number, \(\mathbf{u}_{i}^{\text{pbest}}(t)\) represents the personal best, and \(\mathbf{u}_{i}^{\text{gbest}}(t)\) represents the global best. The personal best is the particle position that has yielded the best value for a given particle up to the current iteration, while the global best is the best value among all particles' personal bests. That is, the updated velocity \(\mathbf{v}_{i}(t+1)\) is obtained by summing the current velocity \(\mathbf{v}_{i}(t)\), the velocity toward the personal best direction \(\Big{(}\mathbf{u}_{i}^{\text{pbest}}(t)-\mathbf{u}_{i}(t)\Big{)}\), and the velocity toward the global best direction \(\Big{(}\mathbf{u}_{i}^{\text{gbest}}(t)-\mathbf{u}_{i}(t)\Big{)}\), each weighted by \(w\), \(c_{1}\), and \(c_{2}\), respectively. The updated position \(\mathbf{u}_{i}(t+1)\) is then computed by adding the updated velocity \(\mathbf{v}_{i}(t+1)\) to the current position \(\mathbf{u}_{i}(t)\). This process is repeated until the objective function \(F(P(\mathbf{u}))\) falls below a predefined threshold or the maximum number of iterations \(t_{\text{MAX}}\) is reached. In this study, for comparison of localization accuracy, no threshold is set, and the process is repeated for \(t_{\text{MAX}}\) iterations. The PSO parameters used in this study are shown in Table 2.