Algorithm for solving the Lorentz force equations and tracking position and velocity over time of a relativistic particle (coded in MATLAB and Python). Uses the Boris method and explores the motion for 3 different 2 step magnetic field rotations.
2 files are uploaded for each MATLAB and Python scripts which should be identical to eachother.
The first, 'BorisA_RelChargedParticle', uses the Boris algorithm with no approximation made for small angle rotations
The second, 'BorisComparison_RelChargedParticle', compares the results from 3 types of Boris algorithms as discussed in the following 2018 paper "On the Boris solver in particle-in-cell simulation" by Seiji Zenitani and Takayuki Umeda (https://doi.org/10.1063/1.5051077)