# Midspan Deflection Prediction of Long-Span Cable-Stayed Bridge Based on DIWPSO-SVM Algorithm
## 2 DIWPSO-SVM Algorithm
### DIWPSO Algorithm  
The particle swarm optimization (PSO) algorithm is a kind of bionic evolutionary computing technology based on bird flock foraging. Its basic idea is to complete the search for optimal solutions through collaborative foraging and information exchange between individuals in the flock, which has the characteristics of a swarm intelligence stochastic search [30]. The basic principles of PSO algorithms are as follows. Firstly, a particle with only two attributes of position (\(x\)) and velocity (\(v\)) is assumed in the \(D\)-dimensional vector space to simulate the bird population, in which the velocity attribute represents the individual's movement speed, and the position attribute represents the individual's movement direction. All the particles search for the optimal solution individually in the \(D\)-dimensional search space and mark it as the individual's extreme value; the particles share the information of each other's extremes to compare the optimal solution and update their own movement speed and movement direction at the same time. The position vector of the \(i\)-th particle is \(X_{i}=[X_{i1},X_{i2},\ldots,X_{iD}]^{T}\), and the velocity vector is \(V_{i}=[V_{i1},V_{i2},\ldots,V_{iD}]^{T}\); then, the velocity and position updating rule of the standard particle swarm algorithm is shown in Equations (8) and (9):  
\[V_{i}^{n+1}=\omega V_{i}^{n}+c_{1}r_{1}(P_{i}^{n}-X_{i}^{n})+c_{2}r_{2}(G^{n}- X_{i}^{n}) \tag{8}\]  
\[X_{i}^{n+1}=X_{i}^{n}+V_{i}^{n+1} \tag{9}\]  
where \(\omega\) is the inertia factor, the value of which determines the focus of the algorithm on global and local optimization; \(P_{i}^{n}\) is the individual extreme value of the \(i\)-th particle at the \(n\)-th iteration; \(G^{n}\) is the global extreme value of the population at the nth iteration, where the particles update their velocity and position by keeping track of the individual extreme value and the global extreme value; \(c_{1}\) and \(c_{2}\) are the learning factors; and \(r_{1}\) and \(r_{2}\) are random numbers in [0, 1]. Generally, the standard PSO algorithm performance is not stable; there are defects of a slow convergence speed, or the standard PSO algorithm might be caught in the local extreme value. This study adopts the improvement method of dynamic inertia weight (DIW) to balance the ability of the PSO algorithm to develop globally and locally search for the optimal [10]. According to the average aggregation degree and the maximum aggregation degree of the particle swarm in Equations (10) and (11), the rate of change in the aggregation distance (\(k\)) of the particle swarm could be defined as shown in Equation (12). \[Dist_{ave}=\frac{1}{m}\big{(}\sum_{i=1}^{m}\sqrt{\sum_{j=1}^{D}(G^{n}-P_{i}^{n} )^{2}}\big{)} \tag{10}\]  
\[Dist_{max}=\max_{i=1,2,\ldots,m}(\sum_{j=1}^{D}(G^{n}-P_{i}^{n})^{2}) \tag{11}\]  
\[k=(Dist_{ave}-Dist_{max})/Dist_{max} \tag{12}\]  
where \(m\) is the number of particles in the particle swarm population. The variation rule of inertia weight (\(w\)) is shown in Equation (13). \[w= \begin{cases}(\gamma_{1}+\frac{|rand()|}{2})|lnk|,&|k|>1\\ (\gamma_{1}\gamma_{2}+\frac{|rand()|}{2}),&0.05\;<|k|<1\\ (\gamma_{1}+\frac{|rand()|}{2})\frac{1}{|mk|},&|k|<0.05\end{cases}  \tag{13}\]where \(\gamma_{1}=0.3\), \(\gamma_{2}=0.2\), \(rand()\) is a random number obeying a uniform distribution in \([0,1]\). Through Equation (13), the PSO algorithm can take the value of inertia weight (\(w\)) at the right time according to the current optimization searching situation, which demonstrates the dynamic adjustment ability of the PSO algorithm to the global search and local development. When the parameter (\(k\)) is larger, the maximum spacing in the particle swarm is much larger than the average spacing of the particle swarm, indicating that the aggregation degree of the particle swarm is higher and the global search ability is insufficient. On the contrary, when the parameter (\(k\)) is smaller, the inertia weight needs to be adjusted to strengthen the algorithm's local development ability.