# Research on Optimization of Target Positioning Error Based on Unmanned Aerial Vehicle Platform
## 4 Error Synthesis and Distribution
### Assigning Errors Using Improved Dung Beetle Optimization Algorithm
#### 4.2.2 Dung Beetle Optimization Algorithm  
If the error standard deviation needs to be optimized, i.e., the objective function composed of this variable is minimized, the originally complex error allocation problem can be abstracted into a mathematical problem of parameter optimization. Therefore, this study introduces an improved dung beetle optimization algorithm as an efficient solution strategy, with the aim of optimal error allocation. The dung beetle optimization algorithm is inspired by the biological behavior of dung beetles, and it has the advantages of strong optimization and a fast convergence speed. The principle of the original dung beetle algorithm is briefly described as follows:  
(1) Ball rolling behavior: When there is no obstacle in front of the dung beetle, it will use the sun to navigate when rolling a dung ball. The position updating formula for the dung beetle's ball rolling is shown in Equation (19):  
\[ \begin{split} p_{i}(t+1)=p_{i}(t)+a\times k\times p_{i}(t-1)+b \times\Delta p\\ \Delta p=|p_{i}(t)-P^{w}|\end{split}  \tag{19}\]  
where \(t\) denotes the current number of iterations; \(p_{i}(t)\) represents the position of the \(i\)-th dung beetle after \(t\) iterations; \(a\) stands for the natural coefficient (there is no deviation when \(a=1\), but there is deviation from the original direction when \(a=-1\)); \(k\) is the deflection coefficient, which has a constant value of \(b\in(0,1)\); \(\Delta x\) simulates the change in light intensity; and \(P^{w}\) is the global worst position. (2) Dancing behavior: When the dung beetle encounters an obstacle and is unable to travel, it dances to reposition itself, and this is represented as Equation (20). \[p_{i}(t+1)=p_{i}(t)+\tan(\theta)|p_{i}(t)-p_{i}(t+1)| \tag{20}\]  
where \(\theta\) represents the deflection angle, which takes the value \([0,\pi]\). (3) Reproductive behavior: In order to provide a safe environment for their offspring, dung beetles select suitable spawning sites. The area boundary selection strategy for simulating dung beetle spawning is shown in Equation (21). \[ \begin{array}{l}Lb^{*}=\max(P^{*}\times(1-R),Lb)\\ Ub^{*}=\min(P^{*}\times(1+R),Ub)\end{array}  \tag{21}\]  
where \(Lb^{*}\) and \(Ub^{*}\) denote the lower and upper bounds of the spawning region, respectively, and \(P^{*}\) represents the current local optimal position. \(R=\frac{1-t}{I_{\max}}\); \(T_{\max}\) represents the set maximum number of iterations; and \(Lb\) and \(Ub\) denote the lower and upper bounds of the optimization problem. As the number of iterations increases, the spawning region is dynamically updated, as shown in Equation (22). \[T_{i}(t+1)=P^{*}+k_{1}\times(T_{i}(t)-Lb^{*})+k_{2}\times(T_{i}(t)-Ub^{*}) \tag{22}\]  
where \(T_{i}(t)\) denotes the position of the \(i\)-\(th\) dung beetle egg at the \(t\) iteration; \(k_{1}\) and \(k_{2}\) represent random vectors of size \(1\times D\), and \(D\) denotes the dimension of the optimization problem. (4) Foraging behavior: Grown dung beetles will burrow out of the ground to forage for food, so they must determine the optimal area. The boundaries of the optimal area are defined as shown in Equation (23). \[ \begin{array}{l}Lb^{b}=\max(P^{b}\times(1-R),Lb)\\ Ub^{b}=\min(P^{b}\times(1+R),Ub)\end{array}  \tag{23}\]  
where \(P^{b}\) represents the global optimal foraging position, and \(Lb^{b}\) and \(Ub^{b}\) denote the lower and upper bounds of the optimal foraging area, respectively. The position of a small dung beetle is updated, as shown in Equation (24). \[p_{i}(t+1)=p_{i}(t)+k_{3}\times(p_{i}(t)-Lb^{b})+k_{4}\times(p_{i}(t)-Ub^{b}) \tag{24}\]  
where \(k_{3}\) and \(k_{4}\) represent two independent random numbers, with the former obeying a normal distribution and the latter taking values ranging from 0 to 1. (5) Stealing behavior: Dung beetles will steal dung balls from others, and this is represented as Equation (25).