## 2 Materials and Methods
### Region Elimination Method Based on GLD Algorithm  
Let us consider the problem of iterative searching for a particular controller's gain as a problem of reducing the set range of this gain, in which the criterion of stopping the algorithm is the proximity of following solutions, i.e., the value of the cost function in subsequent solutions (for subsequent controller gains), and the convergence of the algorithm ensures the use of the mechanism based on golden-section search from [25] used in REMs. Principles and assumptions in the GLD method are similar to those in the modified Fibonacci-search method (FIB) proposed in [26]. The most important are: the unimodality assumption of optimized cost function \(f(\cdot)\), lack of knowledge about the global minimum (which gave rise to formulation of stopping criteria in the iterative tuning algorithm, e.g., given tolerance to find the minimizer), successively narrowing the range of values inside which the extremum is known to exist according to the definition (2.1) of the fundamental rule for REMs. **Definition 1**. : _Let us consider an optimization problem of a one-argument unimodal cost function \(f:\mathcal{R}\rightarrow\mathcal{R}\) within in the predefined range \(\{x^{(0^{-})},x^{(0^{+})}\}\) in initial 0 th iteration, where \(x^{(0^{-})}{<}x^{(0^{+})}\) of a unimodal function \(f\). The argument \(x\) of this function can be interpreted as a gain of controller (here: \(k_{P}\) or \(k_{D}\)), and the value of \(f\) can be understood as the \(I\) value (within some horizon) corresponded to it._  
_Now, for a pair of two arguments \(x^{(1^{-})}\)\(i\)\(x^{(1^{+})}\), which lie in the range \(\{x^{(0^{-})},x^{(0^{+})}\}\), and which satisfy \(x^{(0^{-})}{<}x^{(1^{-})}{<}x^{(1^{+})}{<}x^{(0^{+})}\), it is true that:_  
* _If_ \(x^{(1^{-})}>x^{(1^{+})}\)_, then the minimum_ \(\hat{x}^{*}\) _does not lie in_ \((x^{(0^{-})},x^{(1^{-})})\)_,_
* _If_ \(x^{(1^{-})}<x^{(1^{+})}\)_, then the minimum_ \(\hat{x}^{*}\) _does not lie in_ \((x^{(1^{+})},x^{(0^{+})})\)_,_
* _If_ \(x^{(1^{-})}=x^{(1^{+})}\)_, then the minimum_ \(\hat{x}^{*}\) _does not lie in_ \((x^{(0^{-})},x^{(1^{-})})\) _and_ \((x^{(1^{+})},x^{(0^{+})})\)_._  
A region elimination fundamental rule is used to find the \(\hat{x}^{*}\) with the minimum value of \(f\) within predefined range, based on repeatedly selection of two arguments from the current range according to symmetrically reduction the range of possible arguments:  
\[x^{(1^{-})}-x^{(0^{-})}=x^{(1^{+})}-x^{(0^{+})}=\rho(x^{(0^{+})}-x^{(0^{-})}), \tag{6}\]  
where \(\rho=\frac{3-\sqrt{5}}{2}=0.381966\) is a golden-search reduction factor. **Remark 5**. : _An advantage of using the golden-search reduction factor (according to Algorithm 1) is the fast exploration of the interval, because following values of \(x\) (controller gains) are selected to use one of the values of the cost function calculated in the previous iteration. For this purpose, the interval is divided regarding the golden ratio. As a result, of the use of the golden-search reduction factor for a given interval, two new sub-intervals are obtained. For the new intervals, the ratio of the longer length to the shorter length is equal to the ratio of the length of the divided interval to the length of the longer interval._  
_Due to this mechanism, and by using the golden-search reduction factor, the time of range exploration is shortened (through the reduction the number of points for which \(f\) function needs to be evaluate) or alternatively the \(f\) function values can be averaged for the same \(x\) in following iterations, i.e., \(x^{((k+1)^{+})}\) and \(x^{(k^{-})}\), which is useful in order to reduce the impact of measurement disturbances during the UAV outdoor flight._  
Based on predefined initial range \(x\in\mathcal{D}^{(0)}=\left[x^{(0^{-})},\ x^{(0^{+})}\right]\), the golden-search algorithm can be implemented according to the pseudo-code presented below (Algorithm 1). ```
Step 1.