The computation of electric fields for numerical integration of charged particle motion