# Improving Particle Swarm Optimization Analysis Using Differential Models
## 3 Numerical Algorithm Analysis of Standard PSO
### Introduction to Common Numerical Methods of Differential Equations  
The commonly used numerical calculation methods for solving the initial value problem of ordinary differential equations can be divided into the single- and multi-step method. The single-step method mainly includes the [PERSON] method, the Runge-Kutta method, and the multi-step method includes the [PERSON] method. In order to facilitate the application, the commonly used numerical calculation methods will be briefly introduced. The initial value problem of the first-order ordinary differential equation can be expressed as:  
\[\left\{ \begin{array}{l}y^{\prime}=f(x,\ y)\\ y(x_{0})=y_{0}\end{array} \right. \tag{28}\]  
Commonly used numerical optimization methods are as follows. The first item introduced here is [PERSON]'s method (Equation (29)):  
\[y_{n+1}=y_{n}+hf(x_{n},\ y_{n}) \tag{29}\]In addition, there are the following methods in Equations (30)-(32):  
1. Implicit Euler method: \[y_{n+1}=y_{n}+hf(x_{n+1},\ y_{n+1})\] (30)
2. Trapezoidal Euler method: \[y_{n+1}=y_{n}+\frac{h}{2}[f(x_{n+1},\ y_{n+1})+f(x_{n},\ y_{n})]\] (31)
3. Improved Euler method: \[\left\{ \begin{array}{l}y_{p}=y_{n}+hf(x_{n},\ y_{n})\\ y_{c}=y_{n}+hf(x_{n+1},y_{p})\\ y_{n+1}=\frac{1}{2}(y_{p}+y_{c})\end{array} \right.\] (32)  
The second item introduced is the Runge-Kutta method. Starting from the improved Euler method, the Runge-Kutta method can be obtained by adding the points required by the weighted average. The common Runge-Kutta method series has the following in Equations (33)-(35):  
1. Second-order Runge-Kutta method (midpoint method): \[\left\{ \begin{array}{l}y_{n+1}=y_{n}+hK_{2}\\ K_{1}=f(x_{n},\ y_{n})\\ K_{2}=f(x_{n+\frac{1}{2}},y_{n}+\frac{h}{2}K_{1})\end{array} \right.\] (33)
2. Third-order Runge-Kutta method: \[\left\{ \begin{array}{l}y_{n+1}=y_{n}+\frac{h}{6}(K_{1}+4K_{2}+K_{3})\\ K_{1}=f(x_{n},y_{n})\\ K_{2}=f\Big{(}x_{n+\frac{1}{2}},y_{n}+\frac{h}{2}K_{1}\Big{)}\\ K_{3}=f(x_{n+1},y_{n}+h(2K_{2}-K_{1})\end{array} \right.\] (34)
3. Fourth-order Runge-Kutta method: \[\left\{ \begin{array}{l}y_{n+1}=y_{n}+\frac{h}{6}(K_{1}+2K_{2}+2K_{3}+K_{4}) \\ K_{1}=f(x_{n},y_{n})\\ K_{2}=f\Big{(}x_{n+\frac{1}{2}},y_{n}+\frac{h}{2}K_{1}\Big{)}\\ K_{3}=f\Big{(}x_{n+\frac{1}{2}},y_{n}+\frac{h}{2}K_{2}\Big{)}\\ K_{4}=f(x_{n+1},y_{n}+hK_{3})\end{array} \right.\] (35)  
The third item introduced is the Adams method. The Adams method is a typical multi-step method, and there are common second-order and fourth-order forms. For simplicity, only the second-order forms in Equations (36) and (37) are given here. 1. Second-order explicit Adams method: \[\left\{ \begin{array}{l}y_{n+1}=y_{n}+\frac{h}{2}\big{(}3y_{n}^{\prime}-y_{n -1}^{\prime}\big{)}\\ y_{n}^{\prime}=f(x_{n},y_{n})\\ y_{n-1}^{\prime}=f(x_{n-1},y_{n-1})\end{array} \right.\] (36)
2. Second-order implicit Adams method: \[\left\{ \begin{array}{l}y_{n+1}=y_{n}+\frac{h}{2}\big{(}3y_{n}^{\prime}-y_{n -1}^{\prime}\big{)}\\ y_{n}^{\prime}=f(x_{n},y_{n})\\ y_{n+1}^{\prime}=f(x_{n+1},y_{n+1})\end{array} \right.\] (37)For the system of first-order differential equations, the corresponding formulas can be obtained similarly, which will not be repeated here. In the field of numerical computing, one criterion for judging the pros and cons of different numerical algorithms is the local truncation error. Its meaning is to assume that until the \(n\) step, the calculation result \(\{y_{k}|k=1,\,2,\,\ldots,\,n\}\) is the same as the theoretical result \(\{y(x_{k})|k=1,\,2,\,\ldots,\,n\}\). Therefore, when the error at the \(n+1\) step is a local truncation error, its calculation formula is \(T_{n+1}=y(x_{n+1})-y_{n+1}\). If \(T_{n+1}=O(h^{p+1})\), then \(p\) is the order of the single-step method, and the term containing \(h^{p+1}\) is the main term of the local truncation error. For the algorithms given above, the orders of their local truncation errors have been obtained, as shown in Table 1.  
Our method first assumes \(k=1,\,2,\,\ldots,\,n\).