Notebooks · posts/the-boris-push-gyrates-and-drifts
A gyro-orbit and the E×B drift by the Boris push
The Boris push moves a charged particle through electric and magnetic fields in almost every particle-in-cell code. In a magnetic field alone it keeps the speed to rounding and puts every position on one circle; the gyroperiod comes out 6.28449 instead of , longer by . With an electric field added, a particle started at moves at exactly that velocity forever, and any other start averages to it.
A charged particle in a uniform magnetic field circles the field lines at the cyclotron frequency . This circling is gyration, and its circle is the gyro-orbit. Add a uniform electric field at right angles to and the center of the circle, the guiding center, moves at the drift velocity , whatever the particle's charge or mass.
A particle-in-cell (PIC) code moves millions of particles through these fields
for millions of steps, so the step it uses must not add or remove energy on
its own. The Boris push (J. P. Boris, 1970) is the standard choice. It splits
the step into half an electric kick, a rotation about , and the other
half kick. This notebook runs it with , so and the
exact gyroperiod is , and checks each property against a closed form.
posts/refs/boris_push.py computes the same numbers with a separate numpy
implementation.
Look inside this program
- Atlas
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.
Gyration keeps the speed and the circle
With no electric field the two kicks vanish and the step is a pure rotation of , so cannot change except by rounding. The cell runs 20000 steps from and records the largest and smallest speed.
The positions are updated with the new velocity, . Each step turns by the same angle , so each position step is the previous one turned by : the positions are the corners of a regular polygon and all lie on one circle. The cell takes the circle through the first three positions and measures every other position's distance from its center. Its radius is , which is , not the exact .
The period is too long by
The rotation in the step turns by , a little less than the exact . The cell above summed the angle between successive velocities; dividing by the number of steps gives , and the gyroperiod is . Expanding the arctangent,
At that is against . The speed is exact and the radius is off by ; the phase falls behind by of a turn per turn. The figure repeats the measurement for five time steps. At the term shows: the error is , below .
The drift in crossed fields
Now add . The drift velocity is . Write one Boris step as , with and the rotation. The vector is turned by into , because its half-angle from is . So is a fixed point of the step: a particle started there never gyrates.
For any other start, is only rotated, so the particle gyrates about a guiding center moving at . Averaged over steps the velocity differs from by the unfinished part of a turn, , which is here and falls as .