# A New Data Processing Approach for the SHPB Test Based on PSO-TWER
## 2 Related Work
### PSO-TWER Method  
In the PSO algorithm proposed by [PERSON] and [PERSON] (2004), firstly, a group of random particles (random solutions) which simulate birds in a flock are initialized. After multiple iterations, the optimal results can be found in an n-dimensional space in which the current positions of particles are recorded as \(X^{i}=\left(X^{i}_{\rm I},X^{i}_{\rm I},\cdots,X^{i}_{n}\right)\), the current renewal speeds of particles are recorded as \(V^{i}=\left(V^{i}_{\rm I},V^{i}_{\rm I},\cdots,V^{i}_{n}\right)\), and the best positions of particles ever experienced are recorded as \(P^{i}=\left(P^{i}_{\rm I},P^{i}_{\rm I},\cdots,P^{i}_{n}\right)\). The renewal speed and the position of particles can be updated by Equation (8).  
\[v_{i}=v_{i}+c_{1}\times rand()\times(\text{pbest}_{i}-x_{i})+c_{2}\times rand( ))\times(\text{gbest}_{i}-x_{i}) \tag{8}\]  
where \(v_{i}\) is the velocity of the particle, \(rand()\) is a random number between 0 and 1, \(x_{i}\) is the current position of the particles, \(c_{1}\) and \(c_{2}\) are the learning factors, pbesti is the best location currently discovered, and gbesti is the best position among all particles.  
\[x_{i}=x_{i}+v_{i} \tag{9}\]  
For the PSO algorithm, the diversity of particles is reduced in later iterations, and the optimal local phenomenon often occurs. In order to solve this problem, the inertia weight indicator is introduced to improve the algorithm.  
\[v_{i}=\omega\times v_{i}+c_{1}\times rand()\times(\text{pbest}_{i}-x_{i})+c_{ 2}\times rand())\times(\text{gbest}_{i}-x_{i}) \tag{10}\]  
where \(\omega\) is the inertia factor, which plays a role in balancing global and local searches in optimization algorithms. When \(\omega\) is large, the algorithm tends to maintain the current speed and direction, which helps to conduct a wider range of searches globally and enhance global optimization ability. On the contrary, when \(\omega\) is small, the algorithm is more likely to change the current speed and direction, which helps to conduct more precise searches in the local range ([PERSON] and [PERSON], 2004).  
The processing steps are shown in Figure 4.  
1 Initialize the particle swarm, randomly initialize the initial state of the particles in the swarm, input the inertia factor and the learning factor, and set the number of iterations (k).
2 Input the stress wave data of the incident and transmitted waves.
3 Calculate the energy ratio of the particles according to Equation (1).
4 Judge the arrival point of the incident wave and the arrival point of the transmitted wave at the position with the maximum energy ratio.
5 Take segments of the incident wave, the reflected wave, and the transmitted wave based on the starting point obtained in step (4).
6 Calculate the stress equilibrium factor at the location of the particles according to Equation (4).
7 According to Equations (7)-(9), update the individual optimal value and the global optimal value for the particle population.
8 Judge whether the number of iterations reaches the termination number (k); if so, proceed to step 1, otherwise return to step 3 to re-evaluate the particles.