Particle drifts
A charged particle in a magnetic field goes round in circles (it gyrates). Add an electric field, gravity, or a field that is stronger on one side, and the circles drift sideways. Set up an experiment and watch.
The physics
A particle with charge q and velocity v feels the Lorentz force . The magnetic part is always sideways to the motion, so it bends the path without speeding the particle up: it circles with radius . Here B points out of the page (the dot symbols; crosses mean into the page).
Add any other steady force F (from an electric field, , or gravity, ) and the centre of the circle drifts sideways to both F and B:
With an electric field this is the E×B drift (the same for every charge). A force like gravity gives the F×B drift, which depends on the sign of q. If B is stronger on one side, the circle is tighter there, and the particle slowly creeps along: the grad-B drift.
The computer moves the particle in small time steps τ. Too large a step gives wrong answers, and a simple step-by-step method can slowly add energy that should not be there: that is what the "enforce conservation of energy" box corrects.