The magnetic scalar potential U(r) has an intuitive physical interpretation, representing the electric current I = ΔU, which must be directed between any pair of isocontours along the boundary of a region, differing in potential by ΔU, in order to generate the corresponding magnetic intensity H=U inside the region with no tangential component outside the boundary. This physical significance is exploited to invert the design process of hermetic (fringeless) electromagnetic coils from standard iterative techniques (calculating the magnetic field of refined current distributions) to a procedure for calculating the exact surface currents required to generate a given field configuration. A practical construction algorithm is given to produce the prescribed field in a “Target” region (constrained only by Maxwell’s equations) while confining the fringe field to a specified hermetic “Return” region. Example coils are analyzed along with a discussion of the limits of precision of the constructed field.

The practical use of magnetism often requires the design of a current-carrying collection of wires (a “coil”) that creates a specified magnetic field. Some examples are the following: (a) NMR requires a very uniform field so that a spin precesses at the same rate no matter where it may be in the experimental volume;1,2 searches for the electric dipole moment of the neutron3 require gradients smaller than 1 pT/cm.4,5 (b) Transporting polarized atoms or neutrons6 requires a holding field that varies slowly with position in a specified way so that the spin can follow the field adiabatically. (c) Active magnetic shielding can be constructed to cancel the field of a fixed source;7 accurate cancellation requires an accurately designed shield. (d) Guiding particle beams while maintaining stability of the trajectory and pulse duration requires a field with specified magnetic moments.8,9 The characteristic problem requires a magnetic field B(r) of the specified form within a “Target” volume to a stated tolerance. Of course, the desired field will have to obey the conditions

×H=0
(1)

(since it would be undesirable to have currents inside the region of study) and

B=0,
(2)

where the fields B and H are related by a constitutive equation, for example, a proportionality B=μH. In much of what follows, it will be assumed that μμ0 everywhere, although, in general, μ can represent any nonlinear inhomogeneous constitutive relation, including remnant fields or hysteresis.

In general, there must be a surrounding “Return” region, since the components of the magnetic field normal to the surface of the Target cannot be canceled. It is usually desirable (but not required for this method) that the Return is a bounded region and that no field extends outside these regions (a hermetic coil), both to prevent the created field from interfering with other devices and to avoid having magnetizable objects outside the coil become part of the magnetic system (see Fig. 1). The current-carrying wires are on surfaces at the boundary between the Target and the Return, on the exterior surface of the Return, and possibly on other surfaces dividing the Target and the Return into disjoint regions.

FIG. 1.

Cross section of one quadrant of a magnetic coil with uniform transverse field lines in a tube of circular cross section (the Target). The fringe field lines are hermetically enclosed in a Return with a square outer boundary. There are surface currents flowing perpendicular to the page on the circle and square borders, corresponding to the discontinuity in the parallel component of the field.

FIG. 1.

Cross section of one quadrant of a magnetic coil with uniform transverse field lines in a tube of circular cross section (the Target). The fringe field lines are hermetically enclosed in a Return with a square outer boundary. There are surface currents flowing perpendicular to the page on the circle and square borders, corresponding to the discontinuity in the parallel component of the field.

Close modal

The traditional workflow for designing coils involves starting with a basic design, calculating the magnetic field, and iterating changes to the windings to converge on the desired field configuration. Many techniques exist in the literature10 for streamlining this process, for example, (a) through the use of basis current loops to optimize the target field numerically,11–16 either solving the linear system of equations for the currents or optimizing nonlinear coil parameters. The progression from a single coil to the Helmholtz17,18 and Maxwell19 arrangements is the ancestor of this approach and has been extended to higher harmonics.20 Since the field and currents are related by linear equations, this method is sure to work, but the relationship between the desired field and the required coil is only as clear as one’s understanding of an integral equation involving a tensor Green function. Surface and bulk current distributions have been described as fictitious magnetization densities,21–24 which can take an arbitrary form in the limit of infinitesimal dipoles. Various optimization procedures include variational principles16,24 and linear programming.15 In problems with either real or fictitious magnetization density, the net pole density plays the role of electric charge in an analogous boundary value problem to that of the electric field.21,25–27 For real current distributions, stream functions specify the resulting discontinuity of the scalar potential,2,28,29 which has also been applied to eddy currents,30 and the analysis of fields31,32 showed that any volume containing surface currents can be divided into topologically simple regions in which the scalar potential is well-defined. This technique has been applied in cylindrical, spherical, and planar geometries to calculate surface current windings of coils with minimized higher order multipoles.9,27

This paper describes a construction algorithm, based on a physical interpretation of the magnetic scalar potential, that can create any field B(r) satisfying (1) and (2) within any set of Target regions and with only weak physical constraints on the boundaries and necessary Return regions derived from (1) and (2), although practical and technical considerations such as ease of construction, tolerance requirements, and power management add further constraints. These will be discussed subsequently. The particular focus is on extremely well characterized fields, with relative variation as little as 10−6 from the design field, with tight geometric constraints on where currents may be placed. This method inverts the process of magnet design by starting from the desired field and calculating the required windings on specified surfaces to produce this field.

Because this technique involves the design of surface current coils, it is applicable to low-field precision coils with low enough current densities that they may be formed as a single layer of conducting strips or wires, still dissipating an acceptable amount of power. This limits the field to about 100 G (although larger for superconductors), but the generalization to multiple layers is straightforward. The intuitive interpretation of the magnetic scalar potential underlying this approach simplifies visualization of general electromagnetic coils and the currents required to generate their field.

Inside a region with no currents, Eq. (1) implies that we can construct a magnetic scalar potential U such that

H(r)=U(r).
(3)

Within the Target, the field H is completely specified (this is the starting point for the problem to be solved), and thus, we are given U for that region. The fields in the Return must have the same normal component of B at the interface with the Target and vanishing normal component of B at the exterior surfaces for a hermetic coil (with no exterior fringes). Other exterior constraints are possible, such as U being a constant in patches of the boundary where surface currents are prohibited.

In order to explain how these are connected and determine the coil windings needed to relate them, it is convenient to introduce (conceptually) a thin layer between adjacent regions and ascribe windings to the surface of each region separately. The property of this “Transition” region will be that the H field is normal to the two surfaces; there is no tangential field. Thus, the magnetic scalar potential on the Transition side of the surface does not vary as one moves along the surface and thus is a constant at the surfaces of the Target and the Return that can be set to zero by making the Transition arbitrary thin; thus, we can avoid having to make a detailed study of it. Some mechanical designs benefit from a finite width transition.37 

Now, consider the scalar potential within the Target. Construct a set of equipotential surfaces that correspond to values of the scalar potential that differ by multiples of a small constant amount ΔU. The neighboring equipotential surfaces cannot intersect, and they separate the boundary of the region into ribbons that form closed loops (Fig. 2). The magnetic field will, in general, have a component parallel to the boundary, while within the Transition region it does not by construction; thus, there is a current sheet on the ribbon. Its magnitude is determined according to the integral form of Ampere’s law,

H(r)dr=I.
(4)

For a path near the surface that encircles a ribbon, the part of the path inside the Target gives the difference in the magnetic scalar potential; since the field is normal to the surface in the Transition, there is no contribution. Thus, the current in the ribbon is given by9,28,33,34

I=ΔU(in S.I. units),
(5)

the difference in potential between the two edges of the ribbon.

FIG. 2.

The field and scalar potential near a boundary (black line) separating the Target from the Transition. The equipotential surfaces of the magnetic scalar potential (blue lines) divide the boundary into segments (extending to ribbons around the region). The field lines (red lines) are perpendicular to the equipotentials. The scalar potential in the Transition is constant along the boundary and can be set to zero. The green polygon is a path of integration for Ampere’s law, as described in the text.

FIG. 2.

The field and scalar potential near a boundary (black line) separating the Target from the Transition. The equipotential surfaces of the magnetic scalar potential (blue lines) divide the boundary into segments (extending to ribbons around the region). The field lines (red lines) are perpendicular to the equipotentials. The scalar potential in the Transition is constant along the boundary and can be set to zero. The green polygon is a path of integration for Ampere’s law, as described in the text.

Close modal

Another route to the same relationship starts from the differential form of Ampere’s Law ×H=J. This implies35 a surface current density J=δ(n)K at tangential discontinuities in H: integration across the surface of the discontinuity yields

n̂×ΔH=Δ(n̂×U)=K(r),
(6)

where n̂ is the outward normal to the surface and Δ represents the outward minus inward field. For discontinuities on the surface of the target, the Transition field is already normal to the surface and thus makes no contribution, so

n̂×U=K(r),
(7)

which explicitly flows along contours of constant magnetic potential. Integration across contours on the surface yields Eq. (5). The sense of direction is as follows: while walking on the outside surface of the Target (or other region) in the direction of positive current, ΔU equals the right minus left equipotential (U increases to the right).

The flux continuity equation deriving from B=0 includes fields in the Transition,

n̂ΔB=ΔμUn=0.
(8)

The general boundary conditions (6) and (8) are discrete versions of the magnetic Maxwell equations.

The fields in the Return can also be described by a magnetic scalar potential U′, which satisfies the Laplace equation

2U=0.
(9)

At the boundaries, the normal component of B is specified (Neumann boundary conditions): at the boundary with the Target, the normal component of B is given by the normal component of B in the Target from (8); at the exterior boundary, the normal component of B is zero, since there is no field outside the Return. Dirichlet boundary conditions may be substituted on a portion of either boundary to constrain a region with specified surface currents (for example, no current); however, this will result in slight modifications of the specified fields in the Target or leakage fields out of the Return. By the uniqueness and existence theorem for Laplace’s equation, this boundary value problem determines the magnetic scalar potential up to an irrelevant additive constant; it can be found numerically using commercial finite element analysis packages.36 As in the case of the Target, the equipotentials of U′ slice up the boundary of the Return into closed ribbons, which carry current I′ = ΔU′ to cancel the tangential field just outside the boundary.

The result of this construction algorithm is a coil assembly in the form of a surface current density flowing in closed loops along the equipotential lines that can create a magnetic field of an arbitrary form [consistent with the homogeneous Maxwell’s Eqs. (1) and (2)] within the Target and with no field escaping beyond the Return. The solution is unique, once the shape of the Return is chosen.

The introduction of the Transition layer separates the boundary conditions for the Target from those for the Return, allowing for a simple physical interpretation of the scalar potential, which is local to each region. The way U and U′ is defined directly determines the surface current density on the boundaries so that these prescribe the coil windings in the actual device. It should be noted that the potentials in the various regions are not continuous across the boundary and are related only by Eqs. (6) and (8). Figure 3 shows the magnetic scalar potentials that encode the fields shown in Fig. 1.

FIG. 3.

The magnetic scalar potential (increasing from red to blue), corresponding to the fields in Fig. 1. Neighboring surfaces differ in potential by ΔU = H0R/20, where H0 is the magnetic intensity inside the cylinder of radius R = 1/2. Current I = ΔU flows along the equipotentials (black) on the front and back face and longitudinally (out of the page) along the circular (cylindrical) and square boundaries.

FIG. 3.

The magnetic scalar potential (increasing from red to blue), corresponding to the fields in Fig. 1. Neighboring surfaces differ in potential by ΔU = H0R/20, where H0 is the magnetic intensity inside the cylinder of radius R = 1/2. Current I = ΔU flows along the equipotentials (black) on the front and back face and longitudinally (out of the page) along the circular (cylindrical) and square boundaries.

Close modal

Another utility of separating the transverse boundary condition with a Transition between each region is that the branching distribution of wires at each inter-edge (junction path) of 3 or more regions is automatically handled by winding separate currents around each region. In some cases, it is advantageous to combine the Target and Return portions of current along adjacent sides of the boundary into a single set of windings calculated by discretizing the combined potential UU′; however, in these cases, junction currents must be handed by manually splitting the currents37 or double-winding on a separate boundary, such as the end caps of a single-wound double-cylinder coil.6 

The essential point is that the magnetic scalar potential U has a direct physical meaning: its series of equipotential contours on the boundary of a region represents the path of source windings and the amount of current needed to generate the field H=U within that region. In particular, the current flows along the isocontours of U, and the total current flowing between any two isocontours of values U1 and U2 is equal to I = U1U2. These windings and their corresponding contours of the scalar potential form an “electric fence,” which terminates the transverse component n̂×H at the boundary, leaving only the normal component to pass through the Transition to the next region. Fencing in the fields of all regions, which share magnetic flux lines, establishes an electromagnetic coil that not only guides the magnetic field but also generates it. However, if the windings from one region are omitted, then, the field will not be normal in its adjacent Transitions, invalidating this interpretation of the scalar potential in the surrounding regions.

In fact, this physical interpretation scalar potential extends beyond the boundary conditions of any fiducial region. If the region is separated by a membrane, the winding contours apply to both sub-regions. Since the windings cross in opposite directions on the membrane, they cancel, yielding the same net current in the combined region. Repeating this procedure, the entire equipotential surface represents a mesh of region-independent infinitesimal current loops, which reduce à la Stokes’ theorem to a current loop around the contour on the physical boundary. This completes the generalized “currents” interpretation of U and by extension H.

The magnetic scalar potential describes the free current analog of bound surface currents, which effectively circulate around the boundary of regions of magnetic material when the magnetization field M(r) is irrotational. This accounts for the similarities in bound and unbound design techniques: the M field represents an actual mesh of real physical current loops vs the virtual mesh represented by H=U. In either case, the curl of H or M represents the termination of partial meshes along current flux lines in the bulk instead of extending all the way to the boundary of the region so that the meshes can no longer be considered isosurfaces of a single-valued scalar potential. As an example of the parallel relationship, a Dirichlet boundary condition on the magnetic scalar potential and its corresponding surface currents can be represented by a magnetic dipole layer27 similar to M, just as an electric dipole layer generates a discontinuity in the electric potential.

An alternative to winding surface currents along the Return is to replace the Return with a shell of ferromagnetic material (μ → ∞) thick enough not to become saturated, which satisfies the same condition n̂×H=0 on the outside boundary of the shell as was imposed in the Transition.33 Physical windings in the Return are replaced by magnetization currents of the medium, which eliminates the need for solving a boundary value problem in the Return. Inside the ferromagnetic Return, windings are only required along equipotentials of the Target region. For a uniform field, the inner contours lie on equidistant parallel planes. This explains the surprising effectiveness of the “magic box,”38 a rectangular shielded coil wound in this geometry. In addition, if the Target field is normal to the Return everywhere along the boundary (the Dirichlet boundary condition U = constant) then, the inner windings also vanish almost everywhere except between the north and south pole tips where magnetic flux reverses between entering and exiting the Target. In this case, the method reduces to the common practice of shaping pole tips along the equipotential surfaces of various field configurations, for example, pure multipoles.39 

A completely hermetic coil may be impractical, for example, if holes or gaps are required in the surface current coil for access to the interior. This can also be specified by the Dirichlet boundary condition U = constant on portions of the boundary. However, since the uniqueness and existence theorem requires exactly one boundary condition at each point on the boundary, the flux through the boundary cannot be constrained, and the coil will have fringes either in the Target or outside the Return, near this portion of the boundary.

Conversely, the Neumann “zero flux” boundary condition n̂U=0, where the magnetic field is parallel to the surface and is automatically satisfied by a perfect diamagnet (μ = 0) such as a superconductor. The magnetization or supercurrents will confine the flux inside the boundary of the region, again without the need for calculating windings.

The scalar potential method for determining the winding geometry of a coil extends naturally to regions with spatially varying magnetization, either expressed as local permeability μ(r) and/or permanent magnetization M(r) by replacing Laplace’s equation with

μU=ρM
(10)

with the addition of a magnetic charge density source term ρM=μ0M0, where M0 is the portion of magnetization not included in μ. This commonly used equation is the analog of electrostatic problems, with the boundary condition Eq. (8) also including the flux source term σM=n̂M0. Even with these other terms, the magnetic scalar potential U still represents the free currents, which must be wound along the boundary to generate the corresponding field. Modern FEA software36 is able to solve this equation with nonlinear permeability and even in materials exhibiting hysteresis, extending this technique for calculating the electromagnetic windings to a broad class of realistic physical situations involving ponderable media.

Interior surface currents K or discontinuities in μ necessitate partitioning the volume into separate regions Ri with potentials Ui related by the continuity Eqs. (6) and (8). In some cases, it may be desirable or necessary to separate the Target or Return into several compartments with a current layer in between each one. This allows a larger field for the same current by avoiding surfaces where the magnetic field has a large change in the tangential component. In the case of the Target, where the internal fields are completely specified, the boundary conditions require continuity of the normal component of B and determine the bounding current K from the discontinuity in n̂×H. In the case of the Return, any current sheet on the interface between different regions of the Return is indeterminate and K must be specified in the continuity boundary conditions Eqs. (6) and (8) between the potentials of each region, which are then solved as one boundary value problem.

Finally, this technique can be used to design electromagnetic coils around pre-existing windings of current density J(r), which do not admit the scalar potential. They can be accommodated by solving

×1μ×A=J
(11)

for the vector potential A(r) in the region containing J, simultaneously solving for U in the remaining volume, replacing Eqs. (6) and (8) with the modified continuity equations to the surrounding scalar potential,40 

n̂×U1μ×A=K,
(12)
n̂(μU×A)=0,
(13)

where K is any fixed current on the boundary and n̂ points toward the region described by U. The surrounding region may need to be split up to avoid it linking around current, which would make U multivalued. If the scalar potential completely encloses the current-carrying regions, then, the additional surface current windings are still obtained from the isocontours of the scalar potential. Otherwise, exterior boundaries of the vector potential can be wrapped by an infinitesimally thin region of scalar potential to transfer the boundary conditions to U, which naturally represents the winding contours on the entire surface. The surface currents can also be obtained directly from the boundary condition

K=1μAn.
(14)

For a practical coil, the current will be discretized into either (a) a three-dimensional printed circuit board41,42 with solid ribbons of conductor between pairs of equipotential contours such that the current density in each ribbon approximates a step function, as determined by Ohm’s law, or (b) wires wound along each equipotential contour carrying all of the current assigned between it and the contour of the next wire. While traces have a smoother current density, which better approximate the continuous distribution, wire windings have a more precisely known current density (a delta function at each wire). In contrast, the exact current distribution along traces of finite width depends on the variations in the resistivity and thickness along the traces and the geometry, such as curves in the traces.

The discretization from a continuous current density K(r) to either a step function of constant valued K across each ribbon or a delta function of constant current I in each wire causes an alteration of the field inside the Target near the boundary, which falls off as one goes away from the boundary, with a scale length comparable to the wire spacing D. The discrete current can be represented as the sum of the current distribution it is meant to represent and a set of currents that vary on various wavelengths—for example, the Fourier representation for currents on a plane or a sum of spherical harmonics for currents on the surface of a sphere. These give fields that vary as power laws, growing most rapidly near the surface. In practice, one minimizes the residual fields by tuning the actual location of each winding about the position indicated by the uniformly spaced-equipotential rule so as to suppress the longest-wavelength variations. A possible design places the wire at the barycenter of current in each ribbon.43 

The coil as constructed by this algorithm consists of independent closed loops, each carrying the same current. These can be connected together in series, allowing the entire boundary to be wound with a single wire, by winding around the highest U-contour first, then crossing over to the next contour with a short leader, winding that contour, and so on to the end. After winding the last contour, the wire is traced back along each leader to cancel the current that is not part of the real solution.44 The two ends of the wire are now near the same point to be connected to the current supply power by a twisted pair or coaxial line. This process of joining the loops into a series must be done for each region of nonzero field to obtain a complete coil producing the desired field in the Target.

This strategy of following the equipotential line and joining to the next contour at a step avoids a pair of problems. Evening out the displacement (as is done in a helically wound solenoid) introduces a new surface current parallel to the magnetic field. This will give an error field in the interior, except for rotationally symmetric windings. In any case, the current has to be in a complete circuit; having wound around the Target, there has to be a connection back to the power supply. The field due to one wire circling back will depend on the wire spacing D and the distance R of the return wire from the target δHI/R so that RδH/HD/R ≈ 10−3. Having the return current right over the steps joining the turns allows one problem to solve the other.

The cancellation of the field of the crossing leaders is only first order, replacing the H1I/2πr field of the string of leaders by a line of dipoles with a field H2/r2 where δ is the average separation between the leaders and the current return line (δ can be smaller than the average spacing D between wires, but is comparable to it). To put these estimates in context, the field in the Target is H0I/D; for a coarsely wound coil, the wire spacing is of order 10−2 the smallest dimension of the coil so that H1 ≈ 10−2H0 and H2 ≈ 10−4H0.

A different rule for designing a wound coil is discussed in a companion paper.45 

The following continues to describe the coil as if it were the collection of loops, while asserting that the practical implementation as a series circuit is a negligible change.

The technique described above is applicable to arbitrary geometries and target fields. In Secs. III A and III B, we describe standard coils with symmetric geometry and easy-to-visualize magnetic potentials as an illustration of how their winding geometry becomes immediately apparent as isocontours of the potential. Some nontrivial extensions and practical applications are described through their corresponding boundary value problems for example, active shielding in Sec. III C.

A uniform magnetic field has regularly spaced parallel planar equipotentials. An infinite solenoid of arbitrary fixed cross section will have uniform axial field H = I/D if the coil is wound with current I around the perimeter of cross sectional slices with spacing D normal to the field lines. Segments of straight solenoid can be joined to produce a “bent solenoid.” Let the bend angle (change in direction) be 2α, then, the intersection of the two cylinders is an ellipse in the plane whose normal is tilted by the angle α from the field lines in either segment. At the interface, the equipotentials are parallel lines along the plane of intersection, perpendicular to the field lines on either side. The overlapping contours on the interface from both cylinder segments have current in the same direction and generate a planar current density K=2IDsinα, which kinks the field, reversing the tangential component of H across the interface.41 This gives a straightforward geometric interpretation of a lengthy calculation based on Biot–Savart integration,46 which applies to solenoids of any cross section.

A finite solenoid with uniform field inside can be constructed by adding current-carrying end caps. The current distribution on the end caps is calculated by solving the scalar potential in the infinite region outside the solenoid with constant flux boundary conditions at each end face. The field just outside the cylindrical surface of the solenoid is in the opposite direction to the constant field inside the solenoid, and therefore, the outside windings are in the same direction as the inside ones. The equipotentials outside are closest together near the ends, indicating a higher current density at the ends to prevent fringing inside the finite-length solenoid. Circular windings are also needed on the end faces to maintain uniformity inside the solenoid.

A uniform magnetic field x̂H0 perpendicular to the axis (ẑ) of a circular cylinder of radius A has the potential U = −H0x = −H0ρ cos ϕ, giving rise to the name “cos-theta coil.” This can be created with inner longitudinal windings of equal spacing in x and current I = H0Δx along the cylinder. The field outside the cylinder is described by the potential U′ = H0(A2/ρ)cos ϕ = H0x(A/ρ)2. Thus, the outer windings have exactly the same current as the inside windings, resulting in double the total surface current, which can be combined into a single winding. This infinitely long design has an infinite radius Return.

For a Return in the form of a larger concentric cylinder of radius B, the potential U′ = H0A2(B2/ρ + ρ)cos ϕ/(B2A2) has zero flux escaping the outer cylinder. The uniform inner field and the return flux are shown in Fig. 4. The infinite cylinder solution is well known43 and can also be calculated by considering a second cos-theta coil of radius B with the opposite magnetic moment HAA2=HBB2=(A2B2)1H0, where HA,B are the interior fields of cos-theta coils of radii A and B with current densities KA,B = 2HA,B cos ϕ such that the total interior field is x̂H0 while the net external dipole field is canceled. However, it is the physical interpretation of the magnetic scalar potential that immediately yields the winding configuration required to truncate the double-cos-theta coil to a finite length while preserving z-symmetry: the cylindrical Target and Return are wound on equally spaced contours of U and U′, respectively. The windings on the end caps are illustrated in Fig. 4, and each wire on the end cap continues longitudinally down the cylinder after it reaches the inside/outside edge. Ascribing separate boundaries and windings to each region simplifies the winding patterns at edges where three or more regions meet compared to single windings in which current must be diverted in multiple directions at the junction. The design of a transverse adiabatic radio frequency spin rotator based on this finite double-cos-theta coil is described in Ref. 37.

FIG. 4.

Field lines (white) and equipotentials (black) for the cos-theta coil, separated by ΔU = H0A/17, where A = 1/2. The potential is discontinuous across the boundaries, corresponding to the current sheet flowing on the surfaces. The potential increases from red to blue.

FIG. 4.

Field lines (white) and equipotentials (black) for the cos-theta coil, separated by ΔU = H0A/17, where A = 1/2. The potential is discontinuous across the boundaries, corresponding to the current sheet flowing on the surfaces. The potential increases from red to blue.

Close modal

As with solenoids, transverse coils can be wound on any interior and exterior cross section, for example, a square inside of an octagon, and the field strength can taper along z.6 The case of a square outer boundary is shown in Figs. 1 and 3.

This is the inverse of a magnetic coil in that it cancels, not creates, a magnetic field, but the technique is the same. Given a surrounding field due to external flux sources and nearby magnetic materials, an active shield can be designed as a hermetic field cancellation coil on a closed surface outside the shielded area. If the flux through this surface is nulled, then, the field will be canceled everywhere inside the shield. This can be accomplished by solving a boundary value problem for U in the region outside this boundary surface that either (a) includes all exterior sources and has a vanishing normal component of B at the surface or (b) for linear materials has no external sources but is given the opposite flux as that being canceled at the boundary. The external region may contain permeable materials or even current sources as discussed above. The resulting contours of constant potential on the boundary indicate how to wind the shielding coil for most effective field cancellation and efficient use of power. The coil can be wound fairly coarsely since the field penetration will rapidly decrease on the length scale given by the wire spacing. Separate coils can be calculated independently for individual sources of flux, or separate coils can be designed using the scalar potential to cancel each multipole of the background field for actively tuning the shield.

The attainable accuracy of the resulting field in a realization is determined by the deviations from the assumptions of the theory. Here is a brief discussion of the leading concerns:

Misplacement of a wire from its ideal position by δx over a span Y creates an error field of the dipolar form with magnitude δH/HδxDY/R3 at distance R from the wire (D is the spacing between wires. The extra factor D/R is the fractional contribution of one wire to the total field). Since D and δx will typically be of order 10−3R, this might be ignorable, but a systematic displacement of a region will give coherently adding errors. For example, shifting the windings of an infinite solenoid of radius A by a distance δx in a finite region of length L gives an effect equivalent to an extra turn carrying current Iδx/D at the two ends of the region and gives rise to an error field of magnitude Iδx/DA. The wire form must be accurately constructed, and care be taken that the wire follows the intended path, especially at corners.

As already noted, this gives a dipolar field of order δH/H ≈ 10−4. Weaving the step and the return current lines to give alternating sign dipoles might decrease this by another factor of 10−2 but would not be practical in many construction techniques. Another option is to double wind the coil, spiraling up and then down again; this cancels the effects of the conversion to a helical winding in a uniform way, again at the cost of complexity.

The current has to be in a complete circuit; having wound around the Target, there has to be a connection back to the power supply. The field due to one wire circling back will depend on the wire spacing D and the distance R of the return wire from the target δHI/R so that δH/HD/R ≈ 10−3. The schemes discussed in the previous paragraph avoid this error. An alternate scheme is discussed in Ref. 45.

As discussed above, this is exponentially suppressed so that the disturbance falls off as exp(−2πz/D) as one moves away from the surface. For an infinite planar array of parallel wires with spacing D, the error field at distance 2D is of order exp(−4π) = 3 × 10−6; the exponential suppression assumes that discrete wires differ from the surface current density required by the algorithm only by a periodic correction. The discreteness becomes important where the wires are widely spaced because the scale length becomes large, or when the width varies, so that the exponential form is invalid. For example, the winding on a sphere to give a uniform field inside has the wires widely spaced toward the poles with the result that the field is inaccurately produced there.47 

For normal metals, the largest attainable field is set by the limit on surface heating/area PρK2/tρH2/t, where ρ is the resistivity of the windings and t is the effective thickness of the winding layer. For a power density limit P = 1 W/cm2mm, thickness t = 1 mm, and resistivity ρ ≈ 1 μΩ cm, the maximum field is H < 400 Oe. For a superconducting winding, the limit is set by the critical field.

The physical interpretation of the magnetic scalar potential is that its contours on the boundary of a region play the role of an electric fence that confines the tangential component of the field or terminates it to zero outside the region, shearing all magnetic flux lines to exit normal to the boundary. This interpretation is the basis for a general technique that gives a rational and systematic way to construct a hermetic electromagnet that provides a designed field to an accuracy limited only by the discreteness error coming from winding with wires, the accuracy of its construction, and the need to wind as a coil, rather than a collection of disconnected loops.

The author would like to thank Professor Joseph P. Straley for fruitful conversations. This work was supported, in part, by the U.S. Department of Energy, Office of Nuclear Physics, under Contract Nos. DE-SC0008107 and DE-SC0014622 and by the National Science Foundation under Award No. PHY-0855584.

No conflicts of interest to disclose.

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

1.
G. D.
Cates
,
S. R.
Schaefer
, and
W.
Happer
, “
Relaxation of spins due to field inhomogeneities in gaseous samples at low magnetic fields and low pressures
,”
Phys. Rev. A
37
(
8
),
2877
2885
(
1988
).
2.
R. A.
Lemdiasov
, in
RF Coils for MRI
, edited by
J. T.
Vaughan
and
J. R.
Griffiths
(
Wiley
,
2012
), Chap. 26, pp.
327
338
.
3.
I. B.
Khriplovich
and
S. K.
Lamoreaux
,
CP Violation without Strangeness: Electric Dipole Moments of Particles, Atoms, and Molecules
, Theoretical and Mathematical Physics (
Springer
,
Heidelberg, Germany
,
1997
).
4.
M. W.
Ahmeda
 et al (
nEDM Collaboration
), “
A new cryogenic apparatus to search for the neutron electric dipole moment
,”
J. Instrum.
14
,
P11017
(
2019
); arXiv:1908.09937 [physics.ins-det].
5.
C.
Abel
 et al, “
Magnetic field uniformity in neutron electric dipole moment experiments
,”
Phys. Rev. A
99
,
042112
(
2019
); arXiv:1811.06085 [hep-ex].
6.
M.
Maldonado-Velázquez
,
L.
Barrón-Palos
,
C.
Crawford
, and
W. M.
Snow
, “
Magnetic field devices for neutron spin transport and manipulation in precise neutron spin rotation measurements
,”
Nucl. Instrum. Methods Phys. Res., Sect. A
854
,
127
133
(
2017
).
7.
G.
Wyszyński
 et al (
PSI-nEDM
), “
Active compensation of magnetic field distortions based on vector spherical harmonics field description
,”
AIP Adv.
7
(
3
),
035216
(
2017
).
8.
M. A.
Green
, “
High energy physics particle detector magnets
,” in
Encyclopedia of Electrical and Electronics Engineering
(
Wiley
,
New York
,
1999
), pp.
739
752
.
9.
P. L.
Walstrom
, “
Magnetic fields and inductances of cylindrical current sheet magnets
,” Los Alamos National Laboratory Internal Report No. LA-UR-90-4090,
1990
.
10.
R.
Turner
, “
Gradient coil design: A review of methods
,”
Magn. Reson. Imaging
11
,
903
920
(
1993
).
11.
R.
Turner
, “
A target field approach to optimal coil design
,”
J. Phys. D: Appl. Phys.
19
,
L147
L151
(
1986
).
12.
R.
Lemdiasov
and
R.
Ludwig
, “
A stream function method for gradient coil design
,”
Concepts Magn. Reson., Part B: Magn. Reson. Eng.
26B
(
1
),
67
80
(
2005
).
13.
M.
Rawlik
,
A.
Eggenberger
,
J.
Krempel
,
C.
Crawford
,
K.
Kirch
,
F. M.
Piegsa
, and
G.
Quéméner
, “
A simple method of coil design
,”
Am. J. Phys.
86
(
8
),
602
(
2018
).
14.
F.
Glück
, “
Axisymmetric magnetic field calculation with zonal harmonic expansion
,”
Prog. Electromagn. Res. B
32
,
351
388
(
2011
).
15.
H.
Xu
,
S. M.
Conolly
,
G. C.
Scott
, and
A.
Macovski
, “
Homogeneous magnet design using linear programming
,”
IEEE Trans. Magn.
36
(
2
),
476
483
(
2000
).
16.
M. R.
Thompson
,
R. W.
Brown
, and
V. C.
Srivastava
, “
An inverse approach to the design of MRI main magnets
,”
IEEE Trans. Magn.
30
(
1
),
108
112
(
1994
).
17.
H.
Helmholtz
,
Vortrag in der Sitzung 16
, 3rd ed. (
Physikalischen Gesellschaft
,
Berlin
,
1849
).
18.
E. M.
Purcell
,
Am. J. Phys.
57
(
1
),
18
(
1989
).
19.
J. C.
Maxwell
,
Treatise on Electricity and Magnetism
(
Oxford at the Clarendon Press
, 1873), Vol. II, Sec. 715.
20.
M. W.
Garrett
, “
Axially symmetric systems for generating and measuring magnetic fields. Part I
,”
J. Appl. Phys.
22
,
1091
(
1951
).
21.
B. B.
Dasgupta
, “
A novel method of solving electrostatic potential problems
,”
Am. J. Phys.
53
,
971
(
1985
).
22.
P. L.
Walstrom
, “
Magnetic fields from distributions of dipoles on cylindrical surfaces
,” Los Alamos National Laboratory Internal Report No. LA-UR-91-3496,
1991
.
23.
P. L.
Walstrom
, “
Dipole-sheet multipole magnets for accelerators
,”
IEEE Trans. Magn.
30
(
4
),
2471
2474
(
1994
).
24.
L.
Liu
, “
Designing magnets with prescribed magnetic fields
,”
New J. Phys.
13
,
033013
(
2011
).
25.
V. L.
Chechurin
and
M.
Sarma
, “
Computing models for the magnetic field calculation of superconducting electric machines with the help of scalar magnetic potential
,”
IEEE Trans. Magn.
12
(
6
),
1048
1049
(
1976
).
26.
I. R.
Ciric
, “
Formulations of magnetic field problems
,”
J. Appl. Phys.
61
(
8
),
2709
(
1987
).
27.
P. L.
Walstrom
, “
Design of end turns in current-dominated dipole and quadrupole magnets for fields with low higher-harmonic content
,” in
Proceedings of European Particle Accelerator Conference (EPAC)
,
Paris, France
,
2002
.
28.
H. A.
Haus
and
J. R.
Melcher
,
Electromagnetic Fields and Energy
(
Prentice-Hall
,
Englewood Cliffs
,
1989
).
29.
I. D.
Mayergoyz
and
G.
Bedrosian
, “
On calculation of 3-D eddy currents in conducting and magnetic shells
,”
IEEE Trans. Magn.
31
,
1319
(
1995
).
30.
L.
Krähenbühl
and
D.
Muller
, “
Thin layers in electrical engineering: Example of shell models in analysing eddy currents by boundary and finite element methods
,”
IEEE Trans. Magn.
29
(
2
),
1450
1456
(
1993
).
31.
S. R.
Muniz
,
V. S.
Bagnato
, and
M.
Bhattacharya
, “
Analysis of off-axis solenoid fields using the magnetic scalar potential: An application to a Zeeman-slower for cold atoms
,”
Am. J. Phys.
83
,
513
(
2015
).
32.
P. W.
Gross
and
P. R.
Kotiuga
,
Electromagnetic Theory and Computation: A Topological Approach
, Mathematical Sciences Research Institute Publications Vol. 48 (
Cambridge University Press
,
2004
), ISBN: 13: 978-0521801607.
33.
D. M.
Fye
, “
An integral equation method for the analysis of magnetic deflection yokes
,”
J. Appl. Phys.
50
,
17
(
1979
).
34.
K. F.
Warnick
,
R. H.
Selfridge
, and
D. V.
Arnold
, “
Electromagnetic boundary conditions and differential forms
,”
IEE Proc. Microw. Antenn. Propag.
142
(
4
),
326
332
(
1995
).
35.
J. D.
Jackson
,
Classical Electrodynamics
, 3rd ed. (
John Wiley & Sons
,
1999
), Eq. (5.87).
36.
For example COMSOL, www.comsol.com.
37.
C. B.
Hayes
, “
Spin flipper, neutron polarimetry, and simulation, for the n3He experiment
,” Ph.D. thesis,
University of Tennessee
,
2016
, https://trace.tennessee.edu/utk_graddiss/3702.
38.
A. K.
Petoukhov
,
V.
Guillard
,
K. H.
Andersen
,
E.
Bourgeat-Lami
,
R.
Chung
,
H.
Humblot
,
D.
Jullien
,
E.
Lelievre-Berna
,
T.
Soldner
,
F.
Tasset
, and
M.
Thomas
, “
Compact magnetostatic cavity for polarised 3He neutron spin filter cells
,”
Nucl. Instrum. Methods Phys. Res., Sect. A
560
,
480
484
(
2006
).
39.
A. E.
Marble
 et al,
IEEE Trans. Magn.
43
,
1903
(
2007
).
40.
M.
Chari
,
A.
Konrad
,
J.
D’Angelo
, and
M.
Palmo
, “
Finite element computation of three-dimensional electrostatic and magnetostatic field problems
,”
IEEE Trans. Magn.
19
,
2321
(
1983
).
41.
P. A.
Koss
,
C.
Crawford
,
G.
Bison
,
E.
Wursten
,
M.
Kasprzak
, and
N.
Severijns
, “
PCB coil design producing a uniform confined magnetic field
,”
IEEE Magn. Lett.
8
,
1
(
2017
).
42.
R. T.
Avery
,
G. R.
Lambertson
, and
C. D.
Pike
, “
Printed circuit steering coils
,”
IEEE Trans. Nucl. Sci.
18
(
3
),
885
(
1971
).
43.
C. P.
Bidnosti
,
I. S.
Kravchuk
, and
M. E.
Hayden
, “
Active shielding of cylindrical saddle-shaped coils: Application to wire-wound RF coils for low-field NMR and MRI
,”
J. Magn. Reson.
177
,
31
43
(
2005
).
44.
P. L.
Walstrom
, “
Dipole-magnet field models based on a conformal map
,”
Phys. Rev. Spec. Top. Accel. Beams
15
,
102401
(
2012
).
45.
C. B.
Crawford
and
J. P.
Straley
, “
Improved prescription for winding an electromagnet
,”
Rev. Sci. Instrum.
(accepted).
46.
M. G.
Abele
, “
Generation and confinement of uniform magnetic fields with surface currents
,”
IEEE Trans. Magn.
41
(
10
),
4179
4181
(
2005
).
47.
N.
Nouri
and
B.
Plaster
, “
Comparison of magnetic field uniformities for discretized and finite-sized standard cos θ, solenoidal, and spherical coils
,”
Nucl. Instrum. Methods Phys. Res., Sect. A
723
,
30
35
(
2013
).