When the electric fields have been obtained, the trajectories of charged particles in these fields can be calculated. Particle trajectory calculations are a result of three interdependent computations. First, electrostatic forces must be calculated at the current position of the ion. These forces are then used to compute the current ion acceleration and then by numerical integration techniques to predict the position and velocity of the ion at the next time step. Moreover, the time step itself is continuously adjusted to maximize trajectory accuracy. A standard fourth-order Runge–Kutta method is used for numerical integration of the ion trajectory in three dimensions.