Introduction

Demagnetization curves, magnetization hysteresis curves on the second quadrant, provide useful information on the characteristic properties of hard-magnetic materials1,2,3. The magnetic energy product BH and its maximum (BH)max, or magnetostatic energy can be calculated from the demagnetization curves, besides the remanence and coercivity that can be directly obtained from them. In this respect, the demagnetization curves of granular hard magnets are the key to understanding magnetization reversals and enhancing the performance of hard magnets. Thus, the characteristic shape of demagnetization curves has been intensively studied from earlier theoretical works including macrospin approximation4,5, Sharrock equation6,7,8, linear response theory9, Avrami kinetics10, Jiles-Atherton equation2,11, Preisach formalism12, and micromagnetic theory1,13,14. The micromagnetic theory and simulations allow determining demagnetization curves (or hysteresis curves) according to a variety of factors including intrinsic material parameters15,16, microstructures12,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, and damping constant and field sweep rate8,26, thus helping understand correlations between the demagnetization curve and the microstructures/compositions of granular magnets. For example, the microstructure effects of individual grains on the macroscopic performance of hard magnets have been extensively investigated in terms of the size20,23,24,25, crystallographic orientation of grains18,19,20,21,22,23,24, as well as precipitated phases within grain boundaries, and their thickness15,24,27,28,29,30,31. Very recently, several machine-learning models have also revealed the correlations between coercivity and (BH)max, switching field, and hysteresis loop with microstructure fingerprints. This AI-driven understanding of key microstructure factors has played a pivotal role in custom designs of the internal microstructures of hard magnets15,16,20,24.

In this context, it is intriguing to explore the underlying physics of magnetization reversals in core–shell multi-main phase (MMP) magnets. Such magnets were fabricated from conventional magnetic materials during dual-alloy processes, with the aim of substituting the costly neodymium (Nd) element with more abundant lanthanides such as La and Ce30,32,33. For example, it was reported that the MMP magnets incorporating 36 wt% La-Ce exhibited ~ 27% higher cost performance than that of the single-main-phase magnets with the same composition, albeit with a roughly 15% reduction in the (BH)max value32. The enhanced cost performance was attributed to exchange coupling at the interfaces and intergranular dipolar interaction, according to measurements of the Curie temperature and recoil curves.

Also, several machine learning models were applied in studies of hard-magnetic materials to deduce the input-to-output relationships of magnetic properties, even with a relatively small number of datasets15,16,20,22,24. However, these models often have the limitation of not explicitly revealing the internal parameters, especially in the case of highly accurate models such as neural networks. Explainable artificial intelligence (XAI) techniques offer a solution by providing a set of numbers known as importance values. These values quantify the contribution of each input feature to the model’s output. The importance values can be extracted using specific algorithms, including the kernel SHapley Additive exPlanations (SHAP)34.

In this study, we utilized a novel approach, a grain-by-grain analysis of the demagnetization curves of all individual grains in given MMP magnets, in order to understand the underlying reversal mechanism of MMP magnets contributing to the overall demagnetization curve of the entire volume. We applied this grain-by-grain analysis to datasets obtained from finite-element micromagnetic simulations. These simulations were conducted on a core–shell sphere cluster model with various inhomogeneous magnetic phases of Nd2Fe14B and NdCeFe14B, each with different shell compositions surrounding each core sphere. Further, we discovered that the overall nucleation fields and coercivity were divided into two distinct broad and narrow distributions for the Nd-rich and Nd-lean individual grains, respectively. We attributed these differences to the stray fields resulting from the dipolar interactions of the individual spheres, which influence the nucleation field of the reversed domain in each sphere.

According to the kernel SHAP analysis of machine-learning models constructed for the coercivity of either Nd-rich or -lean grains, the magnitude of stray fields and the position of grains were the major factors contributing to the broader distributions of coercivity in Nd-rich grains. Such AI model interpretations align with the findings that adjustments to the shell compositions of both grain types can manipulate nucleation and coercive fields via intergranular magnetostatic interactions. The role of magnetostatic interactions was further explained by an analytical nucleation model composed of two hard-magnetic spheres.

Results and discussion

Core–shell sphere cluster model with inhomogeneous magnetic phases

Our model studied here is composed of 55 spherical grains arranged in a double-layered cuboctahedron configuration with a core–shell structure30,32 in each sphere (Fig. 1a). Among various truncated octahedrons, the cuboctahedron possesses a sphericity of 0.905, close to 1. The cuboctahedron cluster comprises a specific number of spheres given by (2n + 1)(5n2 + 5n + 3)/3, where n (= 0, 1, 2,..) is the number of layers in the cluster model35. The sphere cluster model was designed to have a demagnetization factor of 1/3 in all directions36,37,38, thus eliminating possible shape anisotropy from the overall cluster volume. Each spherical grain has a 68 nm diameter with a 2-nm-thick shell, and each sphere was separated from its neighboring grains by a 2-nm air gap (Fig. 1b). We note that our model did not incorporate the soft or nonmagnetic defects that could serve as nucleation sites and pin domain walls, thereby potentially leading to an overestimated coercivity compared to experimental values39,40. The 68 nm diameter is considerably larger than the critical diameter (19.7 nm for Nd2Fe14B) for coherent magnetization rotation, but is smaller than a diameter (201 nm for Nd2Fe14B) above which multi-domain states are prevalent14. The air gap between neighboring grains inhibits short-range exchange coupling between them, thereby behaving as a nonmagnetic phase28,29,30.

Figure 1
figure 1

(a) Perspective view of a sphere-cluster model, each sphere featuring a core–shell structure along with the indicated dimensions. (b) The dimensions of the core–shell structure within each sphere. Individual spheres are separated by a 2-nm thick nonmagnetic medium. The inset shows the surface meshes of each sphere in the Class-I geodesic polyhedron, {3,5 +}19,0. (c) A cuboctahedron cluster model consisting of 28 Nd-rich spheres (red-tinted color for Nd2Fe14B) and 27 Nd-lean spheres (blue color for NdCeFe14B), each covered by a thin shell of Nd2-δCeδFe14B (pink) and Nd1+δCe1-δFe14B (light blue), respectively.

To emulate the inhomogeneous phases of MMP magnets, our sphere cluster model consisted of two cores with distinct compositions—Nd2Fe14B (Nd-rich) and NdCeFe14B (Nd-lean), each enveloped by a single shell of Nd2-δCeδFe14B and Nd1+δCe1-δFe14B (0 ≤ δ ≤ 0.5), respectively. Notably, 28 Nd-rich spheres and 27 Nd-lean spheres were randomly dispersed as illustrated in Fig. 1c. In this model, we assume that the net content of Ce in the two different shells encompassing the Nd-rich and -lean cores are conserved, irrespective of given values of δ. The configurations of the Nd-rich and Nd-lean spheres were kept constant while δ was varied within a range of 0–0.5 at increments of 0.1. We assumed that our core–shell microstructures were formed by diffusion processes between Nd2Fe14B and NdCeFe14B particles mixed at 5:5 ratio, with the same diffusivity for Nd and Ce atoms. In this scenario, Nd atoms from the Nd2Fe14B particle and Ce atoms from the NdCeFe14B particle were presumed to exchange at a 1:1 rate. As such, the possible compositions of the Nd-rich and Nd-lean shell are anticipated to be Nd2-δCeδFe14B and Nd1+δCe1-δFe14B (0 ≤ δ ≤ 0.5), respectively.

Demagnetization curves

Figure 2 shows an example of simulation results for the overall demagnetization curve (thick black line) of all the spheres (entire cluster model system), and two separate demagnetization curves exclusively representing the Nd-rich and -lean spheres for the case of δ = 0.3. The overall demagnetization curve exhibits a significant, sudden drop in < mz > just beyond the nucleation field HN, succeeded by a series of relatively smaller-step curves. This type of curve is typical for a reversal process of the nucleation of reversed domains, as is often observed in exchange-decoupled magnets28,29. The entire demagnetization curve can be dissected into two separate curves, obtained from only the Nd-rich and -lean spheres, depicted in red and blue colors, respectively. Notably, these two decomposed demagnetization curves exhibit stark contrasts: a single pronounced step-drop for the Nd-lean spheres versus numerous minor step-drops for the Nd-rich spheres. In detail, the Nd-lean spheres show a sharp, significant drop in the magnetization at μ0Hz =  ~ − 4.3 T, while the Nd-rich spheres shows a few moderate-step drops before Hc but many minor step drops after Hc. Therefore, the entire-system value of Hc is the cumulative result of the reversals of the Nd-rich and -lean spheres and is dominated by the switching of the Nd-rich spheres. Moreover, the reversal process of the Nd-rich spheres was composed of a sequence of successive switching of the individual Nd-rich spheres, each with different nucleation fields, across a wide range of HN. The sequential reversal processes of Nd-lean and -rich grains are visually depicted in Supplemental Movie S1, available online.

Figure 2
figure 2

Demagnetization curves obtained from the core–shell sphere-cluster model with δ = 0.3. The pink-, light-blue-, black lines correspond to the normalized curves of Nd-rich spheres, Nd-lean spheres, and all spheres, respectively.

Grain-by-grain analysis of demagnetization curves and the reversals of individual spheres

To understand the overall demagnetization curve characterized by numerous step-like drops in magnetization shown in Fig. 2, we performed a grain-by-grain analysis, separating the demagnetization curves of individual spheres. Because the multiple steps observed in the overall demagnetization curve result from different nucleation fields required for switching reversed domains in each individual sphere, we interpreted the demagnetization curves sphere-by-sphere.

Figure 3a highlights parts of the cluster model, emphasizing a Nd-lean sphere labeled as #17 and its twelve nearest neighboring (NN) spheres. The demagnetization curves for sphere #17 and some of the NN spheres are separately plotted in Fig. 3b. The μ0Hc values for sphere #17 and five Nd-lean spheres ranged from 4.26 to 4.32 T. Figure 3c shows snapshot images of local z-component magnetizations (mz) distributions at μ0Hz = − 4.27, − 4.29, and − 4.31 T for sphere #17 and the twelve NN spheres. The magnetization reversal occurred sphere-by-sphere via the individual switching of each sphere, similar to exchange-decoupled magnets28,29, although the reversal in sphere #17 was not coherent. To quantitatively interpret the switching of individual spheres, demagnetization curves are plotted to represent the varying values of coercive field hc, nucleation field hN, and field width Δh as illustrated for different spheres. The parameters hc and hN were defined as the fields obtained at < mz >  = 0 and < mz >  = 0.9mr, respectively, while Δh is defined as the difference in μ0Hz between < mz >  = 0.9mr and − 0.9. Since the reversal of each sphere in our model is incoherent within the volume of each sphere, the value of Δh also approximately measures the mobility of domain walls within each sphere.

Figure 3
figure 3

Representation of grain-by-grain analysis for demagnetization curves. (a) Highlight of 12 spheres surrounding a single sphere, labeled as #17. (b) Demagnetization curves of several individual spheres, along with the coercive force hc, the nucleation field hN, and its slope Δh as defined within the diagram. The thick blue line indicates the demagnetization curve of sphere #17, while thin lines correspond to those of its neighboring spheres. The snapshot images in (c) describe the temporal magnetizations at the indicated values of external magnetic fields. The colors indicate mz as indicated by the color bar.

Distributions of h c, h N, and Δh for all individual spheres

The distributions of all the hc, hN, and Δh values for the Nd-rich (red color) and Nd-lean (blue) spheres in the core–shell sphere cluster model with an inhomogeneous composition of δ = 0.3 are depicted as histograms (Fig. 4). The normal distribution curves (fR and fL) for the Nd-rich and -lean spheres are separately plotted, accompanied by the corresponding mean and standard deviation values calculated using the following equations.

$$f^{R} (h_{c} ) = \frac{{N_{R} b}}{{\sqrt {2\pi \sigma_{{h_{c} }}^{R} } }}\exp \left[ { - \frac{{\left( {h_{c} - \left\langle {h_{c} } \right\rangle^{R} } \right)^{2} }}{{2\left( {\sigma_{{h_{c} }}^{R} } \right)^{2} }}} \right]$$
(1a)
$$f^{L} (h_{c} ) = \frac{{N_{L} b}}{{\sqrt {2\pi \sigma_{{h_{c} }}^{L} } }}\exp \left[ { - \frac{{\left( {h_{c} - \left\langle {h_{c} } \right\rangle^{L} } \right)^{2} }}{{2\left( {\sigma_{{h_{c} }}^{L} } \right)^{2} }}} \right]$$
(1b)

where NR (NL) represents the number of the Nd-rich (Nd-lean) spheres, including both core and shell (56 for Nd-rich and 54 for Nd-lean spheres in this model), b denotes the bin width of the histograms, while \(\left\langle {h_{c} } \right\rangle^{R}\) (\(\left\langle {h_{c} } \right\rangle^{L}\)) and \(\sigma_{{h_{c} }}^{R}\) (\(\sigma_{{h_{c} }}^{L}\)) refer to the mean value and the standard deviation of hc, respectively. The fitting values of the mean and standard deviations were summarized in Supplementary Table S1 online. Normal distribution curves of hN and Δh were obtained in the same manner. The hc and hN of the Nd-rich grains were distributed over a wide range from − 6 to − 4.5 T, with the mean values of \(\left\langle {h_{c} } \right\rangle^{R} = - 5.07{\text{ T}}\) and \(\left\langle {h_{N} } \right\rangle^{R} = - 5.06{\text{ T}}\), and standard deviations of \(\sigma_{{h_{c} }}^{R} = 416.7{\text{ mT}}\) and \(\sigma_{{h_{N} }}^{R} = 418.0{\text{ mT}}\), respectively. In contrast, the Nd-lean spheres displayed relatively narrow distributions centered around \(\left\langle {h_{c} } \right\rangle^{L} = - 5.07{\text{ T}}\) and \(\left\langle {h_{N} } \right\rangle^{L} = - 5.06{\text{ T}}\), and standard deviations of \(\sigma_{{h_{c} }}^{L} = 18.5{\text{ mT}}\) and \(\sigma_{{h_{N} }}^{L} = 17.8{\text{ mT}}\), respectively. Hence, the many step-like demagnetization curve for the Nd-rich grains (as seen Fig. 2) is attributed to the variation in nucleation fields across a wide range. The extremely broad ranges of hc and hN for the Nd-rich grains will be explained in the following section, with reference to the uneven distribution of stray fields affecting each Nd-rich grain14. On the other hand, the similar and narrow distributions of \(\left\langle {\Delta h} \right\rangle^{R} = 19.5{\text{ mT}}\) and \(\left\langle {\Delta h} \right\rangle^{L} = 17.0{\text{ mT}}\) with \(\sigma_{\Delta h}^{R} = 3.20{\text{ mT}}\) and \(\sigma_{\Delta h}^{L} = 2.76{\text{ mT}}\) for both the Nd-rich and -lean grains indicate comparable domain wall mobilities in both types of grains. According to the one-dimensional model, the speed of domain walls is expressed as

$$v_{DW} = \frac{{\gamma \mu_{0} \alpha \delta_{DW} }}{{1 + \alpha^{2} }}H_{ext}$$
(2)

where δDW is the domain wall width and Hext the applied magnetic field driving the domain walls46. The width of domain wall in a curved geometry depends on the curvature value, the position within each sphere particle, as well as the direction of domain wall expansion relative to the crystallographic orientations1,18,42,43,44. Taking into account the Bloch domain wall width \(\delta_{DW} = \pi \sqrt {{{A_{ex} } \mathord{\left/ {\vphantom {{A_{ex} } {K_{1} }}} \right. \kern-0pt} {K_{1} }}}\) for core regions and the mean coercive fields as the driving field values (δDW = 1.34 and 1.48 nm; |< hc >|= ~ 5.07 and ~ 4.29 T for Nd-rich and Nd-lean grains, respectively), the values of vDW for the Nd-rich and -lean grains are estimated to be 1.88 km/s and 1.75 km/s, respectively. The vDW values differ only by + 7.0% (\(v_{DW}^{R} > v_{DW}^{L}\)) between the two types of grains. This is a compensated result of − 10.6% and + 18.3% differences in the values of δDW (\(\delta_{DW}^{R} < \delta_{DW}^{L}\)) and driving fields (\(\left\langle {h_{c} } \right\rangle^{R} > \left\langle {h_{c} } \right\rangle^{L}\)).

Figure 4
figure 4

Histograms displaying the distributions of hc, hN, and Δh values of all individual spheres in the case of δ = 0.3. The red bars indicate Nd-rich spheres, while the blue bars denote Nd-lean spheres. Dotted lines represent the fitted normal distributions of hc, hN, and Δh for both Nd-rich and -lean spheres.

Explaining the broader distribution of h c in Nd-rich grains by machine learning approach

To identify the mechanism behind the broad distributions of hN and hc observed in Nd-rich grains, we constructed machine learning models based on artificial neural networks. We then extracted the feature importance values, which quantitatively measure the influence of features on the model’s output, using kernel SHAP interpretation34. Previous studies20 have identified crystallographic misorientations and relative position of grains as key features determining each grain’s switching field. In a similar manner, we compiled 11 features characterizing each grain, which include the material parameters (xCe), the relative position of grains (rx, ry, rz, r), the number of neighboring grains of different types (NNrich, NNlean), and the mean stray field acting on each grain (\(H_{stray}^{x}\), \(H_{stray}^{y}\), \(H_{stray}^{z}\), \(H_{stray} = \sqrt {(H_{stray}^{x} )^{2} + (H_{stray}^{y} )^{2} + (H_{stray}^{z} )^{2} }\)). The vector stray field acting on the i-th grain was calculated using an approximate macrospin model that employs volume-average z-component magnetizations45: \({\mathbf{H}}_{{{\text{stray}}}}^{i} = - \sum\limits_{j \ne i} {\nabla \Phi_{M}^{ij} }\) with the magnetic scalar potential

$$\Phi_{M}^{ij} = \frac{{J_{S}^{{j,{\text{core}}}} \left\langle {m_{z}^{{j,{\text{core}}}} } \right\rangle }}{{3\mu_{0} }}\frac{{R_{{{\text{core}}}}^{3} }}{{r_{ij}^{2} }}\cos \theta_{ij} + \frac{{J_{S}^{{j,{\text{shell}}}} \left\langle {m_{z}^{{j,{\text{shell}}}} } \right\rangle }}{{3\mu_{0} }}\frac{{R_{{{\text{shell}}}}^{3} - R_{{{\text{core}}}}^{3} }}{{r_{ij}^{2} }}\cos \theta_{ij} ,$$
(3)

where \(J_{S}^{{j,{\text{core}}}}\) (\(J_{S}^{{j,{\text{shell}}}}\)), \(\left\langle {m_{z}^{{j,{\text{core}}}} } \right\rangle\) (\(\left\langle {m_{z}^{{j,{\text{shell}}}} } \right\rangle\)), and \(R_{{{\text{core}}}}\) (\(R_{{{\text{shell}}}}\)) are the saturation polarization, volume-average z-component magnetization, radius of core (shell) part of the j-th grain, and \(r_{ij}\) and \(\theta_{ij}\) are the center-to-center distance and angle between the i- and j-th grains. The stray fields closely corresponded with the demagnetizing fields calculated from the micromagnetic simulations, as exemplified in the case of sphere #17, shown in Supplementary Fig. S1 online.

Using the 11 features, we trained 100 artificial neural network models with different sets of hyperparameters, optimized by the very fast simulated annealing (VFSA) algorithm24. The optimized models accurately reproduced prediction values comparable to those of the original datasets (Fig. 5a). Predictions had a root mean square error (RMSE) of 5.3 (± 4.2) mT and 102.4 (± 26.9) mT, and an R2 score of 0.99 (± < 0.01) and 0.96 (± 0.019) for the training and test datasets, respectively (Fig. 5b). By employing the kernel SHAP interpretation method, we extracted the importance values of the 11 features, which are measures of their contributions to the model’s prediction34. Therefore, a negative importance value contributes to a larger |hc| and a positive one to a smaller |hc|.

Figure 5
figure 5

Machine learning approach for analyzing coercivity variation. (a) Parity plot comparing the original simulation data (hc) with the predictions made by 100 machine learning models (\(h_{c}^{pred}\)) using different sets of hyperparameters optimized by VFSA. The large dots shaded in orange and green indicate the predictions for the train and test datasets, respectively, while the small dots in red and deep-green represent the mean of predictions for the train and test datasets, respectively. (b) Violin plots depicting the RMSE and R2 between the simulation datasets and predictions for the train and test datasets made by the 100 models. (c) Kernel SHAP interpretation reveals the importance values of the 11 features used to train the models. Features with negative importance values enhance the |hc|, while those with positive values reduce |hc|.

In Fig. 5c, the importance values, calculated from the hc prediction of the 100 neural network models, are summarized in violin plots with whiskers indicating maximum, medium and minimum values. Among the 11 features, the contribution by the stray field magnitude (Hstray) was the most important factor for Nd-rich grains and the second most important for Nd-lean grains, with importance values of − 0.706 and -0.243, respectively. The number of neighboring Nd-rich grains (NNrich) was the key factor that most increased the |hc| of the Nd-lean grains, with the value of − 0.29, but it was also the factor that most decreased the |hc| of the Nd-rich grains, with the value of + 0.169. In contrast, the z-position of the grains (rz) decreased |hc| of Nd-lean grains (importance value: + 0.105) and increased |hc| of Nd-rich grains (− 0.344). However, the material nature of the grain itself (xCe) had negligible effects on |hc| of either type of grains (+ 0.02 for Nd-lean, + 0.01 for Nd-rich grains).

The |hc| of Nd-rich grains was influenced more significantly by Hstray and rz (importance values: − 0.706, − 0.344) than the |hc| of Nd-lean grains (− 0.243, + 0.105). Consequently, the broader distributions of hc in Nd-rich grains can be attributed to the stray field and the z-position of each grain. As referenced in studies20,24, the latter was one of the most prevalent features of weak grains and resulted in anomalously small values of switching field and magnetic energy products. Though the importance values of Hstray and rz had similar trends, they showed weak correlation (ρ = 0.06) in our model. In the latter part of this paper, we will analyze the switching field (or hc) from the perspective of stray fields (Hz). This interpretation will be based on an eigenvalue problem rooted in micromagnetic theory.

Grain-by-grain analysis for inhomogeneous magnetic phases

To account for the distinct dependencies of coercive forces and nucleation fields on δ, we examined the demagnetization curves using a grain-by-grain analysis, as shown in the hc, hN, and Δh histograms (see Fig. 6). The mean and standard deviations of these parameters for different δ values are summarized in Supplementary Table S2 online and in Fig. 7, along with those from the single-main-phase model. As shown in Fig. 8, the means of hc and hN of Nd-lean grains (\(\left\langle {h_{c} } \right\rangle^{L}\) and \(\left\langle {h_{N} } \right\rangle^{L}\)) decrease as δ values increase, aligned with the trend of overall nucleation fields. On the other hand, \(\left\langle {h_{c} } \right\rangle^{R}\) and \(\left\langle {h_{N} } \right\rangle^{R}\) increase with δ, following the same trend as the overall coercive forces. These variations can be explained in terms of an inverse dependence of anisotropy fields (\(h_{A} = 2\mu_{0} K_{1} /J_{S}\)) on δ, which monotonically varies from 6.71 (δ = 0) to 5.24 T (δ = 0.5), as indicated by the Kronmüller relation (\(h_{c} = \alpha h_{A} - NJ_{S}\), α is the microstructure factor and N the effective demagnetization factor)14. The increase in Ce contents of shells (XCe = δ/2100 at%) suggests a depletion of Nd atoms from the shell of Nd-rich grains, leading to a decrease in anisotropy fields in the Nd-rich grains’ shell region, where reversed domains are initially nucleated. At the same time, the surplus Nd atoms are integrated into the shell region of Nd-lean grains, enhancing their anisotropy fields. We will discuss the δ dependence of \(\left\langle {h_{N} } \right\rangle^{R(L)}\) in more detail in the next section, using empirical relations. To compare with parameters from the single-main-phase model, its \(\left\langle {h_{c} } \right\rangle\) and \(\left\langle {h_{N} } \right\rangle\) values are marked with a green asterisk, lying between the curves for Nd-rich and -lean grains due to the intermediate Ce content of the material assumed in our single-main-phase magnet model (Nd1.5082Ce0.4918Fe14B).

Figure 6
figure 6

Histograms depicting the distributions of hc, hN, and Δh values for individual spheres with different values of δ (= 0, 0.1, 0.2, 0.3, 0.4, and 0.5). The vertical gray lines in the hc and hN histograms indicate the corresponding median values for δ = 0.3.

Figure 7
figure 7

Plots of < hc > , < hN > , and < Δh > averaged for the Nd-rich and Nd-lean spheres as a fucntion of δ. The green asterisk indicates those for the single-main-phase sphere cluster model of δ = 0.3.

Figure 8
figure 8

The coupled Stoner-Wohlfarth model. (a) The model geometry of vertically aligned magnetic particles of a radius R, separated by an interparticle gap of d. (b) The plot of the coercive field discrepancy in relation to the radius and interparticle gap, shown on logarithmic scales. Fitting curves using Eq. (6) are represented by dotted lines. (c) The plot of the nucleation field discrepancy in relation to the saturation polarization of surrounding grains, with fitting curves represented by dotted lines.

Exploring the mechanism behind variations in h N with δ

In the previous section, we found that the stray fields are the most essential among other features. However, relying solely on the results-driven machine learning model for this inference lacks a physics background. Therefore, in this section, we further established an analytical model that involves solving the nucleation problem in classical micromagnetic theory. It is worth noting that the nucleation field varies with different δ, although the overall chemical formula for the sphere cluster, Nd2-xCexFe14B (0.491 ≤ x ≤ 0.5), has minimal differences with cerium stoichiometry varying at most by 1.8%. Apart from the chemical compositions, microstructural factors such as intergranular exchange stiffness, easy axis alignment, and grain sizes can cause discrepancies between experimental and ideal coercivity and/or nucleation fields, a problem well-known as Brown’s paradox14,46,47. In previous studies14,48,49,50, this discrepancy between experimental and ideal coercivity in granular materials was explained in relation to demagnetizing fields. The demagnetizing fields were linked to the physical characteristics of grains20,49 and the cavity field originating from the sheath of grains48 as demonstrated by Monte-Carlo simulations50. However, assessing coercivity through simulation methods has limitations, as the calculated coercivity depends on the dynamic features of the model system such as damping parameter and sweep rates14. Furthermore, these methods provide less detailed insights into the mechanism behind the relationship between the material parameters and coercivity than analytical expressions do.

Thus, we used an analytical macrospin model that accounts for inter-particle magnetostatic interaction energy to demonstrate that the stray field can reduce the coercivity of magnetically coupled particles. The nucleation field was calculated using the principle that the second derivative of the magnetic energy holds a zero eigenvalue when the nucleation of reversed domains begins47,51. We developed a model geometry composed of two hard-magnetic spheres with a radius R and a center-to-center distance d, both exhibiting uniaxial anisotropy (Fig. 8a). Around the point of nucleation, the magnetic energy of the two spheres, which are coupled through magnetostatic interactions, is approximately given as,

$$E(\theta_{1} ,\theta_{2} ) = \frac{{\mu_{0} M_{S,1}^{2} }}{2}(h - h_{N,1}^{ \circ } )\theta_{1}^{2} + \frac{{\mu_{0} M_{S,2}^{2} }}{2}(h - h_{N,2}^{ \circ } )\theta_{2}^{2} + \frac{2}{3}\mu_{0} M_{S,1} M_{S,2} \left( \frac{R}{d} \right)^{3} \cos \theta_{1} \cos \theta_{2}$$
(4)

where θi, MS,i, and \(h_{N,i}^{ \circ }\) (i = 1, 2) correspond to the spin angle, saturation magnetization, and ideal nucleation field of sphere i., respectively. The first and second terms are the Taylor expansions of Stoner-Wohlfarth particles up to the second order of θi, on the verge of nucleation (\(\theta_{i} \approx 0\)), or

$$E_{SW} (\theta ) = K_{1} \sin^{2} \theta - \mu_{0} M_{S} h\cos \theta = \mu_{0} M_{S} \left( {\frac{{h_{A} }}{2}\sin^{2} \theta - h\cos \theta } \right) \approx E_{0} + \mu_{0} M_{S} (h - h_{N} )\frac{{\theta^{2} }}{2}$$

with \(h_{N} = - h_{A} = - 2K_{1} /\mu_{0} M_{S} < 0\), representing the ideal nucleation field. Using the nucleation condition, which states that the determinant of \(\tfrac{{\partial^{2} E}}{{\partial (\theta_{1} ,\theta_{2} )}}\) becomes zero at nucleation (\(\theta_{1} ,\theta_{2} \approx 0\)), the nucleation fields of the i-th sphere in the coupled system (\(h_{N,i}\)) is given as

$$h_{N,1(2)} = h_{N,1(2)}^{ \circ } + \frac{2}{3}\left( \frac{R}{d} \right)^{3} M_{S,2(1)} .$$
(5)

Based on this dependency relation, the decrease in nucleation field in general systems with a grain radius R, interparticle distances d, and the saturation magnetization of the other particle as \(\overline{M}_{S}\) should scale as follows:

$$\Delta h_{N} \sim - R^{a} d^{ - b} \overline{M}_{S}^{c} .$$
(6)

with positive exponents a, b, and c. To validate this scaling rule, we performed additional micromagnetic simulations. These simulations were conducted using the material parameters of Nd2Fe14B and NdCeFe14B, sphere radii (R) ranging from 2 to 40 nm, and center-to-center distance (d) from 6.4 to 409.6 nm, which satisfies \(d > 2R\). The coercive fields were calculated by applying an external magnetic field in the -z direction to the spheres, which had initially been magnetized to \({\mathbf{m}} = [0,0,1]\). In Fig. 8b, the differences between the coercive fields of those systems and the coercive field of single spheres with the same dimensions are plotted, along with the fitting curves based on (6). The parameters a and b extracted from the datasets ranged from 0.13 to 1.35 and 0.35 to 1.68, respectively.

The empirical relation (6) was applied to the datasets in Fig. 8, aiming to illustrate the discrepancy between the nucleation fields calculated from simulations and the ideal nucleation fields as described in47. The values of \(\left\langle {h_{N} } \right\rangle^{R(L)}\) for δ = 0, 0.1, 0.2, 0.3, 0.4, 0.5 were fitted with Eq. (6) in Fig. 8c. The discrepancies in the nucleation field of Nd-rich (-lean) grains (\(\left| {\Delta h_{N} } \right|^{R(L)} = \left\langle {h_{N} } \right\rangle^{R(L)} - h_{N}^{ \circ }\)) are plotted against the volume-average saturation magnetization of Nd-lean (-rich) grains, with both axes on a logarithmic scale. The volume-average saturation polarization, \(\left\langle {J_{S} } \right\rangle_{V}^{L(R)}\), was calculated based on volume fractions, as follows:

$$\left\langle {J_{S} } \right\rangle_{V}^{L(R)} = v_{core} J_{S}^{core,L(R)} + v_{shell} J_{S}^{shell,L(R)} ,$$

With \(v_{core}\), \(J_{S}^{core,L(R)}\) and \(v_{shell}\), \(J_{S}^{shell,L(R)}\), representing the volume fraction and saturation polarization of Nd-rich (-lean) grains. The ideal nucleation field \(h_{N}^{ \circ }\) for the curling rotation mode was calculated from \(h_{A} = 2x_{1}^{2} \mu_{0} A_{ex} /J_{S} R^{2} + 2\mu_{0} K_{1} /J_{S} - J_{S} /3\) with \(x_{1} = 2.0816\)50. The c values, obtained by fitting Eq. (6) to \(\left| {\Delta h_{N} } \right|^{R}\) and \(\left| {\Delta h_{N} } \right|^{L}\) (Fig. 8c) were 3.97 and 11.8, respectively, both indicating a positive value of c.

According to our analytical nucleation model, the stray field alone can account for a large part of the discrepancy mismatch between the calculated and ideal coercivity values. By addressing an eigenvalue problem for the two-sphere model, we demonstrated that the introduction of a stray field, as a magnetostatic interaction term, results in decreases of nucleation fields. This finding is consistent with the interpretation given by the kernel SHAP of the machine-learning-based regression model shown in Fig. 5c. From a mathematical standpoint, the convex position of the energy function, which is approximately expanded by polynomials as shown in Eq. (4), is altered by the superposition of stray fields emanating from magnetic charges in other domains. Considering that the stray fields in uniformly magnetized spheres result from surface magnetic charges, the stray field model can explain the coercivity mechanisms of core–shell MMP magnets and potentially phenomena related to microstructure, such as Brown’s paradox.

Directly applying our macro-spin model to previously published experimental results on MMP magnets proved challenging. However, our model, which demonstrates a decrease in hN with increase in R and a decrease in d, provides insights into previous experimental observations related to grain sizes and grain-to-grain exchange interactions. For example, the decrease in hc with an increase in R has been attributed to surface defects, in analogue with structural mechanical weakest-link statistics52,53. On the other hand, the reduction in hc with d (or increased inter-grain exchange coupling) was explained through micromagnetic simulations in earlier studies24,28,29.

Comparison with the single-main-phase model

In comparison with our inhomogeneous phase magnet model, we also examined a single-main-phase magnet model with a homogeneous composition equivalent to δ = 0.3 (Nd1.51Ce0.49Fe14B). The hc, hN, and Δh values for the individual spheres were extracted using the aforementioned grain-by-grain analysis, as summarized in Fig. 9 and Supplementary Table S1 online. The mean values of hc and hN from this homogenous phase model were − 4.87 and − 4.86 T, respectively, excluding the four outlier values spanning over − 5.5 to − 5 T. These outlier values correspond to the delayed reversals of specific grains which are in small amount and have negligible effects on the overall coercive forces and nucleation fields. On the other hand, the standard deviations of hc and hN are 13.1 and 12.7 mT, respectively, which are less than those for the inhomogeneous phase model with δ = 0.3. The distribution of Δh (mean value, 16.3 mT) for the single-main-phase magnet model is very similar to that for the inhomogeneous phase model. Hence, the calculated domain-wall speed was 1.88 km/s, roughly equivalent to those for MMP models. The standard deviation of Δh was also less than that of MMP grains similar to the case of hc and hN.

Figure 9
figure 9

Histograms for the distributions of hc, hN, and Δh values for all the individual spheres having a homogenous composition equivalent to the core–shell sphere cluster model of δ = 0.3. Dotted lines represent the normal distributions of hc, hN, and Δh.

The overall nucleation field and coercive force, as explained in the previous sections, were superior in the single-main-phase magnet model compared to MMP models, which are composed of 28 Nd-rich grains and 27 Nd-lean grains. It is important to note that the Ce contents in the MMP or dual-main phase magnets, and single-main phase magnets are generally different from those in the starting materials due to the formation of precipitate phases around the thermodynamically stable RE2Fe14B-phase grains28,29,30,32.

Summary

We utilized finite-element micromagnetic simulations to investigate the individual demagnetization curves of spheres with varying Nd-rich and -lean core-shells within a sphere- cluster model. The overall demagnetization curve from the entire inhomogeneous magnetic phases can be constructed as the summation of the demagnetization curves of the individual grains. Through our grain-by-grain analysis of the coercive force hc and nucleation field hN for each grain, we observed that the Nd-lean grains reversed (nucleated) at nearly identical (at least similar) values of hc (hN). This was then followed by the intermittent reversal (nucleation) of the Nd-rich grains at widely varying values of hc (hN). This can be attributed to the localized, irregular dipolar fields produced by the Nd-lean grains that had undergone reversal before the Nd-rich grains. Furthermore, our machine learning analysis using kernel SHAP interpretation indicates significant contributions from the stray fields of reversed Nd-lean grains to the reversals of Nd-rich grains in a wide switching field range. The similar narrow distributions of Δh observed in both Nd-rich and -lean grains can be attributed to their comparable domain-wall mobilities.

Compared to the reversal of inhomogeneous magnetic phases (MMP), the single-main-phase model showed relatively narrow distributions (\(\sigma_{{h_{c} }}^{SP} = 13.1{\text{ mT}}\), \(\sigma_{{h_{N} }}^{SP} = 12.7{\text{ mT}}\)) of hc and hN, with mean values higher than those from the MMP model. We emphasize that the magnitude of hN in the MMP model trended with the mean value of hN for Nd-lean grains (\(\left\langle {h_{N} } \right\rangle^{L}\)) with respect to the δ values, while the magnitude of hc with the mean value of hc for Nd-rich grains (\(\left\langle {h_{c} } \right\rangle^{R}\)), owing to the distinct distributions of hN and hc values of the two types of grains. Furthermore, according to the proportionality between hc (hN) and the anisotropy field (hA) in the Kronmüller relation, the mean values of hc and hN in Nd-lean grains increased with δ due to the addition of Nd atoms in their shell, while those in Nd-rich grains decreased due to Nd atoms being depleted from the shells.

This work offers guidance for the optimal design of granular hard magnets composed of Nd2Fe14B and other abundant rare earth transition elements, aiming for cost-effective performance through meticulous adjustment of microstructures and elemental compositions.

Methods

Micromagnetic simulations

The demagnetization curves of the sphere cluster model were numerically calculated using the finite-element micromagnetic simulation tool, FEMME54. This tool solves the Landau-Lifshitz-Gilbert equation13

$$\frac{{d{\mathbf{m}}}}{dt} = - \gamma \mu_{0} {\mathbf{m}} \times {\mathbf{H}}_{{{\text{eff}}}} + \alpha {\mathbf{m}} \times \frac{{d{\mathbf{m}}}}{dt}.$$

Here γ is the gyromagnetic ratio, μ0 the permeability of vacuum, α the damping constant, and m and Heff the reduced magnetization (= μ0M/JS) and effective field. We used interpolated values from the material parameters of Nd2Fe14B (exchange constant Aex = 7.7 pJ/m; saturation polarization JS = 1.61 T; uniaxial anisotropy constant K1 = 4.3 MJ/m3) and Ce2Fe14B (exchange constant Aex = 5.0 pJ/m; saturation polarization JS = 1.17 T; uniaxial anisotropy constant K1 = 1.5 MJ/m3)27 to represent the given compositional alloy materials. The damping constant, α, was set to 1 to expedite convergence14,55. The initial magnetization configuration was assumed to be m = [0, 0, 1], and the external magnetic field was linearly decreased from μ0Hz =  + 7 T to − 7 T over a span of 70 ns.

Finite-element meshes on the sphere’s surface were constructed using geodesic polyhedrons. These are approximations of spheres composed of triangles (Fig. 1c), with edge lengths shorter than the exchange length (2.7 nm for Nd2Fe14B). This design ensures the correct evaluation of the exchange interaction term in the model system1,14,54. As the small sizes of micromagnetic cells allow for a precise description of domain walls (3–5 nm56,57), we restricted our mesh sizes in the finite-element simulations to be below \(\min (l_{ex} ,l_{K} )\)54, where \(l_{ex} = \sqrt {{{2A_{ex} \mu_{0} } \mathord{\left/ {\vphantom {{2A_{ex} \mu_{0} } {J_{S}^{2} }}} \right. \kern-0pt} {J_{S}^{2} }}}\) and \(l_{K} = \sqrt {{{A_{ex} } \mathord{\left/ {\vphantom {{A_{ex} } {K_{1} }}} \right. \kern-0pt} {K_{1} }}}\). In the present FEMME simulations, mesh sizes of ~ 2 nm were sufficient to accurately describe the domain wall configuration in the Nd2Fe14B material, with characteristic widths of \(\delta_{DW}^{Bloch} = \pi l_{ex} = 4.24{\text{ nm}}\). The Class-I icosahedron-based geodesic polyhedrons, with a subdivision frequency of 19, have edge lengths of approximately 1.98 nm ({3,5 +}19,0 by Wenninger notation58). These were calculated using the open-source code, Antiprism59. Tetrahedron meshes were then generated inside the geodesic polyhedrons using the TetGen software60.

Optimization of machine learning models

To develop the machine learning models, we generated 100 artificial neural network (ANN) models using the scikit-learn package in Python. We employed the MLPRegressor function from the scikit-learn package, which generates a single-layered artificial neural network trained via backpropagation. The hidden layer consisted of 100 nodes, while the input layer took nucleation fields of the core and shell parts from 55 grains (110 in total). These were divided into a training set of 77 and a test set of 33. Due to the small size of the datasets, we trained 100 machine learning models with various hyperparameters determined by the Very Fast Simulated Annealing (VFSA) algorithm24. Nevertheless, the majority of our machine learning models showed fairly good predictions, with R2 > 0.92. Our VFSA algorithm incorporated an adaptive cooling schedule,

$$T_{j + 1} = \frac{{T_{j} }}{{1 + \exp \left[ { - \left( {f({\mathbf{x}}_{cand} ) - f({\mathbf{x}}_{curr} )} \right)/T_{0} } \right]}}$$

where \(f({\mathbf{x}})\), \({\mathbf{x}}_{cand}\), and \({\mathbf{x}}_{curr}\) indicate the objective function, candidate solution, and current solution, respectively. The candidate solution for hyperparameters was searched for 30 times at each temperature, continuing until the current temperature reached 10–30.

Kernel SHAP interpretation

The trained machine learning models were analyzed with kernel SHAP interpretation implemented, as implemented by the alibi package34. According to Ref.34, the importance values of machine learning models are calculated from the contribution of the i-th feature out of M features. The output of the model, denoted as f, with reference to the average output f0 is

$$f({\mathbf{x}}) = g({\mathbf{x}}^{\prime } ) = f_{0} + \sum\limits_{i = 1}^{M} {x_{i}^{\prime } \phi_{i} } ,$$

where \(g({\mathbf{x}}^{\prime } )\) and \({\mathbf{x^{\prime}}} \in \{ 0,1\}^{M}\) are the explainable model and coalition vector, respectively.