movement of a particle in a magnetic field smulation