Beam model
The beam is modeled by macro-particles. Each beam macro-particle is characterized by its longitudinal position \(\xi_b\), transverse position \(r_b\) or (\(x, y\)), three components of momentum \(\vec{p}_b\), charge \(q_b\), and mass \(m_b\). Equations of motion for the macro-particles are
These equations are solved with the modified Euler’s method (midpoint method). The fields acting on the macro-particle are linearly interpolated to the predicted macro-particle location at the half time step. If a particle has a small longitudinal momentum and thus a high frequency of betatron oscillations, then the time step for this particle is automatically reduced.
With no external magnetic field (\(B_0=0\)), the angular momentum of beam particles must conserve, so the azimuthal component of the momentum \(p_{b\varphi}\) is not changed, and reconstructed from the condition \(r_b p_{b\varphi} = const\).