Fundamentals / Physics / Electrodynamics / Numerical field laboratory

A magnetic orbit that spirals outward in a perfect vacuum

Track a charged particle in a prescribed uniform field, derive a rotation update and separate numerical energy growth from a real magnetic force.

Use the work law before solving the trajectory

A nonrelativistic charged particle of mass \(m\) and charge \(q\) moves perpendicular to a uniform, time-independent magnetic field \(B\hat{\mathbf z}\). There is no electric field and the dilute test particles do not affect the applied field. The Lorentz force gives \(\dot v_x=\omega v_y,\ \dot v_y=-\omega v_x\) for \(\omega=qB/m\). Dotting with \(\mathbf v\) gives zero, so the speed should stay constant. This property holds for either sign of the charge; the direction of rotation changes. It is a better initial test of a trajectory solver than how circular a short segment looks on screen.

Define \(J(v_x,v_y)=(v_y,-v_x)\), so \(J^T=-J\) and \(J^2=-I\). The exact velocity over a time step \(h\) is \([\cos(\omega h)I+\sin(\omega h)J]\mathbf v\). Integration in time gives a circular orbit of radius \(v_\perp/|\omega|\) once the guiding centre is chosen. A magnetic field alone bends a trajectory without changing its kinetic energy; a slowly growing orbit radius at fixed \(B\) and fixed initial speed demands an explanation.

Why forward Euler adds energy at every step

Euler gives \(\mathbf v_+=(I+dJ)\mathbf v\) with \(d=\omega h\). Squaring the norm eliminates the cross term because \(v^TJv=0\), leaving \(\|\mathbf v_+\|^2=(1+d^2)\|\mathbf v\|^2\). No nonzero step has exact unit gain. A geometric picture makes the bias tangible: a tangent step leaves the initial velocity circle on its outside, whatever the point of departure.

After \(N\) steps the speed factor is \((1+d^2)^{N/2}\). With 24 steps per physical orbit, \(d=2\pi/24\simeq0.2618\), so a full orbit multiplies speed by roughly 2.2. At shorter times or smaller steps this can resemble weak physical acceleration. Reducing \(h\) at fixed physical duration reduces the growth. Testing one step at fixed count, rather than comparing over a fixed physical interval, underestimates the cumulative error.

Solve a centred magnetic step exactly

Use the time-centred velocity in the Lorentz force:

\[\mathbf v_+-\mathbf v=d J(\mathbf v_++\mathbf v)/2.\]

Premultiply by the transpose of \(\mathbf v_++\mathbf v\). The left side is the difference of squared speeds and the right side vanishes, so the update preserves speed for every \(d\) in exact arithmetic. Rearranging yields a two-dimensional linear solve; using \(J^2=-I\) turns it into a rotation,

\[\mathbf v_+=\frac{1-t^2}{1+t^2}\mathbf v+\frac{2t}{1+t^2}J\mathbf v,\]
\[t=d/2.\]

These coefficients are \(\cos\alpha\) and \(\sin\alpha\) for \(\alpha=2\arctan(d/2)\). This is the magnetic rotation used in the nonrelativistic Boris integrator. For simultaneous electric fields, the usual split step adds two half electric impulses around the magnetic rotation. The current experiment isolates the magnetic part; it makes no claim about a nonuniform electric field or the accuracy of interpolation from a field mesh to particles.

Speed conservation does not fix arrival time

At small \(d\),

\[\alpha=d-d^3/12+O(d^5).\]

A speed-preserving orbit lags in gyrophase, even when its energy plot stays perfectly flat. After four true orbits at 24 steps per orbit the predicted lag is about 8.14 degrees. The browser advances the Euler and rotation velocities and reports both norm and lag. The y-axis rescales to fit both curves, so a sharply growing Euler error can flatten the appearance of the well-behaved curve. Inspect numerical values as well as the picture.

Suppose an optical pickup observes the time at which a dilute ion tracer first crosses a known line of sight after several orbits. A phase error can be an important measurement error even when the speed is exact. To use the trajectory as a reference, refine the step until the crossing time changes by less than the experimental timing resolution. If the required integration spans many revolutions, a uniform field permits exact substeps. In realistic fields one can retain a structure-preserving rotation while resolving spatial variation independently.

A separate diagnostic is time reversal. Starting from the final velocity and applying the rotation with \(-d\) exactly inverts a centred step, up to rounding. Forward Euler with \(-d\) after \(+d\) gives

\[(I-dJ)(I+dJ)=(1+d^2)I.\]

A forward/backward test detects the lost reversibility without knowing a single experimental constant.

Tutorial

Given an orbit with 48 steps per period, estimate the gyrophase error after ten periods using the leading asymptotic term.

Work through the solution

There are 480 steps with \(d=2\pi/48\). The accumulated lag is about \(480d^3/12\simeq0.0897\) rad, or 5.14 degrees. Doubling the number of steps per period reduces the leading accumulated error fourfold.

A computation preserves speed but reverses the sign of its orbit relative to observation. Would the magnetic work test detect the error?

Work through the solution

Both field signs give zero work. Check a signed initial acceleration component \(a_y=-qBv_x/m\) for a positive initial \(v_x\), or observe the oriented trajectory. A scalar invariant cannot detect all vector-sign errors.

What changes in the relativistic case with appreciable kinetic energy?

Work through the solution

Evolve momentum \(\mathbf p=\gamma m\mathbf v\) and infer velocity from momentum. In a uniform magnetic field without electric work \(\gamma\) stays constant, and the orbital frequency is reduced to \(|q|B/(\gamma m)\). An energy-preserving nonrelativistic integration at the wrong frequency would still give the wrong measured period.