Prediction and positioning of UWSN mobile nodes based on tidal motion model

As the node positioning of underwater wireless sensor networks is easily affected by tidal motion, ocean current motion and multipath effect, the node positioning accuracy is low. In order to better improve the positioning accuracy of moving nodes of underwater wireless sensor networks, a method of locating mobile nodes of underwater wireless sensor based on tidal motion model is proposed. Firstly, the Time Difference of Arrival (TDOA) localization optimized by niche genetic algorithm is used to initialize each node. The integration of niche technology can effectively find multiple excellent solutions in the solution space, thus providing more abundant solution choices. This algorithm has excellent performance in multi-modal optimization problems, and can avoid the algorithm falling into local optimal solutions, so as to obtain more comprehensive optimization results. The simulation results show that the proposed algorithm has better positioning accuracy than the traditional Chan algorithm and Taylor algorithm. Then, each node is updated in real time by the optimized tidal movement model formula predicted by Kalman filter algorithm. The prediction algorithm is used to compare the real-time predicted update position of the node with the actual position. The positioning distance error of the prediction algorithm is also enough to meet the practical application requirements.


Related works
Zhang et al. 4 proposed a node Mobility Prediction Localization (MPL) algorithm for UWSN.They used a hierarchical optimization strategy and node position prediction to design the localization algorithm, which first selects a buoy node as the initial node and periodically broadcasts ranging requests.The node receives the request and determines the node location through TOA.The node then predicts the speed and position of the node at this time according to the speed at the previous time.At the same time, the GWO algorithm is used to optimize the secondary nodes, so as to optimize the node position and improve the positioning accuracy of the node.However, if the node is affected by unexpected water flow or other factors, the accuracy of prediction may decrease.Chizari 5 , Saeed 6 and Liu 7 et al. proposed a Approximate Convex Decomposition Localization (ACDL) algorithm, which uses beacons to assist localization and can move vertically.The location is obtained by communicating with the GPS of the surface buyable, and then the location of different depths is broadcast to reduce the communication distance, so as to expand the positioning coverage.However, if the nodes in the network move or a new node join, the original convex decomposition may not be effective anymore, and the algorithm needs to be executed again, which may increase additional computational overhead.Wu et al. 8 proposed a Scalable Localization with Mobility Prediction (SLMP) algorithm.The whole process of the algorithm is divided into anchor node localization and ordinary node localization.When the anchor node is located, it directly communicates with the water surface to realize self-localization.In the localization of ordinary nodes, the movement pattern of this node is inferred from the neighboring nodes and its position is predicted through the spatial correlation of underwater movement characteristics.This algorithm maintains a high localization coverage rate, but the maximum likelihood estimation method has a certain error in calculating the node coordinates, resulting in low localization accuracy.Lv et al. 9 proposed that the positioning result of Chan algorithm in Ultra Wide Band (UWB) was used as the initial value of Taylor algorithm, which ensured the convergence and computational efficiency of Taylor algorithm.The positioning compensation error was obtained through the preset body length of monorail crane and double tag positioning data, and the error was replaced into Taylor algorithm to further improve the positioning accuracy.However, the weighted C-T fusion algorithm and Unscented Kalman Filter (UKF) optimization processes mentioned in this paper are relatively complex and may require high computational resources and processing power, which may lead to real-time problems in practical applications.Zhang et al. 10 proposed a multi-step localization strategy based on Mobility Prediction and Particle Swarm Optimization (MP-PSO).Firstly, the range-based PSO algorithm is used to calculate the anchor node's immediate velocity by obtaining the localization results of the anchor node at two times, and then the velocity of the unknown node is estimated by combining the spatial correlation of the underwater object.The energy consumption of the algorithm is considered to significantly reduce the average communication cost of the network through the mobility prediction scheme.However, the positioning of ordinary nodes depends on the accurate positioning and prediction of anchor nodes, and the robustness of the algorithm is insufficient.Yan et al. 11 proposed the application of Chan algorithm in the field of maritime sound source localization, which uses an efficient non-iterative localization method and solves the Time Difference Of Arrival (TDOA) equations by the least square method, which is suitable for maritime sound source localization and has high positioning accuracy and computational efficiency.However, the ill-conditioned matrix problem may be encountered under specific conditions, which affects the accuracy and stability of positioning results.Jiang et al. 12 proposed a joint localization method based on Taylor weighted least squares algorithm.The position and velocity of the target were initially estimated by the weighted least squares method, and then the Taylor expansion was used for iterative optimization until it approached the Cramer-Rao bound, which improved the localization accuracy in low noise conditions, but the performance may decline in high noise environments.Li et al. 13 proposed a new short-wave TDOA positioning algorithm based on joint optimization of genetic algorithm.By jointly optimizing ionospheric reflection virtual height and target position through genetic algorithm, accurate positioning can be achieved without ionospheric parameter information, but more iterations are needed to ensure accuracy when ionospheric conditions change greatly.Based on the above research, in order to further accurately locate the underwater mobile nodes and reduce the communication overhead, this paper proposes an underwater environment based on the tidal movement model 14 and uses the niche genetic algorithm 15 to improve the TDOA positioning algorithm to initialize the position of the node.Then Kalman Filter (KF) algorithm 16 is used to predict and update the model parameters, and the position of each node is predicted, which effectively improves the positioning accuracy, reduces the energy consumption of the node and prolongs the lifetime of the node.

Tidal movement model
Tidal motion models are mathematical models used to describe tidal phenomena on the earth.Tides are periodic fluctuations in the ocean caused by gravitational interactions.The goal of tidal motion models is to predict and explain the occurrence and change of tides.In the offshore area, the main factor affecting the location accuracy of nodes is tidal movement.The physical model of tidal movement is shown in Fig. 1: The sea rises during the day and at night, with high tides and low tides.The mathematical expression of the tidal movement model is as follows: In the formula, x represents the position parameter, v represents the velocity at time t at the x position, N represents the number of tidal components, cos(w i t) and sin(w i t) represent the time base function of the tidal components at frequency w i , and v 0 (x) represents the average velocity of the ocean current during the sampling interval.p i (x) and q i (x) are both position-dependent functions.
(1) v(x, t) = v 0 (x) Considering that the node motion caused by tidal motion is nonlinear, and the motion perpendicular to the direction of water flow is a finite damping motion, and considering that the Gaussian radial basis function has small error and high smoothness, the Gaussian radial basis function is adopted as the spatial basis function 17 .In Eq. (1), v 0 (x), p i (x) and q i (x) can be expressed as: In the above equation, μ i,j is the coefficient of the Gaussian radial basis function, M represents the number of Gaussian radial basis functions, c j is the center position of the jth Gaussian radial basis function, σ represents the width of the Gaussian radial basis function.Substituting Eqs.(2), (3) and (4) into Eq.(1) yields: It can be seen from the above formula that by inputting the position information of the node at time t, the velocity of the node at time t is output.The result calculated by this formula is closely related to the Gaussian radial basis function coefficient (μ i,j ) and the center position of the jth Gaussian radial basis function (c j ).For the anchor node, M points are randomly selected as the center of the Gaussian radial basis function in the communication region of the anchor node.For ordinary nodes, the position of the received anchor node is taken as the center position of the Gaussian radial basis function, and then Kalman filter algorithm is used to predict and optimize the Gaussian radial basis function coefficient (μ i,j ).Thus, the node motion equation can be updated in real time. (2)

Kalman filter algorithm prediction and optimization
In order to use the Kalman filtering algorithm to predict and optimize the coefficient of the motion model µ i,j , assuming that the positioning period of the node is P , t k = k × P then Eq. ( 7) can be rewritten as: Taylor expansion of cos(w i kP) and sin(w i kP) yields the following equation: T , the state equation of Kalman filtering algorithm can be expressed as: T represents the noise error at time t, assuming w(k) is Gaussian white noise, its mean is 0, and the covariance matrix is known.
The observation equation of Kalman filter algorithm is as follows: where represents the observed noise with Gaussian distribution, whose mean value is 0 and whose covariance matrix is known.
According to the observation equation and state equation of Kalman filter algorithm, the optimal state estimation of matrix γ can be obtained, and the specific calculation process is as follows: According to Eq. ( 11), the state of γ at the next time can be predicted: The γ k−1|k−1 in the above formula represents the optimal value of γ at time (k − 1)P.
The error estimation of the covariance matrix can be expressed as: Q(k) in the above equation represents the covariance matrix of Gaussian white noise w(k).Kalman gain can be expressed as: The R(k) in the above formula represents the covariance matrix of the observed noise δ(k) following the Gaussian distribution.
The covariance matrix is then updated by the following formula: Finally, the optimal value of γ at time kP is: Thus, the optimal value of the next γ at each time can be predicted, and the optimal value of the motion model coefficient µ i,j (k) can be obtained by the following formula: where β k = [1, cos(w 1 kP), sin(w 1 kP), • • • cos(w N kP), sin(w N kP)] , the optimal value prediction of γ and µ i,j at each time can be obtained from the above equation, and the node can update the position of the node in real time by obtaining the speed of the node at a certain time according to the formula (7) and (8).

Initial node position estimation
The underwater node communication model is shown in Fig. 2.
If BS 1 is selected as the service base station, the distance difference between MS to BS i ( i = 1 ) and to BS 1 is recorded as is the measurement result of TDOA, v is the propagation speed of underwater sound, which is designed in this paper as 1500 m/s, n i,1 is the process noise, which is Gaussian white noise subject to normal distribution.Based on the above definition, it can be obtained: T , the coordinate position of MS is calculated using maximum likelihood estimation.Since vt i,1 is a known quantity and n follows a normal distribution with a mean of 0 and a variance of σ 2 , all elements in − → R follow a normal distribution with a mean of R i,1 and a variance of σ 2 .Thus, the cor- responding likelihood function can be expressed as:  www.nature.com/scientificreports/ , the coordinates that make the maximum likelihood estimate the maximum probability are obtained, namely: The formula contains a very complex nonlinear function, which is difficult to be solved by the traditional derivation method.Since genetic algorithm has no specific requirements on the optimization function, this method is used to find the optimal solution in the whole solution space.In order to prevent the genetic algorithm from falling into a local optimal solution and unable to search for a better solution, the niching technology is introduced to prevent the algorithm from falling into a local optimal situation due to incomplete optimization.

Niche genetic algorithm (NGA)
Genetic algorithm Genetic Algorithm (GA) is an optimization algorithm inspired by the principles of heredity and evolution in biology.It simulates the process of selection, heredity and variation in biological evolution to achieve the improvement of individual adaptability for problem solving optimization and search.The basic idea is to gradually improve the solution by simulating the evolutionary process.Compared with traditional optimization algorithms, it has the characteristics of non-determinism, self-organization, self-adaptability and self-learning.When chromosomes combine, the combination of genetic factors of both parents allows the child to maintain the characteristics of the parent, and the mutation operation causes the offspring to differ from the parent.

Niching technology
Niche technology is an optimization algorithm inspired by the concept of niche in ecology.It simulates the niche distribution and competitive behavior of organisms in nature for solving complex optimization problems.In niche technology, the solution space is viewed as an ecosystem where each solution corresponds to an ecological niche.Each niche has its own specific organizational function, similar to how organisms occupy specific habitats in nature.These niches compete with each other while maintaining a certain distance from other niches to maintain population diversity and prevent local convergence.The goal of niche technology is to discover multiple excellent solutions by maintaining and protecting different ecological niches while searching in different ecological niches.By introducing fitness sharing mechanism, it divides similar solutions into the same niche and competes and evolves within each niche.The basic principle of niche technology is to divide the solutions in a population into different niches based on the similarity or distance between the solutions.Within each subset, the solutions compete and evolve to select the best solution and generate new solutions.Fitness sharing mechanism enables each niche to maintain a certain diversity, and excellent solutions can be better protected and inherited.By maintaining multiple niches, niches technology is able to find multiple good solutions in the solution space, thus providing a richer choice of solutions.It performs well in multi-modal optimization problems and can avoid falling into local optimal solutions, so as to obtain more comprehensive optimization results.

Algorithm step
Niche technology is introduced into genetic algorithm to form niche genetic algorithm.Its basic idea is as follows: the distance between individuals is first set to D. If the distance between the two individuals is less than D, a penalty function will be assigned to the individual with less fitness to reduce the genetic probability of the individual in the future.In this way, only one excellent individual can be maintained within D, thus avoiding the problem of local optimality caused by excessive closeness of the excellent individuals.The global optimization capability of genetic algorithm is improved, and its basic steps are as follows: (1) Individual coding, binary coding chromosome vector (x, y) T , x, y represents the possible coordinates of the mobile station.(2) Set the optimized algebra g, randomly generate Q initial individuals to form the initial population, and calculate the fitness of each individual.The fitness function is as follows: The larger the individual value, the higher the fitness of the individual.The value of the individual is arranged in descending order, and the first U better individuals are retained.
(3) The roulette strategy is used to ensure that the probability of an individual being selected is proportional to the value of Fit.(4) Using uniform crossover, randomly generate a binary number that is the same number as the individual code, and select the parent gene according to the value at its corresponding position.(5) The method of random variation is adopted to replace the original gene value of the chromosome with a small probability. ( Vol.:(0123456789) Where i-1 represents the dimension of each indi- vidual, x a and x b represent the eigenvectors of individuals a and b .When d ab < D , a penalty function is assigned to individuals with low fitness in individuals x a and x b to reduce fitness, and U individuals with high fitness in the new population are selected to update the niche radius D, whose update rule is the ratio of the average distance between all individuals and algebra.(7) If the preset termination condition is not met, the first Q individuals in step ( 6) are selected to be transferred to step (3), and then the algorithm is iterated until the termination is met, the estimated coordinates are output, and the algorithm is ended.The algorithm flow is shown in Fig. 4:

Time complexity analysis of the algorithm
For the Niching Genetic Algorithms-Kalman Filter prediction (NGA-KF) algorithm, if the computational complexity of the fitness function is O(f) during the initialization and localization stage of niche genetic optimization TDOA, the time complexity at this stage is O(Q*(i − 1)*g + f*Q^2).In the prediction stage using Kalman filter optimization, the time complexity mainly depends on the calculation of the state equation and observation equation, and the algorithm complexity is O(M^2).Therefore, the time complexity of the entire algorithm is For the MP-PSO algorithm, the PSO algorithm is used for two-dimensional localization during the anchor node localization stage, with a time complexity of O(2*Q*g).In the unknown node localization stage, it depends on the speed and movement prediction of the anchor node, and the time complexity is consistent with the anchor node localization stage.Therefore, the time complexity of the entire algorithm is O(2*n*Q*g).
For the MPL algorithm, the time complexity for locating secondary nodes during the optimization of TOA positioning using GWO algorithm is O(Q*g).The time complexity in the mobile prediction stage is related to the size of the prediction window and the number of nodes, and its time complexity is O(n*kP).Therefore, the time complexity of the entire algorithm is O(n*(Q*g + kP)).
For the SLMP algorithm, the future position of anchor nodes is predicted using temporal correlation based on underwater mobility characteristics during the anchor node positioning stage, with a time complexity of O((0.2n)^2*g).In the ordinary node positioning stage, the position is predicted based on the information of its neighboring nodes, with a time complexity of O(0.8n*M).Therefore, the time complexity of the entire algorithm is O((0.2n)^2*g+ 0.8n*M).

Analysis of initial node positioning
In this paper, the accuracy of the positioning algorithm is verified by Matlab simulation platform.The depth of the node is obtained by the pressure sensor of the node.The three-dimensional problem is transformed into a two-dimensional problem, and the area of 1000 × 1000 is taken to simulate the tidal environment.When 100 nodes are deployed in the monitoring area, including 80 unknown nodes and 20 anchor nodes, the communication radius of nodes is 200 m, and the underwater acoustic communication speed is 1500 m/s, the population number of the NGA algorithm is set to 100, and The optimization algebra is 60 times, crossover rate p c = 0.5 , mutation rate p m = 0.05 , and penalty parameter penalty = 10 −7 .TDOA improved by NGA algorithm was used to initialize node positioning, and the positioning results were shown in Fig. 5.
Blue "-" indicates the positioning error of the unknown node (connecting the estimated position and real position of the unknown node).The positioning error of the above figure is 0.20915 according to the simulation platform.
In order to determine whether the NGA algorithm can effectively improve the positioning accuracy of nodes, the simulation experiment mainly observes the influence of the proportion of anchor nodes and the communication radius on the average positioning error, and the average positioning error is calculated using the following formula: In the formula, (x i , y i ) represents the real position of the node, (x ′ i , y ′ i ) represents the estimated position of the node, and n represents the number of unknown nodes.In order to make the experimental effect have a better comparison effect, the traditional Chan algorithm and Taylor algorithm are selected for comparison test, and then the test results are analyzed.

Effect of anchor node ratio on positioning accuracy
The 100 wireless sensor nodes are randomly arranged in the area to be monitored, the communication radius of the nodes is set to 300 m unchanged, and the proportion of anchor nodes is 5%, 10%, 15%, 20%, 25%, 30% and 35%, respectively.The simulation results are shown in Fig. 6.
As shown in the figure above, with the increasing proportion of anchor nodes, the average positioning errors of the four algorithms are gradually decreasing.According to the implementation steps of niche genetic algorithm TDOA, increasing the number of anchor nodes can provide more measurement data for the algorithm, increase multiple time difference combinations, and reduce the shadow of multi-path effects in underwater environment, which can reduce positioning errors and improve the robustness of measurement.At the same time, it is not difficult to see from the figure above that when the proportion of anchor nodes is 20%, the average positioning error is as follows in order from large to small: Chan algorithm, Taylor algorithm, NGA algorithm and GA algorithm, which indicates that the positioning accuracy of NGA algorithm is better than the other three traditional algorithms when the number of anchor nodes is certain.Under the same proportion of anchor nodes, the average positioning error of NGA algorithm is reduced by 12.32% and 10.08% compared with the traditional Chan algorithm and Taylor algorithm, reduced by 4.18% compared with GA algorithm.

Influence of communication radius on positioning accuracy
Randomly arrange 100 nodes in the area to be monitored, set the proportion of anchor nodes to 20%, and increase the communication radius from 200 to 500 m.The simulation results are shown in Fig. 7.
As can be seen from the figure above, the average positioning error of nodes decreases with the increase of communication radius.When the communication radius is unchanged, the average positioning error of NGA is significantly lower than that of the other three algorithms.When the communication radius is greater than 300 m, the average positioning error of the node tends to change gently, so in order to save node energy and extend the average life of the node, it is not appropriate to consume too much communication energy, and the appropriate communication energy should be used to pursue the improvement of positioning accuracy.Under the same small communication radius condition, the average positioning error of NGA algorithm is reduced by 10.81% and 7.88% compared with the traditional Chan algorithm and Taylor algorithm, reduced by 2.12% compared with GA algorithm.www.nature.com/scientificreports/It can be seen from the above figure that when the node density continues to increase, the average positioning error has a decreasing trend.Compared with MPL 4 , MP-PSO 10 and SLMP 8 algorithms, the average positioning error of NGA-KF algorithm is smaller.Compared with the above three algorithms, the positioning error is reduced by 16%, 32%, 39% respectively.With the increase of node density, the number of nodes that provide known information for ordinary nodes increases, including the number of Gaussian radial basis functions (M), which improves the accuracy of node positioning.

Conclusion
On the basis of traditional TDOA positioning algorithm, combining genetic algorithm and niche technology, a niche genetic algorithm optimized TDOA positioning is proposed.Through simulation experiments, the positioning accuracy of this positioning algorithm has obvious advantages compared with GA algorithm, Chan algorithm and Taylor algorithm.Considering that nodes in underwater environment are vulnerable to the influence of tidal movement and thus reduce the positioning accuracy, Kalman filter algorithm is introduced to predict and optimize the tidal motion model formula to predict and estimate the next moment position of nodes in real time, thereby increasing the robustness and positioning accuracy of positioning.The prediction distance error of this algorithm is sufficient to meet the needs of engineering applications.
14:15185 | https://doi.org/10.1038/s41598-024-65201-2TDOA algorithm TDOA positioning can also be called hyperbolic positioning, its basic principle is a time difference positioning technology, the signal source sends signals, multiple receivers (at least three) receive signals in their respective positions, each receiver receives signals at different time points, record these time points.The relative position of the signal source relative to the different receivers can be calculated by comparing the time difference between the different receivers to receive the signal, and the absolute position of the signal source can be calculated by the relative position of at least three receivers.Its positioning principle diagram is shown in Fig. 3: First, define the coordinates of MS as (x, y) , and the coordinates of

Figure 6 .
Figure 6.Relationship between the proportion of anchor nodes and the average positioning error.

Figure 7 .
Figure 7.The relationship between communication radius and average positioning error.
(6)Combine the first U individuals with high fitness and the individuals obtained after mutation to obtain a new population containing Q + U individuals, and calculate the distance between each individual in the new population: Scientific Reports | (2024) 14:15185 | https://doi.org/10.1038/s41598-024-65201-2www.nature.com/scientificreports/