# Relational Positioning Method for 2D and 3D Ad Hoc Sensor Networks in Industry 4.0
## 4 Simulations and Results
### The 2D Evaluation  
To evaluate the performance of the proposed PL searching method, and without loss of generality, we set ANs' locations in an equilateral triangle defined by ANs coordinates as follows: \(AN_{1}\)(0,0), \(AN_{2}\)(\(d\),0), \(AN_{3}\)(\(d\)\(\cos\frac{\pi}{3}\), \(d\)\(\sin\frac{\pi}{3}\)), when three ANs are available (as in Figure 1), and as in a regular square \(AN_{1}\)(0,0), \(AN_{2}\)(\(d\),0), \(AN_{3}\)(\(d\),0), \(AN_{4}\)(0,\(d\)), when four ANs are available. Nodes are deployed randomly according to a uniform pdf in the working area or space; that is, nodes' coordinates are selected as \(x\)-U(0,\(d\)) and \(y\)-U(0,\(d\)). The node to be located is also randomly selected.  
In the following analysis, we evaluate the average quadratic error of the Euclidean distance between the estimated position and the true position \(\varepsilon\), and we normalize it to the AN separation distance \(d\), which is related to ANs' coordinates and defines the size of the network scenario, i.e., \(\varepsilon/d\). Error normalization is conducted in order to relate results under different scenarios (2D and 3D) in terms of the same scenario constructive variable (associated with ANs coordinates). This is carried out in order to keep a fair comparison of performance between different scenarios.  
In the following simulations, we analyze the positioning method under different network conditions. For the 2D scenarios, we perform a basic analysis considering different values of the coverage radius \(r_{0}\) and number of nodes \(n\), in order to prove the feasibility of the method for 2D networks, and we also show that location estimation is improved when the number of ANs is increased.  
For instance, in Figure 6, we can observe the performance of the relational searching method for two different 2D scenarios with the same working area, where three and four ANs are considered. In this figure, we can see that a consistent improvement from about 7% to 18% is achieved when we increment the number of ANs from three to four. Additionally, we can see a slight improvement on the algorithm performance as we increase the number of nodes from \(n=30\) to \(n=40\), which can be explained by an expected improvement on routes obtained from ANs to the node to locate. As the hop count method is used to estimate distances, better routes may imply better distance estimations. Note that there is an increment of the normalized positioning error \(\varepsilon/d\) when the maximal transmission range \(r_{0}\) is increased from \(r_{0}=2.5\) m to \(r_{0}=5\) m. This can also be explained because worse distance estimations from ANs to the node to be located are obtained (as the hop count distance estimation is selected) when \(r_{0}\) is increased. The performance obtained for \(r_{0}=2\) m, which is worse than the performance for \(r_{0}=2.5\) m can be explained due to the low node density.  
In order to consider more realistic scenarios than those evaluated in Figure 6, the \(AN_{3}\) coordinates are modified. Note that when changing \(x_{3}\), irregular triangle scenarios are generated. In Table 2 we can observe these results in terms of the normalized localization error \(\varepsilon/d\), for different maximal transmission range \(r_{0}\), \(n=40\), and different \(x_{3}\) values. In Table 2, we can infer that the location estimation given by \(\varepsilon/d\) stays stable as the analyzed shape scenario is changed. Even more, we can find some cases in which the normalized error decreases, as better relationships might be found.  
Figure 6: Error analysis for different transmission ranges, \(r_{0}\), using three and four ANs in a 2D scenario with \(d=10\) m, \(n=30\), and \(n=40\) nodes.