# Microsseismic Source Location Method and Application Based on NM-PSO Algorithm
## 4 NM Simplex Algorithms  
The NM simplex algorithm, proposed by [PERSON] and [PERSON] in 1965, is designed to perform unconstrained optimization without using gradient information. The operation of this method rescales the simplex according to the local behavior of the function.  
To apply the NM algorithm to solve the source location problem, the following steps should be repeated:  
Step 1: InitializeIn this step, N + 1 vertices are randomly generated in the search range or space, and the practical value of the objective function is evaluated. The generated vertices are sorted according to the objective function value as follows:  
\[NM\_Population=\begin{bmatrix}X_{1}&F_{1}\\ X_{2}&F_{2}\\ \vdots&\vdots\\ X_{s}&F_{s}\\ X_{h}&F_{h}\end{bmatrix}_{(N+1)*2} \tag{18}\]  
where \(X_{i}\) is the \(i\)-th vertex, \(X_{s}\) is the vertex with the second largest objective function value, and F(s) represents the corresponding objective function. \(X_{h}\) and \(X_{1}\) are the vertices with the highest and lowest function values, respectively, while \(F_{h}\) and \(F_{1}\) represent the corresponding observed function values.  
Step 2: Mapping  
Find the centroid \(X_{c}\) of a simplex that does not contain \(X_{h}\) by Equation (10). A new vertex \(X_{*}\) is generated by mapping the worst point through Equation (11).  
\[X_{c}=\frac{1}{N}\underset{j\
eq h}{\sum}X_{j} \tag{19}\]  
\[X_{*}=(1+\alpha)X_{c}-\alpha X_{h}(\alpha>0) \tag{20}\]  
If \(F_{1}\leq F_{*}\leq F_{s}\), replace \(X_{h}\) with \(X_{*}\) and proceed to step 2.  
Step 3: Extend  
If \(F_{*}\leq F_{1}\), expand the simplex with an expansion factor \(\gamma\) greater than 1 to generate a new vertex \(X_{**}\):  
\[X_{**}=(1-\gamma)X_{c}+\gamma X_{*}(\gamma>1) \tag{21}\]  
(a) If \(F_{**}<F_{1}\), replace \(X_{h}\) with \(X_{**}\) and go to step 2.  
(b) If \(F_{**}>F_{1}\), replace \(X_{h}\) with \(X_{*}\) and proceed to step 2.  
Step 4: Shrink  
If \(F_{*}\geq F_{s}\), shrink the simplex using the shrinkage factor \(\beta\) (\(0<\beta<1\)). There are two types of shrinking rules:  
(a) If \(F_{*}<F_{h}\), generate a new \(F_{***}\) with the following formula:  
\[F_{***}=(1-\beta)X_{c}+\beta X_{*}(0<\beta<1) \tag{22}\]  
(b) If \(F_{*}>F_{h}\), generate a new \(F_{***}\) with the following formula:  
\[F_{***}=(1-\beta)X_{c}+\beta X_{h}(0<\beta<1) \tag{23}\]  
Regardless of whether step 4 (a) or step 4 (b) holds, the following two situations need to be considered:  
(c) If \(F_{***}<F_{h}\) is satisfied, \(F_{***}<F_{s}\), \(X_{***}\) replaces \(X_{h}\) and then proceed to step 2.  
(d) If \(F_{***}>F_{h}\) or \(F_{***}>F_{*}\) is satisfied, replace the size of the simplex by halving the distance from \(X_{1}\), then proceed to step 2.  
Step 5: If the stopping condition is met, exit the method; otherwise, continue to step 2.  
As a deterministic unconstrained iterative method, the NM simplex algorithm does not require derivation, the calculation is simple, and the iteration speed is fast, but it also has some shortcomings. The simplex algorithm is sensitive to the initial value. When the initial value is unreasonable or the initial range is too large, the simplex algorithm is prone to the problem that the iteration time is too long or falls into the local optimum. Even the maximum side length is long, and the simplex algorithm is prone to problems--a search degradation phenomenon with an area close to zero.