Interaction of magnetic fields with charged particles