## 2 Localization Algorithm based on Spring Model (LASM)
### Patches for the basic localization algorithm (LASM(P))
#### 2.3.1 Patch A for particles at needless point  
In some specific situations, some particles may be stable at a needless point. In this point, the total force exerted by its neighbors equals to 0 but at least one force exerted by its neighbor doesn't equal to 0, i.e., the length of one spring \(r_{ij}\) doesn't equal to the original length \(r_{ij0}\) of the spring. Compared to this point, we denote the point (that each force exerted by its neighbor equals to 0) the right point. A solution is needed to deal with this problem. However, we stress that the number of these needless points is small in the experiment shown in Section 3. It is not a large problem to find out these particles stabilizing at needless points. For each sensor node, it can obtain the distances between it and its neighbors. It can compare these distances with the lengths of springs to find out whether the sensor node is stable at needless points. After these sensor nodes (particles) have been found, the next step is to set these nodes out of the needless points. One simple method is to reinitialize the positions of these particles at random points. After this, we use the LASM(B) algorithm again to run to new positions. The particle is stable at its right point (or the localization algorithm is convergent at its right point as proved in Section 2). Therefore, if the particle runs near the true point, it will be static in the right point finally. Therefore, this simple method can solve this needless point problem. In addition, another method can solve this problem efficiently. Because a majority of sensor nodes are stable in their right positions, this information can be used to improve the precision of those particles which are at needless points. If there are at least 3 neighbor particles (in 2-D system) which are stable at right positions, the least squares algorithm can be used to derive the position of this particle which is at a needless point. \[ \begin{bmatrix}\left(x_{i}-x_{j}\right)^{2}+\left(y_{i}-y_{j}\right)^{2}={r_{i0}}^ {2}\\ \left(x_{i}-x_{k}\right)^{2}+\left(y_{i}-y_{k}\right)^{2}={r_{ik0}}^{2}\\ \vdots\\ \left(x_{i}-x_{n}\right)^{2}+\left(y_{i}-y_{n}\right)^{2}={r_{in0}}^{2}\\ \end{bmatrix}  \tag{15}\]  
where \(\left(x_{i},y_{i}\right)\) is the position to be solved, \(\left(x_{j},y_{j}\right)\),\(\left(x_{k},y_{k}\right)\),\(\cdots\),\(\left(x_{n},y_{n}\right)\) is the positions of its \(n\) neighbors (\(n\geq 3\)), and \(\left.r_{i0},r_{ik0},\cdots r_{in0}\right.\) is the distance between the particle and its neighbors. This function can be linearized by subtracting the last row:  
AX=b  
\[\text{where}\;\;A=-2 \begin{bmatrix}x_{j}-x_{n}&y_{j}-y_{n}\\ x_{k}-x_{n}&y_{k}-y_{n}\\ \vdots&\vdots\\ x_{n-1}-x_{n}&y_{n-1}-y_{n}\end{bmatrix} ,X= \begin{bmatrix}x_{i}\\ y_{i}\end{bmatrix} ,\;b= \begin{bmatrix}{r_{i0}}^{2}-{r_{i0}}^{2}-{x_{j}}^{2}+{x_{ n}}^{2}-{y_{j}}^{2}+{x_{n}}^{2}\\ {r_{ik0}}^{2}-{r_{in0}}^{2}-{x_{k}}^{2}+{x_{n}}^{2}-{y_{k}}^{2}+{x_{n}}^{2}\\ \vdots\\ r_{i(n-1)0}^{2}-{r_{in0}}^{2}-{x_{n-1}}^{2}+{x_{n}}^{2}-{y_{n-1}}^{2}+{x_{n}}^{ 2}\end{bmatrix} .\]  
This equation can be solved using a traditional least squares algorithm. \[X=\left(A\text{'}A\right)^{-1}A\text{'}b \tag{16}\]  
After the position of this particle is calculated, we consider that this position is also a right position, and also use this position to help its neighbors to calculate their positions using (16). If there are no particles which can use the second method to reinitialize the positions, the residual particles can use the first simple method to reinitialize. After these particles which are stable at needless points have been reinitialized, we can reuse the LASM(B) algorithm to obtain the positions of these nodes. Even after the LASM(B) is reused once, there may also be a smaller number of particles which are not at their right positions. We can reinitialize and reuse the LASM(B) several times to decrease the number of these particles at needless positions.