Reiman, AH; Greenside, HS, *Numerical solution of three-dimensional magnetic differential equations*,
Journal of Computational Physics, vol. 75 no. 2
(January, 1988),
pp. 423-443, Elsevier BV [doi] .
**Abstract:**

*A computer code is described that solves differential equations of the form B · {down triangle, open}f = h for a single-valued solution f, given a toroidal three-dimensional divergence-free field B and a single-valued function h. The code uses a new algorithm that Fourier decomposes a given function in a set of flux coordinates in which the field lines are straight. The algorithm automatically adjusts the required integration lengths to compensate for proximity to low order rational surfaces. Applying this algorithm to the Cartesian coordinates defines a transformation to magnetic coordinates, in which the magnetic differential equation can be accurately solved. Our method is illustrated by calculating the Pfirsch-Schlüter currents for a stellarator. © 1988.*