## 2 The Nonlinear Least-Squares Solution of Distance Equations in UWB Positioning  
As is shown in Figure 1, we evaluate UWB sensor network positioning system based on the DW1000 module. After collecting ranging data by the positioning system, the position of the tag can be determined by solving the nonlinear distance equations. The system dealing with UWB positioning in this paper is based on TOA, the ranging measurements in these transceivers is performed based on the two-way ranging (TWR) in which the positioning system estimates the signal round-trip time (RTT) without a common time reference and eliminates the error due to imperfect synchronization [35; 36].  
The nonlinear observation model of distance equation is given as [37]:  
\[L_{i}=d_{i}(\mathbf{X})+\varepsilon_{i}\,(i=1,2,\cdots,n) \tag{1}\]  
Figure 1: The anchor (**a**) and tag (**b**) hardware devices.  
where \(\mathbf{L}=\left[\begin{array}{cccc}L_{1}&L_{2}&\cdots&L_{n}\end{array}\right]^{T}\) denotes the observation vector; \(\mathbf{X}=\left[x,y,z\right]\) is the coordinate vector of tag; \(\varepsilon_{i}\) represents the corresponding ranging random error; \(d_{i}(\mathbf{X})=\sqrt{\left(x_{i}-x\right)^{2}+\left(y_{i}-y\right)^{2}+ \left(z_{i}-z\right)^{2}}\) is the Euclidean distance, \(\left(x_{i},y_{i},z_{i}\right)\) is the known coordinate of \(i\) th anchor. \(\left(x,y,z\right)\) is the coordinate of tag.  
If the nonlinear equations are over-determined, then the nonlinear least-squares solution is to find \(\mathbf{\hat{X}}=\mathrm{argmin}_{\mathbf{X}}g(\mathbf{X})\), where \(g(\mathbf{X})=\mathbf{V}^{T}(\mathbf{X})\mathbf{V}(\mathbf{X})/2\), in which \(\mathbf{V}(\mathbf{X})=d(\mathbf{X})-\mathbf{L}\) represents the residual vector, and the least squares solution of coordinate correction can be written as:  
\[\delta\mathbf{\hat{X}}=\left(\mathbf{J}^{T}\mathbf{J}\right)^{-1}\mathbf{J}^ {T}\mathbf{V} \tag{2}\]  
where \(\mathbf{J}=\left[\begin{array}{cccc}\mathbf{e}_{1}^{T}&\mathbf{e}_{2}^{T}& \cdots&\mathbf{e}_{n}^{T}\end{array}\right]^{T}\) is the Jacobian matrix of distance equations, \(\mathbf{e}_{i}=\left[x-x_{i},y-y_{i},z-z_{i}\right]/d_{i}(\mathbf{X})\) is the direction cosine vector from the tag to the anchor.  
With a rough initial value \(\mathbf{X}_{0}\) and Equation (2), we can obtain the least squares solution by way of the Gauss-Newton method with iterations:  
\[\mathbf{\hat{X}}=\mathbf{X}_{0}+\delta\mathbf{\hat{X}} \tag{3}\]  
Considering this positioning system eliminates the clock offset, the coefficient matrix of coordinate vector of unknown point can be obtained as:  
\[\mathbf{Q}=\left(\mathbf{J}^{T}\mathbf{J}\right)^{-1}=\left[\begin{array}{ cccc}q_{11}&q_{12}&q_{13}\\ q_{21}&q_{22}&q_{23}\\ q_{31}&q_{32}&q_{33}\end{array}\right] \tag{4}\]  
The position dilution of precision (PDOP), horizontal dilution of precision (HDOP) and vertical dilution of precision (VDOP) are defined as:  
\[\left\{\begin{array}{ll}PDOP=\sqrt{q_{11}+q_{22}+q_{33}}=\sqrt{\mathrm{tr} \left[\left(\mathbf{J}^{T}\mathbf{J}\right)^{-1}\right]}\\ HDOP=\sqrt{q_{11}+q_{22}}\\ VDOP=\sqrt{q_{33}}\end{array}\right. \tag{5}\]  
Dilution of precision (DOP) describes the relationship between measure error and position determination, and it is similar to the satellite positioning. The more observations used, the smaller the DOP values and hence the smaller the solution error.