# Optimization of Multistage Coilgun Based on Neural Network and Intelligent Algorithm
## 2 Simulation Model
### Current Filament Model  
In order to build a predictive model, one must first obtain a valid model input and output dataset. Compared with costly prototype experiments, the mainstream method of obtaining data is through numerical simulation, which currently mainly includes the finite element method (FEM) and the current filament method (CFM) [17]. The FEM uses different discretization types to construct numerical model equations that are similar to partial differential equations. The solution obtained is the approximate solution of the partial differential equation. The solution accuracy can be adjusted by adjusting the mash division and the solution time step, but the disadvantage of this procedure is that the solution process is very lengthy. In order to improve the efficiency of obtaining datasets, we will use the CFM for modeling and simulation. As its name suggests, the CFM entails dividing a projectile with a certain length and thickness into a circle of current filaments, which can solve the problem of an uneven distribution of induced current on the projectile caused by the skin effect. The basic idea is \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(R_{c}\) & \(L_{c}\) & \(D\) & \(N\) & \(S\) & \(R_{p}\) \\ (mm) & (mm) & (mm) & & (mm) & (mm) \\ \hline
4 & 35 & 1 & 6 & 5 & 3.25 \\ \hline \(L_{p}\) & \(V\) & \(M\) & \(U\) & \(C\) & \\ (mm) & (m/s) & (g) & (V) & (mF) & \\ \hline
25 & 0 & 6.37 & 400 & 1 & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Structural parameters of MSSICG. Figure 2: External circuit and current waveform. (**a**) Schematic diagram of external circuit; (**b**) Current waveform before and after adding freewheeling circuit. similar to the finite element method, both of which discretize the projectile and divide it into m and n layers along the axial and radial directions of the projectile. The calculation accuracy of the CFM can be improved by adjusting the values of m and n. The equivalent circuit model of the CFM is shown in Figure 3.  
After the projectile is divided, each ring can be regarded as a single-turn coil. According to [PERSON]'s law, the circuit equations of each turn of the driving coil and each current filament loop of the projectile can be expressed as follows:  
\[\left\{ \begin{array}{l}R_{d}I_{d}+L_{d}\frac{dI_{d}}{dt}+M\frac{d(Mt_{p})}{dt }=U_{d}\\ R_{p}I_{p}+L_{p}\frac{dI_{p}}{dt}+M\frac{d(Mt_{d})}{dt}=0\end{array} \right. \tag{1}\]  
Since the model is symmetrical along the Z-axis, when the projectile moves toward the Z-axis, the relationship between velocity and displacement is as follows:  
\[\frac{dz}{dt}=v \tag{2}\]  
Substitute Equation (2) into Equation (1) and expand it; then, organize it into a matrix form:  
\[ \begin{bmatrix}R_{d}&0\\ 0&R_{a}\end{bmatrix}\begin{bmatrix}I_{d}\\ I_{a}\end{bmatrix} + \begin{bmatrix}L_{d}&0\\ 0&L_{p}\end{bmatrix}\begin{bmatrix}\frac{dI_{d}}{dt}\\ \frac{dI_{p}}{dt}\end{bmatrix} + \begin{bmatrix}0&M\\ M&0\end{bmatrix}\begin{bmatrix}\frac{dI_{d}}{dt}\\ \frac{dI_{p}}{dt}\end{bmatrix} +v \begin{bmatrix}0&\frac{dM}{dx}\\ \frac{dM}{dx}&0\end{bmatrix}\begin{bmatrix}I_{d}\\ I_{p}\end{bmatrix} = \begin{bmatrix}U_{d}\\ 0\end{bmatrix}  \tag{3}\]  
Perform a force analysis on the projectile. When the projectile moves a distance of \(d_{z}\) along the axis, according to the law of conservation of energy, the work executed by the  
Figure 3: Schematic of CFM. (**a**) Schematic diagram of CFM; (**b**) Equivalent circuit diagram of CFM. electromagnetic force should be equal to the change in electromagnetic energy.