# Electromagnetic Particle Algorithm for Beam-Wave Interaction in Traveling Wave Tube of Symmetry
## 4 PIC Method  
The wave-equation finite-difference time-domain method (WEFDTD) is one of the important methods to simulate electromagnetic wave propagation. Its calculation step is a time-stepping, that is, frog-leaping iterative calculation carried out along the time axis. Therefore, the calculation steps of WEFDTD can also be spatially stepped, i.e., a frog leaping iterative calculation along a certain-spatial axis can be performed. Obviously, the two algorithms have their own advantages, and each has its own best problem to solve, so the PIC method of the frog-leaping step scheme is adopted. Each electron advances at each time step through the discrete form of the equation of motion. The acceleration \(a\), velocity \(v\) and position equations used in the specification are similar to the following equations:  
\[ \begin{array}{l}\frac{dx}{dt}=a\Rightarrow\quad v(t_{n+1})=v(t_{n})+a_{ar} \Delta t\\ \frac{dx}{dt}=v\Rightarrow\quad x(t_{n+1}\ )=x(t_{n})+v_{ar}\Delta t\end{array}  \tag{6}\]  
In it, \(t_{n+1}=t_{n}+Ar\), \(\Delta t\) is the time step in seconds, the subscript \"\(Ar\)\" represents the average of the variable between time \(t_{n}\) and time \(t_{n+1}\). However, there are two differences between this equation and the equation used in the algorithm; first, the electron velocity and position are evaluated at different times, separated by \(v_{ar}\), so if \(\Delta t\) is small enough, \(v(t_{n}+\Delta t/2)\) will be close to \(v_{ar}\), and the same is true for \(a_{ar}\). Second, the algorithm uses normalized units, so \(x_{c}=x/\Delta x\) and \(v_{c}=v(\Delta t/\Delta x)\), where \(\Delta x\) is the cell width in meters (\(\Delta x=\text{Tube length}\), \(L/\) number of cells, \(N_{C}\)) and \(v_{c}=v(\Delta t/\Delta x)\). For electric potential and electric fields,  
\[V_{c}=V\frac{e}{m}\frac{(\Delta t)^{2}}{(\Delta x)^{2}}\ E_{c}=E\frac{e}{m} \frac{(\Delta t)^{2}}{\Delta x} \tag{7}\]  
where \(e\) is the magnitude of the electron charge and \(m\) is the electron mass. The equation of motion used in the algorithm is on the right (\(E\) is derived from \(\text{q}_{c}=-e\)):  
\[ \begin{array}{l}v_{m}^{t+1/2}=v_{m}^{t-1/2}-\frac{e}{m}E_{m}^{t}\frac{( \Delta t)^{2}}{\Delta x}\Rightarrow\ v_{m}^{t+1/2}\equiv v_{m}^{t-1/2}-E_{m}^ {t}\\ x_{m}^{t+1}=x_{m}^{t}+v_{m}^{t+1/2}\Delta t\implies x_{m}^{t+1}\equiv x_{m}^{ t}+v_{m}^{t+1/2}\end{array}  \tag{8}\]where \"\(m\)\" represents the particle and \"\(t\)\" represents the time step. Variables are evaluated at the boundary or center of the \(N_{C}\) unit in the simulation. Approximate the space charge density \(\rho\) at the cell boundaries by assigning the charge on each electron to the two nearest cell boundaries by linear interpolation (linear weighting or intracellular particles). If particle \(m\) is located between grid points \(i\) and \(i+1\), then the charge \(Q_{m}\) on particle \(m\) will be distributed so that the charge \(Q_{i}\equiv Q_{m}\frac{x_{i+1}-x_{m}}{x_{i+1}-x_{i}}=Q_{m}  
In our proposed algorithm, the telegraph operator equation has been transformed into a finite difference equation, which can also be solved by leap-frog time stepping.