**Research article**
04 Aug 2021

**Research article** | 04 Aug 2021

# Magnetostatic reciprocity for MR magnet design

Pedro Freire Silva, Mazin Jouda, and Jan G. Korvink

**Pedro Freire Silva et al.**Pedro Freire Silva, Mazin Jouda, and Jan G. Korvink

- Karlsruhe Institute of Technology (KIT), Institute of Microstructure Technology, 76131 Karlsruhe, Germany

- Karlsruhe Institute of Technology (KIT), Institute of Microstructure Technology, 76131 Karlsruhe, Germany

**Correspondence**: Jan G. Korvink (jan.korvink@kit.edu)

**Correspondence**: Jan G. Korvink (jan.korvink@kit.edu)

Received: 20 Mar 2021 – Discussion started: 26 Apr 2021 – Revised: 23 Jun 2021 – Accepted: 29 Jun 2021 – Published: 04 Aug 2021

Electromagnetic reciprocity has long been a staple in magnetic resonance (MR) radio-frequency development, offering geometrical insights and a figure of merit for various resonator designs. In a similar manner, we use magnetostatic reciprocity to compute manufacturable solutions of complex magnet geometries, by establishing a quantitative metric for the placement and subsequent orientation of discrete pieces of permanent magnetic material. Based on magnetostatic theory and non-linear finite element modelling (FEM) simulations, it is shown how assembled permanent magnet setups perform in the embodiment of a variety of designs and how magnetostatic reciprocity is leveraged in the presence of difficulties associated with self-interactions, to fulfil various design objectives, including self-assembled micro-magnets, adjustable magnetic arrays, and an unbounded magnetic field intensity in a small volume, despite realistic saturation field strengths.

- Article
(2275 KB) -
Supplement
(721 KB) - BibTeX
- EndNote

Magnetic field generation is an intrinsic requirement of magnetic resonance (MR) equipment, providing both the source of Zeeman polarisation and the precession field. Despite a sharp dependence of the MR sensitivity on field intensity, the high cost of superconducting magnets has resulted in an increase in the use and development of compact permanent-magnet systems, starting in the 1980s (Zakotnik and Tudor, 2015) with the discovery of high-remanence and high-coercivity magnetic materials, such as neodymium-based alloys. As better detection methods, hyperpolarisation techniques, and excitation schemes lower limits of detection, new applications based on these magnet systems have been made possible by offsetting the signal-to-noise ratio (SNR) loss stemming from the reduced magnetic field intensity. Beyond a cost reduction, permanent magnets have allowed for portable and non-standard MR applications and can be divided into narrow-bore spectroscopy magnets (Danieli et al., 2010; Chonlathep et al., 2017), large-bore imaging magnets (Hugon et al., 2010; Soltner and Blümler, 2010; Windt et al., 2011; Cooley et al., 2018), and other speciality magnets providing an external homogeneous volume (Utsuzawa and Fukushima, 2017; Paulsen et al., 2008; Chang et al., 2011; Marble et al., 2007; Manz et al., 2006), profiling gradients (Rahmatallah et al., 2005; Landeghem et al., 2012; Chang et al., 2006; Marble et al., 2006; Luo et al., 2018), or pre-polarisation fields (Tayler and Sakellariou, 2017; Raich and Blümler, 2004).

Despite the numerous published concepts, several key bottlenecks and cost factors remain, hindering the design and construction of suitably good-quality magnet systems. Reported challenges include the complexity in using tens of source magnets (Hugon et al., 2010; Soltner and Blümler, 2010; Raich and Blümler, 2004), a magnetisation strength error (Hugon et al., 2010; Soltner and Blümler, 2010; Raich and Blümler, 2004) of 1 %, a magnetisation direction error (Hugon et al., 2010) of 2^{∘}, and a magnet size error (Raich and Blümler, 2004) of 0.1 mm, as well as experimental difficulties regarding assembly–alignment errors and the large forces associated with strong permanent magnets. As target inhomogeneities in MR lie below the parts-per-million (ppm) range, a priori magnet deviations of 1 % constitute a massive obstacle in achieving high-homogeneity magnets. Current methodology requires, for example, the time-consuming analysis of each magnet in a large pool, so as to use only the most similar magnets (Hugon et al., 2010), the individual characterisation and ordering of an array to reduce inhomogeneity (Hugon et al., 2010; Soltner and Blümler, 2010; Cooley et al., 2018), or the use of high-precision mechanical adjustment systems (Danieli et al., 2010). All of these approaches limit the number of magnets in a system and, as a result, the final field homogeneity. These efforts are often not possible or sufficient, and thus additional passive shimming techniques are required (Hugon et al., 2010), in addition to active shimming.

So as to overcome these limitations, and building upon the self-assembly idea mentioned in Chandrana et al. (2015), the long-known principle of magnetostatic reciprocity, also known as Betti's theorem (Insinga et al., 2016b; Mikhlin, 1964; Betti, 1872), was considered for generalised MR permanent magnet design. Geometrical reciprocity is ever-present in MR in the form of electromagnetic reciprocity from Hoult and Richards (1976), which creates a correspondence between a current distribution in the MR detection coil and the signal induced in it. Similarly, one can deduce a reciprocity between two regions in space and the magnets/fields contained therein. This allows for the quantitative *evaluation* of proposed magnet designs as well as for the planning of the *assembly* of the geometry. An easier alignment and assembly allows for the use of a larger number of discrete magnets, which in turn allows for the discretisation of magnetisation distributions with better fidelity, and the use of smaller, cheaper, and safer magnets (Zakotnik and Tudor, 2015).

The principle and its direct and indirect consequences are initially discussed in Sect. 2.1, subsequently enabling the computation of a material-independent figure of merit for magnetic systems in Sect. 2.2. In a similar analytical approach, the impact of an increasing number of magnets on the field quality of a Halbach array was researched, in Sect. 2.3, to showcase the benefits of being able to handle a larger number of magnets.

To demonstrate the breadth of possibilities and insights allowed when designing with the principle, three different applications were proposed. The first leverages the minimum-energy state that comes with maximum magnetic coupling, for an easier auto-assembly of a Halbach magnet, and is shown in Sect. 5.1. A second application proposes an arbitrarily chosen development goal and shows how the reciprocity principle can elucidate the design process on each step, allowing for the complex behaviour shown in Sect. 5.2. The final application maximally leverages the principle, enabling a topological optimisation method to obtain the highest possible magnetic field in a single-sided magnet, which shows an unbound magnetic field strength in Sect. 5.3. The methods used for simulation, material modelling, and result post-processing are shown before the exposition of numerical results, in Sect. 3, for clarity, and can all be implemented and run on a standard laptop within a few minutes to hours. The paper concludes with a discussion of the results and an outlook for the technique in Sect. 6.

## 2.1 Principle corollaries

Consider an ensemble of magnetic sources *M*, a magnet being designed, and *A*, an “anchor” magnet serving as support tool, either virtual or real, for the design and assembly of *M*. Defining both through their magnetisation *M*, generating the magnetic field *H*_{A} and *H*_{M} in space, the energy reciprocity between the two can be stated as per Jeans (1908):

In other words, the magnetic vector potential's equivalent magnetic moment *M*_{A} has an energy in the magnetic moment's external field *H*_{M} that is equal to the energy of the original magnetic moment *M*_{M} in the external field of the vector potential *H*_{A}. If one assumes high-coercivity magnets with an effective tensorial permeability *μ*_{0}*μ*_{r} and remanent field *B*_{r}, i.e. a model which approximates the behaviour of common hard magnetic materials such as NdFeB compounds well, it is possible to set $M=({\mathit{\mu}}_{\mathrm{r}}-\mathrm{1})H+{\mathit{\mu}}_{\mathrm{0}}^{-\mathrm{1}}{B}_{\mathrm{r}}$. Taking the integration volume ℝ^{3} to volumes where *M* is non-zero, i.e. *V*_{M} and *V*_{A}, one can transform Eq. (1) to

Whereas a solution where only the first two terms hold would yield a formal statement allowing for the superposition of fields, such an interpretation remains an approximation when developing MR applications, as the permeability of samples and magnets will naturally differ. One can nonetheless estimate the validity of this approximation, as it is dominated by the relative amplitude of the term in parenthesis with respect to the first one on the right. Beyond being a differential term with a similar integrand and integration volumes, namely when the magnet and the anchor are similarly sized, both terms are further multiplied by a reductive coefficient, (*μ*_{r}−1), quite small in the case of neodymium magnets (${\mathit{\mu}}_{\parallel}=\mathrm{1.03}$ and ${\mathit{\mu}}_{\perp}=\mathrm{1.12}$, Katter, 2005). This clearly shows how the first term on the right remains dominant, energy-wise, and one can thus approximate the coupling of two magnets through a linear superposition.

Equation (1) holds for an arbitrarily small *M*, which indicates that a higher anchor field in a location will also mean a larger contribution to the target field from magnetisation located there. Similarly, the discussed method does not elucidate the boundary design which leads to an homogeneous target field.

If one defines a target magnetic field to be generated inside the anchor volume as ${B}_{\mathrm{target}}=-{B}_{{\mathrm{r}}_{\mathrm{A}}}$, in Eq. (2), one can see how maximum compliance with the target field (i.e. *B*_{target}⋅*H*_{M} being maximal or the field from the magnet under design being parallel to the desired/target direction) corresponds to the minimum magnetostatic energy condition (i.e. ${B}_{{\mathrm{r}}_{\mathrm{M}}}$ and *H*_{A} being anti-parallel or at the lowest energy orientation). This corollary indicates that a freely rotating magnet will tend to the direction that better generates the target field needed to minimise the energy with the anchor magnet, thus providing the force needed for *self-assembly*.

Just as this effect proves the hypothesis stated in Chandrana et al. (2015), used to auto-assemble eight magnets into a Halbach (Halbach, 1980) array, it also elucidates an important limitation that arises, namely that of the self-interaction of the designed magnetisation distribution. The ideal magnetisation distribution has a minimum energy in the interaction with the anchor magnet but not on its self-interaction energy, which has it evolving to a global energy minimum. For this reason, each individual magnet must be aligned individually, or the self-interaction must be countered with secondary magnetic fields, so as to have a high-fidelity reproduction of the ideal distribution.

## 2.2 Coupling parameter

Knowing the remanent field distribution that maximises the magnetic field in one volume, one can thus compute the efficiency of an array in matching that distribution. In the case shown, the volume that can be filled with magnet material is contained between ∂*A* and ∂Ω, corresponding to the domain Ω. The outer boundary is defined as the weakest contour line of *H*_{A} that intersects *M*, as indicated in Fig. 1, but this definition can be adapted depending on the application and may be replaced by a symmetry line (e.g. profilometry applications can only populate a half-space). On this volume, one can compute the coupling parameter *η*, which computes how well the magnet under design, defined by its normalised remanent magnetisation ${b}_{\mathrm{r}}={B}_{\mathrm{r}}/max\left(\right|{B}_{\mathrm{r}}\left|\right)$, is aligned with the field created by the anchor, as per

For example, in an ideal 2D Halbach magnet with *η*=1, the target field has perfectly circular contour lines, so that Ω is bounded by the least contributing magnetisation, the outer diameter of the magnet array, and the boundary of the circular sample, the inner diameter of the magnet array. These match exactly the placement and direction of magnets in an ideal 2D Halbach array, and the coupling is thus optimal. Real implementations with suboptimal filling factors or supporting structures will however have *η*<1. The coupling parameter compares designs quantitatively and provides a computable cost to inefficient but necessary design techniques, like introducing a dead volume to increase homogeneity (Hugon et al., 2010; Soltner and Blümler, 2010), using an anti-aligned piece to cancel first-order field gradients (Manz et al., 2006; Perlo et al., 2006) or overextending a magnet to emulate an infinite height (Paulsen et al., 2008).

## 2.3 Arrangement of *n* magnets

A design choice that often directly impacts the performance and complexity of a magnetic arrangement is the number of individual parts involved. A large number of these will self-evidently allow for a better discretisation of a desired magnetisation profile. This introduces the possibility of a stronger magnetic field, by better matching the functional introduced in Eq. (3), but the dependence on the experimental effects governing field inhomogeneity remains unclear.

For high-homogeneity applications using permanent magnets, the centre of a 2D discrete Halbach field remains the ideal placement area for a test sample, due to a saddle point of the magnetic field intensity in the axis of the arrangement. A symmetrical placement of four magnets, or a combination thereof, will show a saddle point with zero first and second derivatives of the field intensity. This means that any deviation from an ideally built discrete array can be modelled well, locally, by the total effect of each contribution on its directional, first-order derivative at the origin.

Consider the magnetic field generated by one 2D cylindrical magnet of radius *r*_{0} and uniform magnetisation *M*_{0}, as per Jeans (1908), with an angle defined by a rotation matrix **R**_{θ} and placed at *{**x*_{0},*y*_{0}*}*:

Summing the effect of various cylinders allows for the analytical description of the field generated by an array of *n* magnets in a Halbach configuration, placed on the unitary circle:

This equation enables the computation of $\mathrm{\nabla}\left|{B}_{H}\right|\cdot v$ at the origin, for an increasing number of magnets. Assuming that the experimental uncertainty in magnetisation intensity, angular direction, and piece dimensions has a small relative deviation, *ϵ*_{i}, one can use the small angle approximation and obtain the following figures of merit (FOM):

In Eqs. (6) and (7), one arrives at a total inhomogeneity that is dominated by a weighed linear sum of the various effects. Assuming that *ϵ*_{i} has a Gaussian distribution around a zero mean, it becomes clear that the field inhomogeneity will increase as $\sqrt{n}$ as the sum of statistically independent distributions of the magnet's behaviour.

Due to a linear superposition, the field scales with the number of magnets, *n*, while the effects dominating the inhomogeneity of the field, originating from fabrication errors, scale as $\sqrt{n}$, which means an overall improvement of the relative field inhomogeneity of $\mathrm{1}/\sqrt{n}$. This shows a deep incentive in increasing the total number of magnets in an assembly, which follows common fabrication approaches (Hugon et al., 2010; Soltner and Blümler, 2010; Raich and Blümler, 2004).

Given the scale independence of the laws governing magnetic fields, it becomes natural to normalise all the reported values so that their use is straightforward across materials and application sizes. For this reason, all values shown are presented as adimensional. Magnetic field flux intensity is normalised per unit remanent field *B*_{r}, meaning field intensity will scale directly with remanence improvements, provided permeability stays constant and coercivity scales accordingly. Dimensions are shown normalised by a constant length, critical to the application, and explicitly defined. The norm of field intensity gradients is normalised by *B*_{r} and multiplied by the characteristic length, to remove scale/material effects. Magnetic field inhomogeneity was defined as the relative standard deviation of the magnitude of the magnetic field, in a specific volume, and is thus shown in adimensional parts per million (ppm).

## 4.1 FEM solver

The simulations presented were performed in a commercial FEM solver (COMSOL Multiphysics, COMSOL AB) by solving for the scalar magnetic potential, related to the magnetic field intensity as $H=-\mathrm{\nabla}{V}_{\mathrm{m}}$, with ${\mathit{\mu}}_{\mathrm{0}}\mathrm{\nabla}\cdot (H+M)=\mathrm{0}$. No placement, magnetisation, or angular errors were considered due to their demonstrably reducible impact. A linear constitutive relation was used, as explained in Sect. 2.1, and the validity of the model was checked after each simulation. Built-in routines controlling the convergence of the mesh and numerical error were used to guarantee residual errors below 1 % for all numerical values shown.

## 4.2 Magnetic material model

NdFeB magnets, due to their high coercive strength, are often modelled (Halbach, 1980) with a constant marginal isotropic permeability (*μ*_{r}=1.05) and a constant remanent field for $M=({\mathit{\mu}}_{\mathrm{r}}-\mathrm{1})H+{\mathit{\mu}}_{\mathrm{0}}^{-\mathrm{1}}{B}_{\mathrm{r}}$. This is clear when observing simulated Halbach homogeneity profiles with radially repeating patterns and is a crude approximation of the real non-linear anisotropic response. For this reason, and due to the difficulty in obtaining a complete model for NdFeB magnets, the values used were those reported in Katter (2005) due to their completeness: *B*_{r}=1.15 T, $H{c}_{\mathrm{0}{}^{\circ}}=\mathrm{3.0}$ T, $H{c}_{\mathrm{45}{}^{\circ}}=\mathrm{3.0}$ T, $H{c}_{\mathrm{90}{}^{\circ}}=\mathrm{5.6}$ T, ${\mathit{\mu}}_{\parallel}=\mathrm{1.03}$, and ${\mathit{\mu}}_{\perp}=\mathrm{1.12}$. These remanence and permeability values along with the directional coercivity were taken as a phenomenological model, shown in Fig. 5d, and are coherent with the results shown in Martinek and Kronmüller (1990). Experimentally, one can nonetheless employ existing commercial grades of neodymium with better performance characteristics, for improved results.

## 4.3 Energy minimisation

Some of the applications presented require self-alignment of arrays and thus the discovery of the equilibrium position. This is achieved in each case with a magnetostatic energy minimisation subroutine, which finds the local or global equilibrium position. This configuration is then used to compute the behaviour of the field, in each application.

In Sect. 5.1, computing the non-corrected discrete Halbach array, a simple routine was used to iterate the angle *α*. The corrected alignment was then entered directly for comparison, but a check that a correction piece would be possible was performed beforehand.

When extrapolating to a continuous magnetisation distribution, this energy minimisation routine was performed on a scalar field, the angle of the magnetisation distribution on the available volume. The initial values were the Halbach distribution, as only a small perturbation is expected, allowing for a fast convergence. To guarantee this would be the global energy minimum, which is a non-trivial expectation because the magnet becomes much larger than the anchor, symmetry boundary conditions were removed, and the initial condition was set to be the one achieved after uniform magnetisation with a strong external field, as would be the case for a fabrication setting. The algorithm, despite not representing a physical evolution, returned a near-Halbach configuration even for the largest magnet, indicating that it would be the end configuration.

In Sect. 5.2, due to the rotational sectional symmetry of the design, only 1 of the 20 sectors was simulated, which assumes simultaneous and identical rotation of all magnets. An energy minimisation routine was used to find the equilibrium rotation angle of the cylinders when specifying the control array at each control position.

## 4.4 Topology optimisation

In Sect. 5.3, density-based topology optimisation was employed through the maximisation of the objective function *f*_{OBJ} using the solid isotropic material with penalisation (SIMP) method (Bendsoe and Kikuchi, 1988). The functional increased the magnetic field norm at height 1, while reducing the non-binary state of the density with the term *ρ*(1−*ρ*), ensuring a sharp transition using the term $\left|\mathrm{\nabla}\mathit{\rho}\right|$ and guaranteeing that the magnetic field remains within the constrains of the linear model through the 2D Heaviside function Θ(*B*−*μ*_{0}*H**c*), to avoid demagnetisation:

The density was linear in the remanent magnetisation and had an initial value of 1. Several steps were used, with various size-dependent *k*_{i} and mesh density, using both the globally convergent method of moving asymptotes (GCMMA in Svanberg, 2002) and sparse non-linear optimiser (SNOPT in Gill et al., 2002) algorithms, to allow for convergence of the density.

## 5.1 Auto-alignment

An impactful application of the reciprocity principle is the automatic assembly targeting micro-scale applications, which, due to the small dimensions and the large relative forces involved, make assembly especially challenging. To best showcase the possible approaches, a micro-array and a powder magnet were simulated in their self-alignment and corrected alignment, attained through application-dependent correction pieces.

A Halbach micro-array was initially conceived to be deposited as a single material layer on a substrate, uniformly magnetised, and allowed to self-align. This enables the use of a low fringe-field design, with a strong field intensity, in integrated applications, while using any desired magnetic material. A quarter of the array was simulated as a 2D model, with sizes ranging up to the maximum packing of eight circles in the available space Ω, between the normalised inner radius and *d*_{M}.

The results in Fig. 2 clearly show the impact of outer radius *d*_{M} on field strength and homogeneity for one eight-magnet ring, which is further exacerbated as several magnet rings are employed. An improvement of 2 orders of magnitude is seen on the homogeneity, as first-order field gradients cancel out in the correct alignment, thus showing that correction is a critical step. From Fig. 2a, it is clear that the procedure uses only indirect handling of the magnets and requires only sequential liberation and fixation of magnets. The resulting ease of fabrication and the scale invariance of permanent magnets make these ideal for downscaling magnetic arrays to a length scale far below what is currently achievable for complex arrays.

A natural follow-up to the results shown is the evolution from a finite number of well-defined magnetic structures to arbitrarily many, much like in a powder magnet. These allow for easy tooling, the drastic reduction of statistical variance errors as seen in Sect. 2.3 (by shifting these to fabrication precision), and large height micro-magnets, overcoming sputtering height limitations. A powder can reach a maximal theoretical sphere packing density of 74 % in a face-centered cubic (FCC) or hexagonal close-packed (HCP) lattice but, without correct placement, will reach a random packing after vibration annealing, of 64 % (Jaeger and Nagel, 1992). A mix of powders of staggered sizes can however reach arbitrarily close to a 100 % packing factor, as smaller powders fill the gaps left by larger pieces or even emulate a single phase with composite effects. Using two powder species with different temperature coefficients of remanence, *α*, one positive and one negative, it is possible to locally cancel temperature-induced drifts in field strength or even offset volume drifts by tuning the expansion of the binding agent. A thermally compensated mix of NdFeB (*B*_{r}=1.45 T, $\mathit{\alpha}\approx -\mathrm{0.12}$ % K^{−1}) and SmEr (*B*_{r}=0.89 T, $\mathit{\alpha}\approx +\mathrm{0.11}$ % K^{−1} in (Chen et al., 2002), for example, shows an effective packing density of 75 % when compared to NdFeB alone.

Using a procedure analogous to the one in Fig. 2a, Fig. 3 shows that the auto-alignment of a magnetic powder structure is also possible and able to provide a significant field intensity while leveraging all of the advantages mentioned above. Field intensity is seen to level off as the self-interaction of the powder dominates over the alignment field of the anchor, which indicates a need for the use of correction structures. This is further emphasised by the large inhomogeneity gap between the self-aligned and the Halbach conditions. Due to the complexity of the endeavour and its application-specific nature, further investigation of this effect was deemed to be outside of the scope of the present paper. As a baseline, the ideal Halbach alignment was also simulated, which explicitly shows the critical effect of disregarding the marginal susceptibility in hard magnetic materials.

Whereas a full theoretical Halbach possesses zero inhomogeneity, the real response of the magnetic material to the demagnetising field significantly alters this expectation to the behaviour, as shown in Fig. 3b.

## 5.2 Adjustable operation

One of the advantages of an auto-assembled magnet is the ease at which it can be put together, usually a secondary concern, as homogeneous MR magnets are only assembled once and then used in a static assembly. Similarly, MR profiling magnets are *set* for a specific working condition, and thus field strength, discernible slice thickness, and penetration depth become magnet parameters that cannot be subsequently changed. However, with an auto-adjusting application, one could dynamically tune the operational conditions as needed, making use of the coupling force introduced by a tuning piece.

By solving the inverse problem, the reciprocity principle readily facilitates application development and the interpretation of results. The authors set out to generate an adjustable profiling magnet with a large penetration depth. These magnets, used to analyse the behaviour of a planar 2D slice parallel to the top surface of the magnet, require a field gradient along the penetration depth that is laterally uniform, that is, to have the frequency of the observable spins vary only along the slices but not inside them. As an initial step, relying on reciprocity, an anchor was set at different heights above a plane, below which magnets could be placed. The variation of the field direction on the design region, as the anchor is moved, reciprocally indicates the variation the magnets need to have to adjust to a target field at different penetration depths, as illustrated in Fig. 4a, with rotating cylinders. This rotation can then be induced mechanically or with a magnetic control piece. Once more leveraging the principle, the contribution of each point in space to the field on the anchor space and on the cylinder space can be computed. With these, one can optimally find the region in space which strongly interacts with the cylindrical array, inducing torque, but it has a minimum contribution to the target field, reducing any adverse effects. These pieces were implemented as cubes, for simplicity, as seen in Fig. 4a.

The application requires a sectional symmetry to generate the nearly axially symmetric field which allows for a minimal discernible slice. As the alignment of all magnets at the same rotation angle is a meta-stable configuration of the cylinder array, a scaffold is needed to maintain the relative angular positions. A stable configuration of the coherent cylinder array is a parallel orientation pointing upwards/downwards, and, due to the desired high packing density, the strong interaction between the cylinder array elements makes it hard to shift the configuration away from its minimum energy alignment. For this reason, a set of control pieces with identical upward magnetisation is placed between the polarising magnets, creating a local energy minimum somewhat shallower than the absolute minimum, which allows for adjusting the strongly aligned magnet array with smaller pieces. The figures of merit of the profiling magnet assembly are its field strength, its penetration depth, and the discernible slice thickness. The minimum discernible thickness comes from the condition that the frequency variation along the penetration depth be greater than that within a slice of thickness *T* (i.e. *T**γ*∇_{z}*B*>Δ*ω*_{slice}) and was implemented, for the field in a cylindrical slice of radius *R*, as

Due to the scale invariance of the field profile, all dimensions were normalised to the outer diameter of the available design volume (i.e. the magnet), and the geometry was obtained as follows.

From the results in Fig. 4 and Table 1, the achieved results, beyond their novel continuous-tuning ability, outperform other reported designs and simulations in penetration depth, while having similar values of discernible thickness and field intensity/gradient, when compensating for the unavoidable distance decay. Further optimisation on the packing density was not attempted, as limits are fabrication-dependent, and the centre was left unpopulated to allow for radio-frequency (RF) coils, meaning the performance could be increased further significantly.

Rahmatallah et al. (2005)Landeghem et al. (2012)Chang et al. (2006)Marble et al. (2006)## 5.3 Optimised coupling

Beyond the applications shown, which emphasise fabrication and readjustment, the principle shown here is especially well suited for the design of strong magnets, as it near-optimally removes the degrees of freedom associated with angular alignment and mass-optimal magnet placement, which allows for development through shape/topology optimisation.

As the field of spectroscopic NMR evolves, with experiments now being done in volumes below (5 nm)^{3} using NV centre spectroscopy (Staudacher et al., 2013), superconducting magnets remain the most expensive and obtrusive element of the experimental setup. As an alternative, we set out to create the strongest possible field using permanent magnets in a geometry that allows for easy access, such as a magnet integrated into a laboratory table, and with axial symmetry, to allow for easier fabrication and assembly. Such a setup would enable a passive, low-cost magnet with an encapsulation allowing for temperature control and multidirectional access to optical instrumentation or sample feed lines.

A critical limitation of external fields is that of strong gradients, as the field decays away from the magnet. Approaches based on creating a saddle point were researched and, when compared to the achieved solutions, were found to have a drastically reduced magnetic field intensity. Given the targeted application of small-scale experiments, the use of electromagnetic coils to correct for the axial gradient is far better suited, considering the scaling of field gradients and power consumption at reduced scales.

As a starting point, magnetostatic reciprocity presets the optimal magnetisation direction on the half-space, a dipole field (Seleznyova et al., 2016) centred at a normalised height of 1 above the plane and defined by its polar angle *θ*:

The contour lines for the intensity of the field determined the optimal placement of the magnets to be a half-ellipsoid with a smallest axis/radius of *R*_{M}. This result is reminiscent of a Halbach configuration, which is known to have a logarithmic dependence on the outer radius. However, these must maintain a fully packed geometry to achieve homogeneity and thus quickly generate a demagnetised area with larger outer radii (Insinga et al., 2016a), which limits field intensity. To overcome this, a routine was established to optimally remove voxels which would become demagnetised. As the removal of a volume sharply impacts the demagnetising field on the nearest neighbours, an iterative algorithm was necessary, and thus density-based topology optimisation techniques were used, obtaining the results shown in Fig. 5.

The field intensity is seen to quickly attain a Halbach-like logarithmic scaling as the magnet becomes large (*R*_{M}>2) compared to the normalised height and maintains the logarithmic growth, albeit less pronounced, as demagnetised regions start being removed (*R*_{M}>100). The coupling parameter explained through Eq. (3) is especially well suited to quantitatively evaluate designs focused on intense magnetic fields. Before removal of magnetic material, the results are close to unity and subsequently diminish as volumes with a large effect must be removed to avoid demagnetisation, showing the reduced efficiency of further increasing the amount of magnetic material. Values of *η* above 1, while generally unexpected, are caused by the demagnetising field direction matching the alignment of the magnetisation at the centre/tip of the design, constructively magnetising that region. These results open a new avenue towards low-cost, high-performance spectroscopy and can easily be generalised, due to their scale independence, to any field requiring strong localised magnetic fields, such as those needed for magnetic resonance force microscopy.

The results presented in this paper offer several insights into the development of permanent magnet systems for MR. By establishing a quantifiable metric for what constitutes a good magnet design, a beneficial dependence on the use of multiple magnets, and a way to auto-align them, along with some exemplary applications of these methods, the authors hope to facilitate the future development of high-performance designs and to promote the integration of advanced numerical and experimental techniques into a now further constrained problem.

As discussed, the reciprocity principle establishes a method for developing an intensity-optimal magnet, which should be thought of as the ultimate goal of the MR magnet designer, as the field's homogeneity can then be targeted through a wealth of solutions. Despite its broad applicability and usefulness, the original principle harboured an intrinsic limitation by relying on the superposition of linear responses, which breaks down when strong non-linear effects are present. Unfortunately, these are central to state-of-the-art solutions, which nevertheless have generated impressive results up to 4 T (Kumada et al., 2001), by leveraging the saturation magnetisation of soft-magnetic materials of up to 2.8 T (Mehedi et al., 2017). On the other hand, the breakdown of linearity poses severe challenges in the development of shimming systems, and design trade-offs must thus be made.

The results further emphasise the need for a large filling factor of the magnet, as this has a large effect on the magnet's coupling parameter and thus volume and cost. This approach requires a removal of in-bore passive shimming systems, which must be placed outside, or the use of other approaches. External shimming systems could benefit from the negligible fringe field of Halbach magnets, for example, or even aid with the reduction of the demagnetisation field. Alternatively, given the extreme homogeneity values required for spectroscopy, other approaches are likely to dominate given the lack of fabrication procedures at high enough precision and the ability to target constant field deviations through other means. As sample sizes become smaller, the use of active shimming becomes more favourable as the power efficiency of shimming coils increases and the absolute power dissipation decreases, with an approximate dependence of *l*^{−1} (Korvink et al., 2019). If the magnet size remains constant and the sample/shims are downscaled, a linear shimming profile generating the same field will span a larger gradient in the smaller enclosed volume, which introduces a further geometrical scaling factor of *l*^{−1}.

On the other hand, field inhomogeneity does not constitute a fundamental problem for NMR, as it only reduces the net measured signal and not the local contributions. This effect comes naturally from local dephasing, which has successfully been targeted with “shimming” RF pulses (Topgaard et al., 2004), which can periodically or continually compensate for any local deviation in phase.

Lastly, the authors targeted self-aligning arrays, which have long been an interesting phenomenon that can now be brought to MR by leveraging two of their intrinsic advantages. While self-interaction will always pose a constraint, requiring correction, a large part of the magnetostatic energy and thus the forces involved are already associated with the desired effect, through the use of an anchor magnet. This means that the forces associated with correction and assembly, even when manual, can be significantly reduced, making these two-step processes easier, as shown by the simple correction pieces employed in Fig. 2, which easily solve the limitations mentioned in Chandrana et al. (2015). Additionally, the ability to auto-align an array appears to be the only way to break free from deviations caused by the use of a limited number of magnets, which in turn limit the overall repeatability of designs, leaving them susceptible only to assembly/scaffold-fabrication offsets.

COMSOL files used to obtain all results shown are attached in the Supplement.

No raw data were used apart from the cited material parameters introduced in the COMSOL simulations.

The supplement related to this article is available online at: https://doi.org/10.5194/mr-2-607-2021-supplement.

PFS and JGK developed the concept. PS developed the theory, and conducted the simulations. PFS, MJ, and JGK wrote the paper.

The authors declare that they have no conflict of interest.

Publisher’s note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

The authors would like to thank Erwin Fuhrer, Neil MacKinnon, and Yongbo Deng for helpful and fruitful discussions. Pedro Freire Silva acknowledges Bürkert GmbH & Co. KG for funding. Jan G. Korvink and Mazin Jouda acknowledge the DFG funding.

This research has been partially supported by the DFG (contract nos. KO 1883/29-1 and KO 1883/34-1) and Bürkert GmbH & Co. KG.

The article processing charges for this open-access publication were covered by the Karlsruhe Institute of Technology (KIT).

This paper was edited by Robert Tycko and reviewed by Alexej Jerschow and two anonymous referees.

Bendsoe, M. P. and Kikuchi, N.: Generating Optimal Topologies in Structural Design Using a Homogenization Method, Comput. Method. Appl. M., 71, 197–224, https://doi.org/10.1016/0045-7825(88)90086-2, 1988. a

Betti, E.: Nuovo Cimento, 7 and 8, 5–21, 69–97, 158–180, 1872. a

Chandrana, C., Neal, J., Platts, D., Morgan, B., and Nath, P.: Automatic alignment of multiple magnets into Halbach cylinders, J. Magn. Magn. Mater., 381, 396–400, https://doi.org/10.1016/j.jmmm.2015.01.011, 2015. a, b, c

Chang, W.-H., Chen, J.-H., and Hwang, L.-P.: Single-sided mobile NMR with a Halbach magnet, Magn. Reson. Imaging, 24, 1095–1102, https://doi.org/10.1016/j.mri.2006.04.005, 2006. a, b

Chang, W.-H., Chung, C.-Y., Chen, J.-H., Hwang, D. W., Hsu, C.-H., Yao, C., and Hwang, L.-P.: Simple mobile single-sided NMR apparatus with a relatively homogeneous *B*_{0} distribution, Magn. Reson. Imaging, 29, 869–876,
https://doi.org/10.1016/j.mri.2011.02.026, 2011. a

Chen, C. H., Gong, W., Walmer, M. H., Liu, S., and Kuhl, G. E.: Behavior of some heavy and light rare earth-cobalt magnets at high temperature, J. Appl. Phys., 91, 8483, https://doi.org/10.1063/1.1453324, 2002. a

Chonlathep, K., Sakamoto, T., Sugahara, K., and Kondo, Y.: A simple and low-cost permanent magnet system for NMR, J. Magn. Reson., 275, 114–119, https://doi.org/10.1016/j.jmr.2016.12.010, 2017. a

Cooley, C. Z., Haskell, M. W., Cauley, S. F., Sappo, C., Lapierre, C. D., Ha, C. G., Stockmann, J. P., and Wald, L. L.: Design of Sparse Halbach Magnet Arrays for Portable MRI Using a Genetic Algorithm, IEEE T. Magn., 54, https://doi.org/10.1109/TMAG.2017.2751001, 2018. a, b

Danieli, E., Perlo, J., Blümich, B., and Casanova, F.: Small Magnets for Portable NMR Spectrometers, Angew. Chem. Int. Edit., 49, 4133–4135, https://doi.org/10.1002/anie.201000221, 2010. a, b

Gill, P. E., Murray, W., and Saunders, M. A.: SNOPT: an SQP algorithm for large-scale constrained optimization, SIAM Rev., 12, 99–131, https://doi.org/10.1137/S0036144504446096, 2002. a

Halbach, K.: Design of permanent multipole magnets with oriented 75 rare earth cobalt material, Nucl. Instrum. Methods, 169, 1–10, https://doi.org/10.1016/0029-554X(80)90094-4, 1980. a, b

Hoult, D. and Richards, R.: The signal-to-noise ratio of the nuclear magnetic resonance experiment, J. Magn. Reson., 24, 71–85, https://doi.org/10.1016/0022-2364(76)90233-X, 1976. a

Hugon, C., D’Amico, F., Aubert, G., and Sakellariou, D.: Design of arbitrarily homogeneous permanent magnet systems for NMR and MRI: Theory and experimental developments of a simple portable magnet, J. Magn. Reson., 205, 75–85, https://doi.org/10.1016/j.jmr.2010.04.003, 2010. a, b, c, d, e, f, g, h, i

Insinga, A., Bahl, C., Bjoerk, R., and Smith, A.: Performance of Halbach magnet arrays with finite coercivity, J. Magn. Magn. Mater., 407, 369–376, https://doi.org/10.1016/j.jmmm.2016.01.076, 2016a. a

Insinga, A. R., Bjørk, R., Smith, A., and Bahl, C. R. H.: Globally Optimal Segmentation of Permanent-Magnet Systems, Phys. Rev. Appl., 5, 064014, https://doi.org/10.1103/PhysRevApplied.5.064014, 2016b. a

Jaeger, H. M. and Nagel, S. R.: Physics of the Granular State, Science, 255, 1523–1531, https://doi.org/10.1126/science.255.5051.1523, 1992. a

Jeans, J.: The Mathematical Theory of Electricity and Magnetism, Cambridge U. Press, Cambridge, England, https://doi.org/10.1038/078537a0, 1908. a, b

Katter, M.: Angular dependence of the demagnetization stability of sintered Nd-Fe-B magnets, IEEE T. Magn., 41, 3853–3855, https://doi.org/10.1109/TMAG.2005.854872, 2005. a, b

Korvink, J. G., MacKinnon, N., Badilita, V., and Jouda, M.: “Small is beautiful” in NMR, J. Magn. Reson., 306, 112–117, https://doi.org/10.1016/j.jmr.2019.07.012, 2019. a

Kumada, M., Fujisawa, T., Hirao, Y., Endo, M., Aoki, M., Kohda, T., Bolshakova, I., and Holyaka, R.: Development of 4 tesla permanent magnet, in: Proceedings of the 2001 Particle Accelerator Conference, Chicago, USA, vol. 5, https://doi.org/10.1109/PAC.2001.988064, 2001. a

Landeghem, M. V., Danieli, E., Perlo, J., Blümich, B., and Casanova, F.: Low-gradient single-sided NMR sensor for oneshot profiling of human skin, J. Magn. Reson., 215, 74–84, https://doi.org/10.1016/j.jmr.2011.12.010, 2012. a, b

Luo, S., Xiao, L., Li, X., Liao, G., Liu, H., Wang, Z., Sun, Z., Liu, W., and Xu, Y.: New magnet array design for downhole NMR azimuthal measurement, Magn. Reson. Imaging, 56, 168–173, https://doi.org/10.1016/j.mri.2018.09.027, 2018. a

Manz, B., Coy, A., Dykstra, R., Eccles, C., Hunter, M., Parkinson, B., and Callaghan, P.: A mobile one-sided NMR sensor with a homogeneous magnetic field: The NMR-MOLE, J. Magn. Reson., 183, 25–31, https://doi.org/10.1016/j.jmr.2006.07.017, 2006. a, b

Marble, A. E., Mastikhin, I. V., Colpitts, B. G., and Balcom, B. J.: A constant gradient unilateral magnet for nearsurface MRI profiling, J. Magn. Reson., 183, 228–234, https://doi.org/10.1016/j.jmr.2006.08.013, 2006. a, b

Marble, A. E., Mastikhin, I. V., Colpitts, B. G., and Balcom, B. J.: A compact permanent magnet array with a remote homogeneous field, J. Magn. Reson., 186, 100–104, https://doi.org/10.1016/j.jmr.2007.01.020, 2007. a

Martinek, G. and Kronmüller, H.: Influence of grain orientation of the coercive field in Fe-Nd-B permanent magnets, J. Magn. Magn. Mater., 86, 177–183, https://doi.org/10.1016/0304-8853(90)90119-B, 1990. a

Mehedi, M., Jiang, Y., Suri, P. K., Flannigan, D. J., and Wang, J.-P.: Minnealloy: a new magnetic material with high saturation flux density and low magnetic anisotropy, J. Phys. D Appl. Phys., 50, 37LT01, https://doi.org/10.1088/1361-6463/aa8130, 2017. a

Mikhlin, S. G.: Variational Methods in Mathematical Physics, Pergamon Press, Oxford, England, https://doi.org/10.1002/zamm.19650450439, 1964. a

Paulsen, J. L., Bouchard, L. S., Graziani, D., Blümich, B., and Pines, A.: Volume-selective magnetic resonance imaging using an adjustable, single-sided, portable sensor, P. Natl. Acad. Sci. USA, 105, 20601–20604, https://doi.org/10.1073/pnas.0811222106, 2008. a, b

Perlo, J., Casanova, F., and Blümich, B.: Single-sided sensor for high-resolution NMR spectroscopy, J. Magn. Reson., 180, 274–279, https://doi.org/10.1016/j.jmr.2006.03.004, 2006. a

Rahmatallah, S., Li, Y., Seton, H., Mackenzie, I., Gregory, J., and Aspden, R.: NMR detection and one-dimensional imaging using the inhomogeneous magnetic field of a portable single-sided magnet, J. Magn. Reson., 173, 23–28, https://doi.org/10.1016/j.jmr.2004.11.014, 2005. a, b

Raich, H. and Blümler, P.: Design and construction of a dipolar Halbach array with a homogeneous field from identical bar magnets: NMR Mandhalas, Concept. Magn. Reson. B, 23B, 16–25, https://doi.org/10.1002/cmr.b.20018, 2004. a, b, c, d, e

Seleznyova, K., Strugatsky, M., and Kliava, J.: Modelling the magnetic dipole, Eur. J. Phys., 37, 025203, https://doi.org/10.1088/0143-0807/37/2/025203, 2016. a

Soltner, H. and Blümler, P.: Dipolar Halbach magnet stacks made from identically shaped permanent magnets for magnetic resonance, Concept. Magn. Reson. A, 36A, 211–222, https://doi.org/10.1002/cmr.a.20165, 2010. a, b, c, d, e, f

Staudacher, T., Shi, F., Pezzagna, S., Meijer, J., Du, J., Meriles, C. A., Reinhard, F., and Wrachtrup, J.: Nuclear Magnetic Resonance Spectroscopy on a (5-nm)^{3} Sample Volume, Science, 339, 561–563, https://doi.org/10.1126/science.1231675, 2013. a

Svanberg, K.: A class of globally convergent optimization methods based on conservative convex separable approximations, SIAM J. Optimiz., 12, 555–573, https://doi.org/10.1137/S1052623499362822, 2002. a

Tayler, M. C. and Sakellariou, D.: Low-cost, pseudo-Halbach dipole magnets for NMR, J. Magn. Reson., 277, 143–148, https://doi.org/10.1016/j.jmr.2017.03.001, 2017. a

Topgaard, D., Martin, R. W., Sakellariou, D., Meriles, C. A., and Pines, A.: “Shim pulses” for NMR spectroscopy and imaging, P. Natl. Acad. Sci. USA, 101, 17576–17581, https://doi.org/10.1073/pnas.0408296102, 2004. a

Utsuzawa, S. and Fukushima, E.: Unilateral NMR with a barrel magnet, J. Magn. Reson., 282, 104–113, https://doi.org/10.1016/j.jmr.2017.07.006, 2017. a

Windt, C. W., Soltner, H., van Dusschoten, D., and Blümler, P.: A portable Halbach magnet that can be opened and closed without force: The NMR-CUFF, J. Magn. Reson., 208, 27–33, https://doi.org/10.1016/j.jmr.2010.09.020, 2011. a

Zakotnik, M. and Tudor, C.: Commercial-scale recycling of NdFeB-type magnets with grain boundary modification yields products with designer properties that exceed those of starting materials, Waste Manage., 44, 48–54, https://doi.org/10.1016/j.wasman.2015.07.041, 2015. a, b