Introduction

The interest in modeling precipitation has increased dramatically in recent years. Continuing research effects have been made to develop general and composition-dependent models for the aging effect of alloys to predict the evolution of precipitate fraction, size, number density, morphology, and solid solution solute level. The reported approaches for this purpose fall into two categories: direct detailed approaches for visualization purposes1,2,3 and physically based internal state variable approaches4,5. The former is represented by the phase-field method (PFM) or finite difference method and excels in providing detailed descriptions of nucleation, growth, and coarsening. The latter, represented by the Kampmann–Wagner Numerical (KWN) model6, can handle precipitation involving multi-scale transportation phenomena such as concurrent nucleation, growth, coarsening of an ensemble of precipitates, precipitation in matrix with an uneven compositional profile, etc. The KWN model is also implemented in some commercial software such as Thermo-Calc software as the TC-PRISMA module7,8,9 as well as some open-source codes such as Kawin developed by Ury et al.5.

To set up a simulation, a suitable CALPHAD thermodynamic database and mobility database are required. According to classical nucleation theory (CNT), some parameters such as interfacial energy and nucleation site density are considered crucial quantities which has significant effects on the modeling of precipitation. However, those quantities may be hard to determine precisely due to the complexity of microstructure, e.g.: the reported interfacial energy of \({\delta }^{{\prime} }\) precipitate in Al–Li alloys varies from 0.007 to 0.11 J/m210 and that of β″ precipitate in Al–Mg–Si alloys varies from 0.08 to 0.25 J/m211,12,13,14.

According to Miesenberger et al.15, the large range of measured interfacial energy from different works could be caused by the complexity of the microstructure. It is reported that both the volume and interface contributions to the Gibbs free energy for nucleation are functions of temperature and size of the nucleus and the chemical composition of precipitate and matrix. The effects such as diffuse interface, interface energy size effect, and heterogeneous nucleation energy with varying nucleation location (e.g. dislocation, grain boundary, bulk) play a significant role in the determination of the interfacial energy. In KWN modeling, there are some other important parameters which could also impact the precipitation behavior such as elastic strain, elastic modulus, etc. Those parameters can be accurately calculated or measured directly, and thus are not good candidates for optimization. Parameters such as interfacial energy and nucleation site density cannot be measured directly, and in many cases end up acting as tuning or calibration parameters. Traditionally, the parameters of KWN models are set by numerous trials and analyses by experienced researchers. Human-intuited materials discovery involves modeling, experiments, and analysis by human researchers. In the data-driven paradigm, high throughput screening and numerical optimization enable automated data generation, storage, and analysis, with increased data sizes and processing speed. By replacing human intuition in the paradigm, active learning and inverse design in data-driven discovery further enable the iterative optimization of the parameters toward the best solutions. Meanwhile, fundamental studies using the physics-based approaches can introduce additional insights into optimizing the parameters. Such a framework is shown in Fig. 1.

Fig. 1
figure 1

Human-intuited and data-driven materials discovery paradigms.

In this paper, we hereby evaluate multiple optimization algorithms to help to determine those quantities even when experimental data are limited, e.g.: only 3–5 points of measured mean radius as a function of aging time. We will also show the robustness of this approach and analyze the advantages and disadvantages of different optimization algorithms.

Results

The applicability of the optimization algorithms in this study is demonstrated through two common commercial alloys: Al and Ni-based alloys. In this section, we will try to optimize the multiple parameters in the KWN modeling of Al–Mg–Si aluminum and IN718 superalloys. These examples are good representatives for those categories.

Al–Mg–Si alloys

Al–Mg–Si is an important category in commercial aluminum alloys (known as 6000 series aluminum). In this class of aluminum alloys, the primary strengthening precipitate is the β″ phase. Here we adopted the alloy AA6005 with composition Al-0.562Mg-0.016Cu-0.607Si-0.054Mn-0.002Fe (weight pct) which is aged at 185 °C16. In this study, we will try to optimize single and multiple parameters in the KWN model. The thermodynamic and kinetics databases are TCAL8 and MOBAL7, respectively.

According to the literature11,12,13,14, the calculated interfacial energy ranges from 0.08 to 0.25 J/m−2. The rest parameters are set as indicated in the literature17 such as nucleation site density (6.25 × 1028 m−3) and morphology of precipitate (needle-like). The input of strain was taken as ϵ11 = −0.046, ϵ22 = −0.046 and ϵ33 = 0.0007.

The optimization of parameters is categorized into two aspects: (1) optimize interfacial energy; (2) optimize both interfacial energy and nucleation site density. By default, in the case of homogeneous nucleation, each atom in the whole volume of the matrix phase is a potential nucleation site. However, defects such as grain boundary, dislocations, and point defects because of quenching or deformation are inevitable. Therefore, while nucleation site density is theoretically a physical value that can be determined by understanding where a precipitate should be nucleating, it is necessary to consider the nucleation site density as an additional parameter to optimize, at least over a range that can be assigned some physical meaning.

For the optimization of interfacial energy, the applicable range is set as [0.07, 0.26], which is a little wider than the value reported in the experiment. During the simulation, the nucleation site density is set as 6.25 × 1028 m−3 as indicated in the literature17. Figure 2a shows the optimization of interfacial energy starting at 70 mJ/m2 by Nelder–Mead and Powell algorithms and Fig. 2b shows the variation of mean squared error (MSE) with iterations.

Fig. 2: Optimization of interfacial energy in the KWN model in an Al-Mg-Si alloy.
figure 2

a Updated interfacial energy during optimization. b Calculated MSE during iterations for different algorithms.

Figure 2b shows that the minimization of MSE is much faster by the Powell method than the Nelder–Mead algorithm. However, the parameter will jump suddenly at iteration No. 17, which contributes to the massive increase of MSE. This phenomenon is caused by the termination check of the Powell algorithm. According to Vassiliadis and Conejeros18, the termination procedure is computationally expensive since the entire minimization problem has to be resolved at least twice until the tight convergence criteria are satisfied. In the end, more iterations are taken for the Powell algorithm even if the MSE with Powell decreases much faster.

Besides the interfacial energy, the number of nucleation sites is another variables which should be determined. According to Myhr et al.14 it is noted that the nucleation site density N is physically reasonable to fall within a range where the classic nucleation theory is normally considered to be valid. Therefore, we would further explore the reasonable site density with an optimization algorithm.

Starting with interfacial energy equal to 0.07 J/m2 and site density equal to 1028 (m−3), the evolution of parameters during Nelder–Mead and Powell optimization is shown in Fig. 3a, b, respectively. The corresponding MSE is shown in Fig. 3c. The converged results are different for the two algorithms. The Nelder–Mead optimization is converged at interfacial energy 79.13 mJ/m2 and nucleation site density 3.46 × 1025 m−3 while Powell optimization is converged at interfacial energy 95.62 mJ/m2 and nucleation site density 9.89 × 1027 m−3. Both points can be viewed as a local minimum of MSE, while the MSE of Nelder–Mead optimization is 5.03 × 10−19 and that of Powell optimization is 7.22 × 10−19. The results are summarized in Table 1.

Fig. 3: Optimization of two parameters in the KWN model of an Al-Mg-Si alloy.
figure 3

Evolution of parameters (interfacial energy and site number density) during iterations starting at (0.07 J/m2, 1028 m−3) with a Nelder–Mead algorithm; b Powell algorithm; c comparison of MSE for two different algorithms.

Table 1 Summary of optimized parameters with different algorithms for KWN modeling in Al–Mg–Si alloy

Figure 4a, b shows the simulated radius of β″ with optimization of only interfacial energy and both interfacial energy and nucleation site density, respectively. The fitting from both algorithms shows very good agreement with the experiment by Myhr et al.16. In the case of the optimization of only interfacial energy, both algorithms lead to the same results. However, the results optimized by two different algorithms are quite different. The decision of which to rely on could be made by more detailed analysis in terms of the observed microstructure. One possible approach is to check the nucleation site practically. since the nucleation site density has some physical meaning.

Fig. 4: Simulated precipitation processes with different optimized papers.
figure 4

Plotting of mean radius of β″ precipitate as a function of time using initial and optimized a interfacial energy; b interfacial energy and nucleation site density. The experimental data are derived from Myhr et al.16.

Within the TC-PRISMA module implemented in Thermo-Calc software, the heterogeneous nucleation site can be further quantified as follows: if the particle nucleates in bulk, the nucleation site density can be estimated as 8.60 × 1028 m−3, which corresponds to every possible atomic site in the simulation volume; If the particle nucleates at the grain boundary when the grain size is 100 μm, the site density is 6.53 × 1023 m−3. The full derivation of heterogeneous nucleation site densities and other potential sites such as dislocations, grain corners, and edges, can be found in the user guide of the TC-PRISMA module9. Experimentally, the nucleation of β″ precipitates is in the bulk, so optimizations of nucleation site density which are more than an order of magnitude away from the bulk value are likely non-physical in this alloy system. Therefore, the optimized parameters with the Powell algorithm (interfacial energy 95.62 mJ/m2 and nucleation site density 9.89 × 1027 m−3) may be the better optimization for this alloy system.

Taking the optimized parameters from Powell algorithm to simulate the precipitation of two different Al–Mg–Si alloys, we simulated the mean particle length, number density and volume fraction as a function of aging time. The results are shown in Fig. 5a–c, respectively.

Fig. 5: Simulated precipitation of Al–Mg–Si alloys and comparison with experiments.
figure 5

The TC-PRISMA simulated precipitation of β″ in Al–Mg–Si alloys with respect to a mean particle length; b particle number density (inset shows zoom-in results); c volume fraction. The experimental data are extracted from Du et al.19 and Qian et al.20.

Compared to the experimental results measured by Du et al.19 and Qian et al.20, the simulated particle size and number density show good agreement with the experiment. However, the simulated volume fraction exhibits significant discrepancy with the experiment, especially when compared to Du’s result. As shown in Fig. 5c, the volume fraction of β″ is overestimated at around 104 and 105 s. However, after 106 s, the simulated volume fraction is less than the experimental data. As characterized by Dutta et al.21 and Edwards et al.22, the sequence of precipitation in Al–Mg–Si alloy is cluster of Si atoms → GP-I zones → mixture of GP-II- zones β\(\to \,{\beta }^{{\prime} }\,\to \,\beta\) (Mg2Si). In this process, the nucleation β″ depends on the location of GP zones. Therefore, with much less nucleation site, the nucleation stage may take longer time than the homogeneous nucleation. On the other hand, β″ start to transfer to \({\beta }^{{\prime} }\), forming a mixture of β″, \({\beta }^{{\prime} }\) and other precipitates, after 208 h as reported by Du et al.19. However, other precipitates are ignored in the simulation. Therefore, the measured results could be larger than the simulation since all precipitates are included in the experiment.

Ni-based superalloy: IN718

The Ni-based superalloy IN718 is widely used for its combination of strength and weldability. It is strengthened by a combination of \({\gamma }^{{\prime} }\) and γ″. The co-precipitation phenomenon of these two precipitates has garnered a lot of attention over the years. Sundararaman et al. reported the simultaneous nucleation of \({\gamma }^{{\prime} }\) and γ″ 23. Theska et al.24,25,26 and Drexler et al.27 characterized the microstructure of precipitates in terms of particle radius, number density, phase fractions as well as aspect ratios. Besides experimental characterization, computational tools can also be employed to simulate the co-precipitation of \({\gamma }^{{\prime} }\) and γ″, as reported by Zhang et al.28. Yu et al.29 further studied the effects of aging conditions on the microstructure of precipitates. However, the uncertainty surrounding the interfacial energy of the precipitates presents challenges to using these tools in a predictive way. Therefore, it is beneficial to accelerate the determination of interfacial energy through calibration with limited experimental measurements such as mean radius or particle length of precipitates.

The composition of the alloys can be found in Table 2. Some of these results and their implications on process variation have been previously published by the authors29. In this paper, we will focus on the optimization used to calibrate the interfacial energies. The experimental data are derived from Han et al.30, Sundararaman et al.23, and Devaux et al.31. The precipitate phases are \({\gamma }^{{\prime} }\) and γ″. The thermodynamic and kinetics in the simulation are TCNI12 and MOBNI6, respectively.

Table 2 Composition of IN718 superalloy in this study

To set up the simulation, some info about the precipitates should first be reviewed. The morphology of \({\gamma }^{{\prime} }\) is typically spherical or cuboidal, and the morphology of γ″ is mostly plate-like (oblate spheroidal). This can be described as

$$\frac{{x}_{1}^{2}}{{l}^{2}}+\frac{{x}_{2}^{2}}{{l}^{2}}+\frac{{x}_{3}^{2}}{{r}^{2}}\,\le \,1(l \,>\, r)$$
(1)

where x1, x2, and x3 are the coordinates of a point on the surface, and l is the horizontal radius of the oblate and r is the thickness of the spheroid. The aspect ratio α = l/r > 1.

According to Devaux et al.31, the eigenvalue of transformation strain is ϵ11 = 0.0086, ϵ22 = 0.0086, and ϵ33 = 0.0286. However, the particles may lose coherency after some time. As a simplification, we set a fixed aspect ratio for the γ″ precipitates in this work. In this regard, the elastic strain energy in this study will affect the nucleation rate and nuclei size but will not change the aspect ratio of the particle during the coarsening of precipitates. Additionally, the TC-PRISMA implementation assumes spherical nuclei and will only apply the fixed aspect ratio in the growth stage. According to Zhang et al.32, the elastic constant is a function of temperature. In this study, they are assumed to be constants over the temperature ranging from 973 to 1023 K as C11 = 174 GPa, C12 = 92.4 GPa, and C22 = 110 GPa.

Figures 6 and 7 show the evolution of interfacial energy with iterations for \({\gamma }^{{\prime} }\) and γ″ precipitate, respectively. After iterations by Nelder–Mead algorithm, the interfacial energy of \({\gamma }^{{\prime} }\) at 973, 998, and 1023 K are 20.4, 24.6, and 17.8 mJ/m2, respectively, while the interfacial energy are 20.4, 24.3, and 17.9 mJ/m2, respectively after iterations by Powell algorithm. The converged interfacial energy is very close to each other and the value lies within the applicable range summarized by Ardell33. On the other hand, the interfacial energy of γ″ at 973, 998, and 1023 K are 17.84, 27.34, and 17.3 mJ/m2, respectively, after optimized by Nelder–Mead algorithm and that are 17.98, 27.66, and 17.15 mJ/m2 after optimized by Powell algorithm. The optimized value is well below the applicable range summarized by Schleifer et al.34. The simulated \({\gamma }^{{\prime} }\) and γ″ particle sizes are shown in Fig. 8a, b, respectively, which is the optimized interfacial energy.

Fig. 6: Optimization of interfacial energy of γ′ precipitation at different temperatures.
figure 6

The variation of interfacial energy of \({\gamma }^{{\prime} }\) precipitate in IN718 with iteration at a 973 K, b 998 K, and c 1023 K, respectively. df Mean squared error of two algorithms as a function of iterations during minimization corresponding to (ac).

Fig. 7: Optimization of interfacial energy of γ″ precipitation at different temperatures.
figure 7

The variation of interfacial energy of γ″ precipitate in IN718 with iteration at a 973 K, b 998 K, and c 1023 K, respectively. df Mean squared error of two algorithms as a function of iterations during minimization corresponding to (ac).

Fig. 8: Simulated precipitation of γ′ and γ″ of IN718 superalloys with optimized interfacial energy.
figure 8

The simulated a mean radius of \({\gamma }^{{\prime} }\), b mean particle size of γ″ precipitate in IN718 superalloy as a function of time through KWN method with interfacial energy optimized by Nelder–Mead and Powell algorithm. The experimental data marked by stars are derived from Han et al.30.

As summarized by Ardell33, interfacial energy between γ and \({\gamma }^{{\prime} }\) is between 10 and 40 mJ/m2. The fitted interfacial energy through both algorithms lies within the reported range. However, according to Schleifer et al.34, the derived interfacial energy between γ and γ″ is between 90 and 200 mJ/m2. The optimized value is well below the lower limit of experiments. One possible reason is the co-precipitation.

Co-precipitation is a characteristic phenomenon in Ni-based superalloys. A lot of researchers investigated this phenomenon through the PFM since PFM has a great advantage of studying heterogeneous microstructure2,35,36. Sriram et al.2 stated that the driving force for nucleation could be

$$\Delta G=\Delta {G}_{v}-{E}^{\rm{self}}-{E}^{\rm{int}}$$
(2)

where ΔG is the chemical driving force for nucleation, Eself is the self-elastic energy for forming a critical γ″ nucleus and Eint is elastic interaction energy between an existing \({\gamma }^{{\prime} }\) precipitate and the γ″ nuclei. Ji et al.35 estimated Eint as 0.375 GPa (equivalent to 2.68 × 103 J/mol) at maximum in IN718. Therefore, the effects of elastic interaction are not negligible. To avoid redundancy, we would only focus on the precipitation of γ″ at 1023 K for the multivariate optimization of interfacial energy and elastic interaction energy additions.

Initiating from the interfacial energy 0.09 J/m2 and energy addition −1000 J/mol, the evolution of parameters during Nelder–Mead and Powell optimization is shown in Fig. 9a, b, respectively. The corresponding MSE is shown in Fig. 9c. Here we take the aspect ratio of γ″ as 1.1 since the aspect ratio at the initial stage is close to 1 according to Schleifer et al.34. The results show that MSE will converge at interfacial energy 95.41 mJ/m2, energy addition −958.2 J/mol and interfacial energy 94.12 mJ/m2, energy addition −894.7 J/mol for Nelder–Mead and Powell, respectively. The calculated MSEs are 3.29 × 10−18 and 3.38 × 10−18 for Nelder–Mead and Powell algorithms, respectively. The results are summarized in Table 3 and the simulated mean lengths of γ″ precipitates are shown in Fig. 10a correspondingly. The results with optimized parameters from Nelder–Mead and Powell optimization are shown as orange and green curves, respectively.

Fig. 9: Optimization of two parameters in the KWN model of IN718 superalloy.
figure 9

Evolution of parameters (interfacial energy and site number density) during iterations with a Nelder–Mead algorithm; b Powell algorithm; c comparison of MSE for two different algorithms.

Table 3 Summary of optimized parameters with different algorithms for KWN modeling in IN718
Fig. 10: Simulated precipitation of γ′ and γ″ of IN718 superalloys with two optimized parameters.
figure 10

a Simulated mean particle length of γ″ precipitates in IN718 superalloy as a function of time through KWN method with interfacial energy optimized by Nelder–Mead and Powell algorithm; b simulated mean particle length of γ″ with different driving force of precipitation of \({\gamma }^{{\prime} }\).

These results indicate that considering a reasonable energy addition (below the maximum elastic interaction energy reported by Ji et al.35), the simulated γ″ precipitation can exhibit a good agreement with interfacial energy which lies within the calculated range of other investigations in the literature34 (90–200 mJ/m2). Likewise, the elastic interaction from the γ″ will also have an effect on the precipitation of \({\gamma }^{{\prime} }\). Therefore, we imposed an energy addition of −500 J/mol on \({\gamma }^{{\prime} }\). The fitted interfacial energy becomes 84.5 mJ/m2. The simulated mean particle length of γ″ precipitate with updated parameters is shown in Fig. 10b (light purple curve). In contrast with the parameters fitting in Fig. 10a, the agreement becomes relatively poor in Fig. 10b at the early stage of precipitation. The overestimation is caused by treating the heterogeneous co-precipitation as a mean-field approximation is hypothesized in KWN models. The simulated mean particle sizes, number density as well the volume fraction of both precipitates are shown in Fig. 11.

Fig. 11: Simulated precipitation of IN718 alloy and comparison with experiments.
figure 11

a Simulated mean particle sizes of \({\gamma }^{{\prime} }\) and γ″ precipitates in IN718 superalloy and experimental value. The experimental data are from Anderson et al.37; b simulated number density of \({\gamma }^{{\prime} }\) and γ″ precipitates in IN718 superalloy and exp value. The experimental data are from Ahmadi et al.38; c simulated volume fraction of \({\gamma }^{{\prime} }\) and γ″ and their sum and exp value. The experimental data are from Anderson et al.37. The error bar of experimental data is not available.

In comparison with the experimental results by Anderson et al.37 and Ahmadi et al.38, the simulated sizes of precipitates and number density at aging time >2 × 105 s and the simulated total volume fraction of \({\gamma }^{{\prime} }\) and γ″ precipitates exhibit a good agreement. The disagreement at early stage of precipitation could be caused by the heterogeneous nucleation during the co-precipitation2,24. According to Han et al.30, the ratio of volume fraction between γ″ and \({\gamma }^{{\prime} }\) is around 2.5 to 4.0. Under this condition, the ratio of volume fraction between two precipitates varies from 2.64 to 4.12 after 104 s (Fig. 11c), which shows a good agreement with the experiment.

Discussion

According to the Scipy documentation and lecture notes39,40, the optimization algorithms can be classified into three categories: derivative-free, gradient, and trust-region. All of them are used for a local minimization. To be noted, there is no analytical solution of KWN models. Therefore, it is hard to derive the Jacobian (first-order derivative) or Hessian (second-order derivative), which is required for gradient and trust-region-based optimization algorithms. Therefore, a derivative-free method will be more appropriate to optimize the KWN models. Therefore, Nelder–Mead and Powell methods are employed in this work. The categories of algorithm are shown in Table 4.

Table 4 Different types of algorithms for parameter determination problems

The Nelder–Mead algorithm is a generalization of dichotomy approaches to high-dimensional spaces. According to Varoquaux et al.40, since Nelder–Mead does not rely on computing gradients, it can work on functions that are not locally smooth such as experimental data, as long as they display a large-scale bell-shaped behavior. Furthermore, Powell’s method is not too sensitive to local ill-conditioning quadratic functions. As a result, there could be several “jumps" of MSE during the optimization processes in Fig. 6. As shown in Fig. 12, the surface of MSE with the parameters interfacial energy and site number density is highly non-quadratic. To overcome this problem, we would suggest to determine the site number density of nucleation in terms of nucleation site observed in the experiment. For example, when the site number density is set as 6.25 × 1028/m−38, the variation of MSE will become a function of interfacial energy is shown in Fig. 13. Under this condition, the interfacial energy can be optimized as 99.29 mJ/m2.

Fig. 12: MSE surface with interfacial energy (J/m2) and site number density (log(#)/m3) in KWN model.
figure 12

MSE surface of parameters in the simulation of an Al–Mg–Si alloy a 3D surface; b 2D contour.

Fig. 13
figure 13

MSE variation as a function of interfacial energy when setting site number density as 6.25 × 1028/m−3 in Al–Si–Mg alloy system.

According to Wagner et al.6, the coarsening behavior of precipitates is based on Lifshitz and Slyozov, and Wagnerz (called LSW theory) and the analytical solution of interfacial energy derived by Ardell and Ozolins41 while the exponent of growth rate is fitted with experimental results. Here we compare the optimized interfacial energy of \({\gamma }^{{\prime} }\) in Ni–Al binary alloys with the calculation as shown in Table 5. The formalization of theoretical calculation can be found in the subsection of the “Methods” section. The optimized results in this work vary within 10% of tolerance. The difference could be caused by the heterogeneity of microstructure41.

Table 5 Optimization algorithms in Scipy minimize39

Two different algorithms in this work show promising results in the optimization of parameters during KWN modeling. However, there are obvious limitations to these algorithms. The biggest one is that the global minimum of MSE cannot be guaranteed. Therefore, it is always suggested to check the agreement with other experimental data in case the iterations stop at some non-physical local minimum. Alternatively, with some prior physical knowledge of the material system can be determined or have bounds set on their optimization ranges beforehand.

Moreover, in this study, we focused on optimizing the parameters in KWN models for practical purposes when experimental data is limited, instead of quantifying uncertainties. The uncertainty quantification is suggested as a future work where more advanced algorithms such as Bayesian optimization methods could be adopted. Even though the Bayesian algorithm is more powerful when dealing with multivariate optimization42, the algorithms in this work still have their advantage due to its simplified form.

In conclusion, we have demonstrated how optimization algorithms can be implemented to help optimize some of the physical parameters needed for KWN precipitation modeling in this work. The precipitation processes of two different alloys were investigated using this technique. The results indicated that the Nelder–Mead or the Powell algorithm can be adopted to optimize parameters needed for KWN modeling such as interfacial energy, and nucleation site density.

We have shown that with 40–100 iterations, the interfacial energy of a β″ precipitate in a multicomponent Al–Mg–Si alloy can be optimized. The optimized value lies within the applicable range determined in other publications. Additionally, the simulated precipitation process shows very good agreement with the experiment in terms of the mean particle length and particle number density. After determining the nucleation site from micrographic analysis, the optimized interfacial energy can be accurately determined to be 99.29 mJ/m2.

We also used a IN718 superalloy as an example to optimize the interfacial energy of \({\gamma }^{{\prime} }\) and γ″ precipitates at different aging temperatures. The optimized interfacial energy of \({\gamma }^{{\prime} }\) shows very good agreement with values determined in other publications while that of γ″ is well below. This is hypothetically caused by the elastic interaction due to the co-precipitation of \({\gamma }^{{\prime} }\) and γ″. The interfacial energy and energy additions are taken as multivariate parameters for an optimization. The simulated particle size, number density, and volume fraction of both precipitates agree well with the experiment except for the early stage of aging because the heterogeneous nucleation due to co-precipitation at early stages may not be captured by this mean-field model.

Furthermore, this work gives a possible solution to determine the unknown parameters during KWN precipitation modeling by using numerical optimization algorithms, enabling usage in a more predictive capacity. As KWN modeling has been implemented in commercial software such as Thermo-Calc, Pandat, and some open-source simulation tools such as Kawin5, this could help ease the adoption of these tools. These findings can help to facilitate the integrated computational materials engineering (ICME) process and have the potential to accelerate materials design.

Methods

The Kampmann–Wagner Numerical (KWN) Model

The KWN model is modified from the particle coarsening theory put forward by Lifshitz and Slyozov43, and Wagnerz44 (called LSW theory) and has been successfully implemented as a module called TC-PRISMA in Thermo-Calc9 or PanPrecipitation in Pandat software45. At its core, the KWN model is a mean-field model of precipitation, tracking the evolution of average properties of a bulk volume rather than the localized properties surrounding an individual precipitate. Since particles are not tracked individually, the particle size distribution (PSD) is modeled as a continuous function where particles are placed in uniformly spaced bins that represent the size of the particles. At each time step, nucleation, growth, and dissolution behaviors are calculated and the PSD is updated to reflect any changes while still adhering to strict mass balance and continuity equations.

In CNT46,47, the formation of second-phase particles is due to the heterogeneous fluctuations in a metastable solid solution. These fluctuations are assumed to occur constantly as a result of the thermal instability of the parent phase. The net free energy change of nucleus formation as a function of its radius is shown in

$$\Delta G=-\frac{4}{3}\pi {R}^{3}\Delta {G}_{v}+4\pi {R}^{2}\gamma$$
(3)

The critical radius R*-radius, at which the volumetric and interfacial energy contributions are in a state of unsteady equilibrium, can be derived as

$${R}^{* }=\frac{2\gamma }{\Delta {G}_{v}}$$
(4)

The corresponding energy barrier can be derived as

$$\Delta {G}^{* }=\frac{4}{3}\pi \gamma {{R}^{* }}^{2}=\frac{16}{3}\frac{\pi {\gamma }^{3}}{\Delta {G}_{v}^{2}}$$
(5)

The time-dependent nucleation rate J(t) is given by

$$J(t)={J}_{s}exp\left(\frac{-\tau }{t}\right)$$
(6)

where Js is the steady-state nucleation rate, τ is the incubation time for establishing steady-state nucleation conditions and t is the time. The steady-state nucleation rate Js is expressed by

$${J}_{s}=Z{\beta }^{* }N\,exp\left(\frac{-\Delta {G}^{* }}{kT}\right)$$
(7)

where Z is the Zeldovich factor, β* is the rate at which atoms or molecules are attached to the critical nucleus, N is the number of available nucleation sites per unit volume, −ΔG* is the Gibbs energy of a critical nucleus, k is Boltzmann’s constant, and T is the temperature in Kelvin. In the case of homogeneous nucleation, each atom in the whole volume of the matrix phase is a potential nucleation site. However, quantity N can also be input when the nucleation happens in the defects such as grain boundary and dislocations. The rest of the quantities can be calculated as follows:

The Zeldovich factor (Z) is a measure of the probability that supercritical nuclei with a radius slightly larger than the critical radius have a probability of passing back across the free energy barrier and dissolving in the matrix. It is related to the thermodynamics of the nucleation process in

$$Z=\frac{{V}_{m}^{\beta }}{2\pi {N}_{A}{({R}^{* })}^{2}}\sqrt{\frac{\gamma }{kt}}$$
(8)

where NA is the Avogadro number and R* is given by Eq. (4).

β* reflects the kinetics of mass transport in the nucleation process and is given by Svoboda et al.48:

$${\beta }^{* }=\frac{4\pi {({R}^{* })}^{2}}{{a}^{4}}{\left[\mathop{\sum }\limits_{i = 1}^{k}\frac{({X}_{i}^{\beta /\alpha }-{X}_{i}^{\alpha /\beta })}{{X}_{i}^{\alpha /\beta }{D}_{i}}\right]}^{-1}$$
(9)

where a is the lattice parameter, \({X}_{i}^{\beta /\alpha }\) and \({X}_{i}^{\alpha /\beta }\) are the mole fractions of element i at the interface in the precipitate and matrix, respectively and Di is the corresponding diffusion coefficient in the matrix.

Theoretically described by Langer and Schwartz49, the KWN model deals with concurrent nucleation, growth, and coarsening. Employing PSD f(R, t) in terms of particle size (radius) R and time t, the approach proceeds by simultaneously solving continuity equation

$$\frac{\partial f(R,t)}{\partial t}=-\frac{\partial }{\partial R}[v(R)f(R,t)]+j[R,t]$$
(10)

where v(R) is the growth rate of a particle of size r, and j(R, t) is the distributed nucleation rate.

In a pseudo-steady state approximation, the growth rate is simplified into solving the Laplace equation along the radial direction

$$v(R)=\left(\frac{dR}{dt}\right)=\frac{2\gamma {V}_{m}^{p}K}{R}\left(\frac{1}{{R}^{* }}-\frac{1}{R}\right)$$
(11)

where R and R* are the radius and critical radius of the precipitate, and K is the kinetic parameter that is related to the solute composition and mobility. Neglecting the cross-diffusion, K can be expressed as

$$K={K}_{\gamma }\cdot {K}_{\rm{shp}}\cdot {K}_{\rm{sphere}}$$
(12)

where Kγ is the parameter that takes into account the Gibbs–Thomson effect due to interfacial energy anisotropy. For a needle shape, \({K}_{\gamma }={\root{3}\of{\alpha }}\). For a plate shape, \({K}_{\gamma }={\root{3}\of{{\alpha }^{2}}}\) where α is the aspect ratio of the ellipsoidal particle and Kshp is the parameter that takes into account the non-spherical concentration field around the particle and can be expressed as \({K}_{\rm{shp}}=\frac{2\,{\root{3}\of{{\alpha }^{2}}e}}{ln(1+e)-ln(1-e)}\) where e is the eccentricity of the ellipsoidal particle and \(e=\sqrt{1-\frac{1}{{\alpha }^{2}}}\). Ksphere can be expressed as

$$K={K}_{\rm{sphere}}={\left[\mathop{\sum }\limits_{i = 1}^{k}\frac{{({X}_{i}^{\beta /\alpha }-{X}_{i}^{\alpha /\beta })}^{2}{\epsilon }_{i}}{{X}_{i}^{\alpha /\beta }{M}_{i}}\right]}^{-1}$$
(13)

\({X}_{i}^{\beta /\alpha }\) and \({X}_{i}^{\alpha /\beta }\) are shown in Fig. 14 (noted as \({X}_{c}^{\gamma /\alpha }\) and \({X}_{c}^{\alpha /\gamma }\), respectively). The derivation can be found in the guidance of TC-PRISMA9.

Fig. 14
figure 14

Schematic drawing of \({X}_{i}^{\beta /\alpha }\) and \({X}_{i}^{\alpha /\beta }\) during the coarsening of α precipitate in γ matrix in a binary Fe–C system simulated in Thermo-Calc software.

After the nucleation and growth have been calculated and the particle size distribution updated, it is necessary to perform a mass balance to update matrix solute concentrations. To conserve the mass, the sum of solute atoms in the matrix and the precipitate must be equal to the initial number of solute atoms. The initial mole fraction of component i in the matrix phase \({X}_{0i}^{m}\), the new concentration \({X}_{i}^{m}(t)\) can be obtained from the following relationship

$${X}_{0i}^{m}=\left(1-\sum _{p}{\int_{0}^{\infty }}\frac{4\pi {r}_{p}^{3}f({r}_{p})}{3{V}_{m}^{p}}d{r}_{p}\right){X}_{i}+\sum _{p}{\int_{0}^{\infty }}{\int_{0}^{{t}_{j}}}\frac{4\pi {r}_{p}^{2}f({r}_{p},t)v({r}_{p},t)}{{V}_{m}^{p}}{X}_{i}^{p}({r}_{p},t)dtd{r}_{p}$$
(14)

where \({X}_{i}^{p}({r}_{p},t)\) is the mole fraction of element i at the interface in the precipitate phase p of particle size rp at time t. f(rp, t), v(rp, t) and \({V}_{m}^{p}\) are the PSD function, growth rate, and molar volume of the precipitate phase p, respectively.

The elastic energy is calculated through Eshelby’s theory50,51 with a reasonable computational cost. The elastic strain energy can be obtained by

$${E}^{el}=-\frac{1}{2}{\sigma }_{ij}{\epsilon }_{ij}^{T}V$$
(15)

where V is the particle volume, \({\epsilon }_{ij}^{T}\) is the transformation strain (eigenstrain) and σij is the elastic stress, which can be calculated as

$${\sigma }_{ij}={C}_{ijkl}({\epsilon }_{kl}-{\epsilon }_{kl}^{T})$$
(16)

where ϵkl is the total strain and Cijkl is the stiffness tensor of the material. The total strain can be calculated as

$${\epsilon }_{ij}={S}_{ijkl}{\epsilon }_{kl}^{* }$$
(17)

where Sijkl can be calculated by Eshelby tensor D with

$${S}_{ijmn}=-\frac{1}{2}{C}_{lkmn}({D}_{iklj}+{D}_{jkli})$$
(18)

The Eshelby tensor can be calculated by

$${D}_{ijkl}=-\frac{abc}{4\pi}{\int_{0}^{\pi}}{\int_{0}^{2\pi}}{{\Omega }}_{ij}{n}_{k}{n}_{l}\frac{sin\theta }{{\beta }^{3}}d\phi d\theta$$
(19)

where a, b, and c are ellipsoid axes. ni(i = 1, 2, 3) are the unit directional vector normal to the spherical surface and \(\beta =\sqrt{({a}^{2}co{s}^{2}\phi +{b}^{2}si{n}^{2}\phi )si{n}^{2}\theta +{c}^{2}co{s}^{2}\theta }\). Ωij is the Green function. The derivation of Ωij can be found in Khachaturyan52.

Optimization algorithms

The optimization process can be described as follows:

  1. 1.

    Take initial guess of parameters [\({p}_{1}^{0}\),\({p}_{2}^{0}\), …, \({p}_{i}^{0}\)] where i is the number of parameters to optimize.

  2. 2.

    Simulate the precipitation process through the KWN method implemented in the TC-PRISMA module of Thermo-Calc software.

  3. 3.

    Quantify the MSE with simulated results through the MSE

    $${\rm{MSE}}=\frac{{\sum }_{n}{({y}_{n}^{\rm{calc}}-{\hat{y}}_{n})}^{2}}{n}$$

    where \({y}_{n}^{\rm{calc}}\) is the calculated quantity through TC-PRISMA and \({\hat{y}}_{n}\) is the experimental data and n is the number of samples in the experiments. The justification of MSE to optimize parameters is shown in the later subsection.

  4. 4.

    Apply the minimization algorithm in Scipy to find

    $$argmi{n}_{[{p}_{1}^{t},{p}_{2}^{t}...{p}_{i}^{t}]}\left(\frac{{\sum }_{n}{({y}_{n}^{\rm{calc}}-{\hat{y}}_{n})}^{2}}{n}\right)$$

    where [\({p}_{1}^{t}\),\({p}_{2}^{t}\), …, \({p}_{i}^{t}\)] are the updated parameters.

  5. 5.

    Repeat steps 2–4 until the convergence within the range of relative tolerance is achieved.

  6. 6.

    Output the optimized parameters.

In step 4, SciPy is an open-source scientific computing library for the Python programming language. Since version 1.0, numerous optimization algorithms have been developed39. In this study, Scipy version 1.7 is employed.

Table 5 shows the collection of optimization algorithms. Ideally, algorithms to optimize KWN modeling should satisfy the following conditions: (1) allowed to boundary-constrain the minimization algorithm; (2) Jacobian matrix is not required; (3) stopping criterion is allowed. Boundary-constrained minimization algorithms are preferred since the parameters in the KWN modeling have specific physical meanings. Therefore, there is always a limit for any of those quantities, e.g.: the coherent interfacial energy ranges from 0.01 to 0.5 J/m2 for most metals. In this regard, only Nelder–Mead, Powell, TNC, and L-BFGS-B among all the algorithms in Table 5 are satisfied.

Besides the bounds of simulation, the relative step size is also crucial. After careful testing, the automatic step size of Nelder–Mead and Powell algorithms are properly set in the simulation while the step sizes of TNC and L-BFGS-B algorithms should be manually input, which will be time-consuming. Therefore, Nelder–Mead and Powell algorithms will be employed and analyzed in this work.

Nelder–Mead algorithm

Gao et al.53 present the modified Nelder–Mead algorithm. This algorithm aims to solve the unconstrained optimization problem

$$minf({\bf{x}})$$
(20)

where \(f:{{\mathbb{R}}}^{n}\to {\mathbb{R}}\) is the called objective function and n is the dimension. A simplex is a geometric figure in n dimensions that is the convex hull of n + 1 vertices.

According to Gao and Han53, the Nelder–Mead method first generates a sequence of simplices to approximate an optimal point. At each iteration, the vertices xj(j = 1. . . n + 1) of the simplex are ordered according to f as

$$f({{\bf{x}}}_{1})\,\le \,f({{\bf{x}}}_{2})\le ...f({{\bf{x}}}_{n+1})$$
(21)

where x1 is referred to the best vertex and xn+1 is referred to the worst vertex. This algorithm will apply those four possible operations: reflection (α), expansion (β), contraction (γ), and shrink (δ). The notation in the bracket is the scalar parameters of corresponding operations. Therefore, within one iteration, the operations will execute sequentially as below:

  1. 1.

    Sort as described in Eq. (19).

  2. 2.

    Reflection. Compute the reflection point xr from

    $${{\bf{x}}}_{r}=\bar{{\bf{x}}}+\alpha (\bar{{\bf{x}}}-{{\bf{x}}}_{n+1})$$
    (22)

    Evaluate fr = f(xr). If f1 ≤ fr ≤ fn, replace xn+1 with xr.

  3. 3.

    Expansion. If fr < f1 then compute the expansion point xe by

    $${{\bf{x}}}_{e}=\bar{{\bf{x}}}+\beta ({{\bf{x}}}_{r}-\bar{{\bf{x}}})$$
    (23)

    Evaluate fe = f(xe). If fe < fr, replace xn+1 with xe, otherwise replace xn+1 with xr.

  4. 4.

    Outside contraction. If fn ≤ fr ≤ fn+1, compute the outside contraction point

    $${{\bf{x}}}_{oc}=\bar{{\bf{x}}}+\gamma ({{\bf{x}}}_{r}-\bar{{\bf{x}}})$$
    (24)

    Evaluate foc = f(xoc). If foc ≤ fr, replace xn+1 with xoc, otherwise go to step 6.

  5. 5.

    Inside contraction. If fr ≥ fn+1, compute the inside contraction point xic from

    $${{\bf{x}}}_{ic}=\bar{{\bf{x}}}-\gamma ({{\bf{x}}}_{r}-\bar{{\bf{x}}})$$
    (25)

    Evaluate fic = f(xic). If fic < fn+1, replace xn+1 with xic; otherwise, go to step 6.

  6. 6.

    Shrink. For 2 ≤ i ≤ n + 1, define

    $${{\bf{x}}}_{i}={{\bf{x}}}_{1}+\delta ({{\bf{x}}}_{i}-{{\bf{x}}}_{1})$$
    (26)

    The process can be shown graphically in Fig. 15a. This process will terminate until the convergence condition is satisfied.

    Fig. 15: Schematic of two adopted algorithms in this work.
    figure 15

    a Nelder–Mead algorithm; b Powell algorithm.

Powell algorithm

The Powell method, introduced by M.J.D Powell54, can be viewed as a gradient-free minimization algorithm in its basic form. It requires repeated line search minimizations, which may be carried out using univariate gradient-free, or gradient-based procedures. The procedure can be described below:

  1. 1.

    Initialization: select an accuracy ϵ > 0, and a starting point x(0). Set the initial search directions s(i) to be the unit vectors along each coordinate axis, for i = 1, …, n. Set the main iteration counter to k = 0, and the cycle counter i = 1.

  2. 2.

    Directional univariate minimization (take a 2D problem as an example and the graphic schematic is shown in Fig. 15b). The process can be explained as follows:

    • Starting at x(0), perform a 1D optimization along along s(1) to find extremum x(1)

    • Starting at x(1), perform a 1D optimization along along s(2) to find extremum x(2)

    • Define s(3) to be in the direction connecting x(0) to x(2)

    • Starting at x(2), repeat steps 1 to 3 until the convergence condition is met.

  3. 3.

    Termination check: a satisfactory termination criterion is generally to stop whenever at any stage of the algorithm the change in the variables is less than the required accuracy when x(n+1) − x(k) ≤ ϵ. According to Vassiliadis and Conejeros18, Powell gives a more elaborate termination check procedure. It is shown that the termination procedure is expected to be more reliable, but it is more computationally expensive since the entire minimization problem has to be resolved at least twice until the tight convergence criteria are satisfied.

Justification of MSE to optimize KWN model

In statistics, the MSE measures the average of the squares of the errors. As an estimator of given parameter \(\hat{p}\), the MSE of \(\hat{p}\) with respect to an unknown parameter p is defined as

$${\rm{MSE}}(p)={E}_{p}[{(\hat{p}-p)}^{2}]={E}_{p}[{(\hat{p}-{E}_{p}[\hat{p}])}^{2}]+{({E}_{p}[\hat{p}]-p)}^{2}=Va{r}_{p}(\hat{p})+Bia{s}_{p}{(\hat{p},p)}^{2}$$
(27)

where Ep is the mean with respect to the parameters pi. According to Eq. (27), it is shown that the minimization of MSE equals to the minimization of variance and bias. The minimization of bias shows how good the estimator is in estimating the real values and the minimization of variance of parameters \(\hat{p}\) will make sure the \(\hat{p}\) converge to a certain value. The physicality of the model is not determined by MSE value, but by the KWN framework (e.g.: mean-field assumption and CNT).

Theoretical calculation of interfacial energy in KWN models

According to Ardell33, within the framework of theories of KWN models, the analytical solution of interfacial energy between γ and \({\gamma }^{{\prime} }\) can be expressed as

$$\sigma =\frac{\Delta {X}_{e}{G}_{{m}^{{\prime}{\prime}}}}{2{V}_{m} < z > }{\left(\frac{k}{\kappa }\right)}^{1/n}$$
(28)

where ΔXe is the equilibrium concentration between γ and \({\gamma }^{{\prime} }\), \({G}_{{m}^{{\prime}{\prime}}}\) is the curvature of the molar Gibbs free energy at equilibrium concentration of γ, Vm is the molar volume of \({\gamma }^{{\prime} }\) phase, <z> = <R>/R* and <R> is the average radius and R* is the critical radius of precipitates, k and κ is a rate constant that incorporates the thermodynamic and kinetic parameters of the alloy system and n is the parameter obtained from fitting the particle size distributions. n can be fitted as 3 by the experimental data. In this regard, the dependence of σ on temperature T can be calculated as a function of temperature which can be expressed as

$$\sigma =76.7\pm 15.5-(0.055\pm 0.017)\cdot T$$
(29)

The unit of Eq. (29) is mJ/m2. The comparison of theoretical calculation and optimized value is summarized in Table 6.

Table 6 Comparison between theoretically calculated and optimized interfacial energy (unit: mJ/m2)