# Microsseismic Source Location Method and Application Based on NM-PSO Algorithm
## 5 Construction of NM-PSO Algorithm  
The core idea of the NM-PSO algorithm is to perform global optimization based on the global search characteristics of the PSO algorithm. While reducing the size of the solution space, it provides an optimized initial value for the simplex algorithm; it reduces the sensitivity of the simplex algorithm to the selection of the initial value, using the fast iterative characteristics of the simplex algorithm to speed up the convergence of the model and avoid the model falling into local optimum or divergence problems.  
The NM-PSO model takes the PSO algorithm as the basic framework. After the population is initialized, the PSO algorithm is used for optimization so that the solution space is reduced in the global scope, and then the particles are sorted according to their fitness, and the first D + 1 particles are composed of Simplex, and then update the particle position through reflection, expansion, compression, etc., calculate the fitness value of each updated particle, and select the particle with the best fitness to replace the optimal particle. The D + 1 particles after simplex transformation and the remaining particles of the original population form a new population again and continue to the following iterative optimization.  
The particles with good fitness in the population can converge to the optimal solution in a relatively short time after iterative calculation of the simplex algorithm many times. The iteration speed of the remaining particles without the simplex algorithm in the solution space is relatively slow. While speeding up the solution speed and accuracy of the method can alleviate the population divergence and trap local extreme values to a certain extent.  
The source location method based on the NM-PSO algorithm needs to adopt the following steps:  
Step 1: In this step, the input data includes the three-dimensional coordinates of the sensors involved in localization, the sensor arrival time, the reflection coefficient \(\alpha\), the expansion coefficient \(\gamma\), the contraction coefficient \(\beta\), the inertia weight \(\omega\), and the initial value of the learning factor c, the number of iterations T and the overall number N of the population.  
Step 2: In this step, define the objective function of the hypocenter location.  
\[\sum_{i=1}^{n}{{\gamma_{i}}^{2}}=\sum_{i=1}^{n}{\left({t_{i}-t_{0}-\frac{{ \sqrt{{\left({x_{i}-x_{0}}\right)}^{2}+{\left({y_{i}-y_{0}}\right)}^{2}+{ \left({z_{i}-z_{0}}\right)}^{2}}}}{{v_{p}}}}\right)^{2}} \tag{24}\]  
Step 3: Initialize the population. Initialize the position and velocity of the particles, calculate the objective function value for each particle, and sort the objective function value for each particle. Record the position of the optimal particle and its function value.  
Step 4: Update the position and velocity of each particle, then calculate the fitness value of each particle according to the objective function, and update the global optimal particle and the local optimal particle.  
Step 5: Sort the updated particles according to the size of the fitness value, use the NM simplex algorithm to perform simplex transformation on the first D + 1 particles, update the D + 1 particles, and update the optimal particle's location. The remaining particles in the original population continue to update their positions and velocities and update the local optimal particles and the optimal global particles according to the fitness value of the entire population.  
Step 6: Determine whether the method satisfies the termination condition, output the result if it is satisfied, and go to Step 4 if it is not satisfied.  
The flowchart of the source location method based on the NM-PSO algorithm is shown in Figure 3.