Prediction of flow stress in Mg-3Dy alloy based on constitutive equation and PSO-SVR model

This study conducted hot compression experiments on as-cast Mg-3Dy alloy under deformation parameters of 380 °C–470 °C and 0.001–1 s−1. The microstructure of the alloy was observed using EBSD, and the flow stress of the Mg-3Dy alloy was predicted using the Arrhenius model and the particle swarm optimization-support vector regression (PSO-SVR) model. The organizational analysis results showed that the main recrystallization mechanism in the alloy is the discontinuous dynamic recrystallization (DDRX) mechanism. The generation of twins in the alloy was mostly the result of local stress action. The optimal processing window for this alloy was determined to be 380 °C–470 °C and 0.001–0.01 s−1 through the thermal processing map. The prediction accuracies of the Arrhenius model and PSO-SVR model were evaluated using the correlation coefficient R2 and mean squared error MSE. The results showed that the PSO-SVR model significantly outperforms the Arrhenius model in prediction accuracy, with R2 value of 0.99982 and MSE of 0.074.


Introduction
Magnesium has a wide range of applications in various industries due to its lightweight, high strength, excellent electromagnetic shielding, damping properties, low processing costs, and recyclability [1][2][3][4][5].Due to its unique close-packed hexagonal (HCP) structure, magnesium alloys have fewer slip systems, greatly limiting their plastic deformation capability [6][7][8].To overcome this limitation, other alloying elements are typically added to enhance the formability of magnesium.The role of rare earth elements in magnesium has gradually attracted attention because they can strengthen and age-harden magnesium through solid solution strengthening, reduce impurities, and refine grain size.Therefore, the addition of rare earth elements can significantly improve the performance and processing technology of magnesium alloys [9,10].Dy [11,12] as one of the rare earth elements, can form high-temperature-resistant structures, enhance the mechanical and forming properties of magnesium, making magnesium alloys more easily formable [13][14][15].Mg-Dy alloys have a wide range of industrial applications in the manufacturing of orthopedic implants [16], biodegradable cardiovascular stents [17], and improved magneto-dielectric materials [18], achieved through the process of thermal deformation.
To delve deeper into the hot deformation behavior of magnesium alloys, investigating their deformation mechanisms and mechanical properties is a good starting point.During the hot deformation process of magnesium alloys, DRX is commonly observed, with continuous dynamic recrystallization (CDRX) and DDRX being the main types of DRX [19][20][21].Wang et al [22] found in the hot deformation of AZ91 alloy at 523 K, twininduced DRX primarily occurs in the form of DDRX.Li et al [23] studied the softening mechanism of Mg-2Ho alloy during hot deformation, namely DDRX and CDRX.A thorough investigation into the DRX mechanism of alloys can provide a basis for further material design and improvement.Thermal processing maps can provide guidance for alloy processing [24], identify suitable processing ranges, and better explore the thermal

Experimental process
The experiment utilized high-purity magnesium (with a purity of 99.95 wt%) and Mg-20Dy intermediate alloy as raw materials, employing a melting-casting method to produce the Mg-3Dy alloy.Oxides on the raw materials were polished off, and the prepared alloy was placed in a drying oven at 200 °C for 2 h.Once the magnesium ingot completely melted, the temperature of the melting furnace was raised to 730 °C to introduce the Mg-20Dy alloy.After complete alloy fusion, thorough stirring, skimming, and a 30 min settling period, the molten alloy solution was poured into molds.Throughout the melting process, Ar (99% proportion) and SF 6 (1% proportion) were used as protective gases to isolate the air.
Cylindrical specimens of Ø10 mm × 15 mm were prepared from the ingots.The cut cylindrical specimens were homogenized at 565 °C for 12 h.Deformation temperatures ranged from 380 to 470 °C, and strain rates varied from 0.001 to 1 s −1 , achieving a final true strain of 0.69.The entire hot compression experiment was conducted under vacuum.The alloy's deformation temperature was increased at a rate of 5 °C s −1 , followed by a 5 min holding period, and immediately quenched in water after compression to preserve the high-temperature microstructure.Identical locations of the compressed samples were selected for EBSD observation.The prepared EBSD samples were electropolished in a 7% alcoholic perchloric acid solution at −35 °C for 1 min and 35 s.

Microstructure analysis of Mg-3Dy alloys
Figure 1 shows the surface morphology of the as-cast Mg-3Dy alloy.From figure 1, it can be observed that a large number of dendritic structures are present in the initial state microstructure of the as-cast Mg-3Dy alloy.This is due to the rapid growth of grains during the solidification process of the alloy.
Figure 2 presents the IPF maps and corresponding grain size distribution diagrams of as-cast Mg-3Dy alloy after compression deformation at different temperatures (380 to 470 °C) and strain rates (0.001 to 1 s −1 ).As can be seen from figure 2(h), with the increase in temperature, the average grain sizes of the alloy are 40.86 μm, 22.18 μm, 30.92 μm, and 56.05 μm, respectively.At 410 °C, the recrystallization of the alloy is significantly activated, and the average grain size of the alloy is the smallest at this time.With the increase in temperature, the average grain size of the alloy shows a gradual increasing trend, which is due to the growth of the recrystallized grains in the alloy.When the temperature is constant, with the decrease in strain rate, the average grain sizes of the alloy are 30.28μm, 25.39 μm, 30.92 μm, and 58.49μm, respectively.At a strain rate of 0.1 s −1 , the average grain size of the alloy is the smallest, which is because the recrystallization fraction is the highest at this time.With the further decrease in strain rate, the grain size shows a gradual increasing trend, which is due to the longer heating time at the lower strain rate, allowing the grains in the alloy to have sufficient time to grow.
Figure 3 illustrates the grain boundary maps and corresponding misorientation angle distribution diagrams of as-cast Mg-3Dy alloy after compression at various temperatures (380 to 470 °C) and strain rates (0.001 to 1 s −1 ).In the figure, green lines represent low-angle grain boundaries, black lines represent high-angle grain boundaries, and red lines represent twin boundaries.Table 1 shows the variations in grain boundary and tensile twin content at different temperatures and strain rates.With the increase in temperature, the fraction of high-angle grain boundaries in the alloy is 38.1%, 40.2%, 48.6%, and 49.1%, respectively.The proportion of high-angle grain boundaries shows an increasing trend with the increase in temperature, which is because most of the grains in the Mg-3Dy alloy undergo dynamic recrystallization during the deformation process, and most of the low-angle grain boundaries are transformed into high-angle grain boundaries due to the occurrence of dynamic recrystallization.When the temperature is 440 °C, with the increase in strain rate, the fraction of highangle grain boundaries in the alloy is 55.2%, 48.6%, 35%, and 28.1%, respectively, showing a clear decreasing trend, and low-angle grain boundaries gradually become the dominant type.This is because with the increase in strain rate, dynamic recrystallization does not have enough time to form, and as the strain progresses, a large number of dislocations become entangled and form a large number of low-angle grain boundaries.
Figure 4 illustrates the KAM maps and corresponding KAM value distributions of as-cast Mg-3Dy alloy after compression deformation at different temperatures (380 °C-470 °C) and strain rates (0.001-1 s −1 ).Observations from figures 4(a)-(g) reveal significant internal generation of dislocations and energy  accumulation in the alloy after compression deformation.As shown in figure 4(a), at a temperature of 380 °C and a strain rate of 0.01 s −1 , the alloy predominantly exhibits green areas, indicating the presence of numerous dislocation tangles, with an average KAM value of 1.15°.With increasing temperature, the average KAM value of the alloy gradually decreases, indicating increased dynamic recrystallization, which consumes a considerable amount of dislocations and energy.Conversely, at constant temperature [41], figures 4(e)-(g) demonstrate that with increasing strain rate, the KAM value of the alloy after compression deformation increases from 0.60°to 1.46°.This is attributed to the decreased dynamic recrystallization time during alloy deformation due to the increased strain rate, leading to the accumulation of numerous dislocations at grain boundaries.

True stress-strain curve
Figure 5 depicts the true stress-strain curves of the as-cast Mg-3Dy alloy at temperatures (380 °C-470 °C) and strain rates (0.001-1 s −1 ).The compression ratio in this experiment was 50%, resulting in a final true strain of 0.69.The thermal compression curves exhibit significant differences due to variations in deformation temperature and strain rate.Curve (a) in figure 5 demonstrates a trend of continuous hardening, while the trends of the other curves can be roughly divided into three stages.The first stage, known as work hardening stage, involves a rapid increase in internal stress due to dislocation proliferation and diffusion, resulting in a work hardening rate higher than the dynamic recovery rate [42].Transitioning into the second stage, or transition stage, the rate of stress growth slows down as competition between softening and work hardening induced by DRV and DRX occurs.The stress reaches its peak value when the softening rate equals the hardening rate [43].Eventually, as deformation progresses, the softening rate equals the hardening rate, marking the onset of the final stage: steady-state stage, until the end of hot compression [44].

Prediction of rheological stresses by the intrinsic equations
Arrhenius model is currently the most commonly used model for calculating and analyzing the relationship between the flow stress σ of alloys and various parameters such as strain rate (ɛ) and temperature (T).The constitutive equations for ɛ mainly fall into three categories: (1), (2), and (3) [24,45,46].
The ασ values in this experiment range from 0.37 to 2.04.Equation (1) is applicable to low stresses where ασ < 0.8, while equation (2) is no longer suitable for high stresses where ασ > 1.2 in this experimental setup.Therefore, a broader stress range is accommodated by adopting equation (3), the hyperbolic sine equation.The Zener-Hollomon equation [47,48], which is a function of temperature (T) and strain rate (ɛ  ), is expressed as: Take the logarithms of both sides of (1), ( 2) and (3) as follows: To obtain the value of activation energy Q, assuming there is no functional relationship between Q and T, the calculation equation for Q is: T By combining the experimental data with equations (5)-( 8), the average slopes of (a) ln ɛ-lnσ and (b) ln ɛ-σ from figure 6 are determined to be n 1 : 5.891 and β: 0.14483, respectively.By calculating α = (β/n 1 ), the value of α is found to be 0.024586.Additionally, the average slopes of (c) ln ɛ-ln[sinh(ασ)] and (d) ln[sinh(ασ)]−1000/ T are determined to be n: 4.3623 and λ: 4.6399, respectively.Substituting these values into equation (8), the activation energy Q for the as-cast Mg-3Dy alloy is calculated to be 168.278kJ/mol.
To obtain a more precise material constant n, the formula for lnZ can be derived by simultaneously combining equations (3) and (4).
Based on the data obtained from figure 7, the intercept lnA of lnZ-ln[sinh(ασ)] is 30.19, and the slope n is 4.1513.Therefore, the constitutive equation for Mg-3Dy alloy is: According to figure 8, which illustrates the comparison between experimental and calculated rheological stress values for Mg-3Dy alloy, the hyperbolic sine function demonstrates generally good predictive performance.However, notable discrepancies are observed at lower temperatures, particularly at a strain rate of 0.01 s −1 .In the figure, 'exp' indicates experimental values, while 'cal' signifies calculated values.
The prediction performance of the hyperbolic sine function is evaluated using the coefficient of determination (R 2 ) and mean square error (MSE) [49].Here, y i represents the experimental values, y ̅ represents the average of the experimental values, and ỹrepresents the predicted values.The evaluation metrics for the hyperbolic sine function are depicted in figure 9. From figure 9(a), it can be observed that the constitutive equation's predicted coefficient of determination (R 2 :0.972), indicating a reasonably good prediction level.However, from the error plot in figure 9(b), it's evident that the maximum error occurs at 380 °C with a strain rate of 1 s −1 , reaching a high value of 38.Additionally, significant errors are observed at all temperatures for a strain rate of 0.01 s −1 .This is because the hyperbolic sine model is a physical model that does not consider the effects of twinning, slip, and recrystallization during hot deformation on the flow stress prediction, leading to inadequate prediction of the alloy's rheological behavior.

Thermal processing map
The thermal processing map is an essential tool for optimizing thermal processing techniques, documenting the material's plastic deformation capabilities under various thermal deformation conditions, including the influence of deformation temperature, strain rate, and strain, obtained by overlaying power dissipation maps and instability maps [50].The power dissipated by the alloy during thermal deformation consists of two parts: one part is dissipated due to plastic deformation (G), and the other part is dissipated due to microstructural changes (J) [25], expressed as: The power dissipation factor (η) is utilized during the forming stage of materials to depict the ratio of energy consumed during the processing process, which has a close correlation with the microstructural evolution of the alloy.Its expression is: In this equation, J max represents the maximum power dissipation, while m denotes the strain rate sensitivity index, with the expression for m being: The value of η does not directly reflect the formability of the material; instead, it needs to be studied in conjunction with instability maps.The formula for the instability map obtained using the theory proposed by Prasad et al [51] is as follows: Where ξ (ɛ) represents the instability parameter, and when ξ(ɛ) is less than 0, the alloy undergoes flow instability.Utilizing the instability parameter can guide the design and optimization of the processing process.
A thermal processing map of Mg-3Dy alloy was constructed by superimposing the power dissipation map and instability map at a true strain of ε = 0.69.In figure 10, contour values represent the magnitude of the power dissipation factor η, where the blue region indicates the material's instability area and the green represents the suitable processing zone.Typically, the critical η value for suitable processing in magnesium alloys is 0.3, so the boundary of the region represented by η > 0.3 in the map is marked with a black solid line.It is evident from the map that temperature and strain rate have a significant influence on the processing map.Particularly at T = 380 °C and ɛ  = 1 s −1 , the alloy is in the instability zone, which explains why the Arrhenius model has such a

Evolution of microstructure
Observations from the IPF map in figure 2 reveal significant effects of deformation temperature and strain rate on the microstructure of Mg-3Dy alloy after hot compression.To further understand the influence of deformation temperature and strain rate on the alloy's dynamic recrystallization behavior, figure 11 illustrates the recrystallized microstructure and its distribution of Mg-3Dy alloy under different deformation conditions.It is evident from the figure that with increasing T and decreasing ɛ, the number of deformed grains in the alloy gradually decreases, while the quantity of substructures and recrystallized grains increases.This is attributed to the fact that higher temperatures and lower strain rates significantly promote dynamic recrystallization in Mg-3Dy alloy, leading to a notable reduction in the number of deformed grains and an increase in the quantity of substructures and recrystallized grains.
To further explore the dynamic recrystallization mechanism of Mg-3Dy alloy during compression, analysis was conducted on representative regions in the IPF map of figure 2. Figure 12 presents the analysis results of the dynamic recrystallization mechanism in the R1 region of figure 2(f).Figures 12(a)-(b) depict the IPF map and KAM map of the R1 region, respectively.Figure 12(a) reveals distinct necklace-like structures, characteristic of discontinuous dynamic recrystallization.As compression deformation initiates, a large number of dislocations generated within the alloy migrate towards grain boundaries, accumulating at these boundaries and causing boundary protrusions.Dislocation accumulation at grain boundaries results in the generation of significant energy and numerous low-angle grain boundaries, leading to substructures.Under the driving force of dislocations, substructures undergo rotation, giving rise to recrystallized grains.It can be inferred that the R1 region exhibits typical characteristics of DDRX [51][52][53].Additionally, figure 12(c) presents the distribution of misorientation angles along the straight MN axis and KAM values, revealing recrystallized grains with largeangle grain boundaries and low dislocation density.This is attributed to the rotation of subgrains altering grain misorientation, while the rotation of substructures consumes considerable energy, resulting in a decrease in dislocation density.Figure 12(d  randomness in the distribution of recrystallized grains, which can effectively reduce the texture strength to some extent. Four typical regions (R2, R3, R4, and R5) were selected for analysis in figure 2. Figure 13(b), (f), (j), and (n) show the {0001} pole figures for each region.The orientation difference between the compression twins and the matrix is approximately 56°(see figure 13(a) and (e)), while the orientation difference for the tension twins is about 86°(see figures 13(i) and (m)).Additionally, the orientations of the matrix and twins in the {10 ̅ 11} and {10 ̅ 12} pole figures were analyzed.Since twins usually evolve from the matrix grains, they often share a common {10 ̅ 12} or {10 ̅ 11} plane with the matrix [54,55].Therefore, identifying the shared poles in the pole figures can help recognize the twin variant types, which is crucial for understanding the twinning behavior.
In the tables in figures 13(d), (h), (l), and (p), the Schmid factors (SF) of these four twin variants were calculated and verified, and the corresponding variants of the four twins are marked in red.Among the four twin variants, the variant corresponding to twin G1 exhibits the highest SF among the six twin variants, which is consistent with the maximum SF law.However, the activation of twin variants G2, G3, and G4 does not follow the maximum SF law.This is attributed to the low experimental temperature, which leads to severe stress localization, consistent with the experimental results shown in figure 2. Severe stress localization can lead to significant stress differences between different regions of the grains, sometimes even exceeding the local shear stress required for the activation of low Schmid factor variants.As a result, some twin variants with lower SF values can be activated, nucleated, and grow.

PSO-SVR model
The Support Vector Regression (SVR) algorithm is a classical regression method proposed by Vapnik [56].The core idea of SVR is to minimize the error between predicted and actual values while maintaining the boundaries.For the given problem, the optimization equation of SVR is as follows: In this context, ω represents a column vector with n dimensions, b denotes the displacement term, C stands for the regularization constant which is greater than zero, ε represents the computed loss, and ξi and ξi * are slack variables.
SVR tackles nonlinear problems by employing kernel functions to map them into higher-dimensional spaces for processing.The kernel functions in SVR include linear, polynomial, sigmoid, and radial basis kernel functions [34].We adopt the radial basis kernel function, which is most suitable for regression problems, with the following expression: 2 The function of the optimal hyperplane in high-dimensional space is determined by the kernel function: αi and αi * are Lagrange multipliers used to solve quadratic programming problems.The velocity update formula for particle i in the d-th dimension: Particle i's position update formula in the d-th dimension: V represents velocity vector.c 1 is the cognitive learning factor, c 2 is the social learning factor, and r 1 , r 2 are random numbers on [0,1].ω is the inertia weight, where a larger value indicates a tendency to maintain the previous movement trajectory and explore unknown areas more.The detailed flowchart of PSO-SVR for predicting flow stress is shown in figure 14.
This study utilizes the Python platform for prediction.During the computation process, the initial particle swarm size is set to 30, with 100 evolution generations, c 1 : 0.5, c 2 : 0.3, ω: 0.9.A total of 1104 input-output pairs were selected from the experimental hot compression curves, among which 208 stress points in the strain range of 0.05-0.65 with a step size of 0.05 were not used for training, but were used to validate the predictive ability of PSO-SVR.The remaining 896 input-output pairs were used as the training set to train the PSO-SVR model.In this case, the range of C values was from 1 to 20000, with a step size of 1000; the range of epsilon values was from 1 to 2.5, with a step size of 0.1; the range of gamma values was from 1 to 25, with a step size of 1.After calculating with the particle swarm algorithm, the optimal SVR parameters corresponding to the best R 2 were obtained as follows: C was 19000, epsilon was 2.0, and gamma was 15.The predicted results are depicted in figures 15 and 16.
Figure 15 represents the flow stress prediction graph of the Mg-3Dy alloy using the PSO-SVR model.To facilitate comparison with the Arrhenius model's accuracy, the PSO-SVR predicted flow stress points are also selected at 13 points with a strain interval of 0.05.This model utilizes a random 90% of the data from each hot compression curve as the training set, with the remaining 10% as the testing set.Evaluation of this model is also based on the R 2 and MSE.From figure 15, it is evident that the PSO-SVR model demonstrates high accuracy in predicting flow stress.

Comparison of the PSO-SVR model with the Arrhenius model
The comparison of precision between the PSO-SVR model and the Arrhenius model in predicting the flow stress of the Mg-3Dy alloy is shown in the graph below.From the graph, it can be observed that the R 2 value of the PSO-SVR model, 0.99982, is superior to that of the Arrhenius model, which is 0.97214, indicating a higher predictive accuracy.Moreover, the MSE of the PSO-SVR model is approximately a hundred times smaller than that of the Arrhenius model, demonstrating its excellent performance.
The reason for this discrepancy is that the Arrhenius model only predicts the flow stress of the Mg-3Dy alloy from a physical perspective, without considering the influence of other factors such as twinning, slip, and recrystallization during thermal deformation.Hence, its predictive accuracy is not as ideal.On the other hand, the PSO-SVR model captures the nonlinear correlation among temperature, strain rate, strain, and stress of the Mg-3Dy alloy in the training dataset.The model encompasses all the thermal deformation mechanisms of the alloy present in the training dataset, which explains the high accuracy of the PSO-SVR model in predicting flow stress.

Conclusion
This study investigates the hot deformation behavior of as-cast Mg-3Dy alloy and establishes PSO-SVR and Arrhenius models for predicting its flow stress.The important results of the entire text are as follows: (1) The DRX mechanism in the microstructure of Mg-3Dy alloy was analyzed.In this experiment, the deformation of Mg-3Dy alloy was primarily dominated by DDRX, showing characteristics of a necklacelike structure.As T increases and ɛ  decreases, the recrystallization behavior of the alloy was promoted.
(2) Based on the hot processing map of Mg-3Dy alloy, the optimal processing temperature and speed range for this alloy were determined to be 380 °C-470 °C and 0.001-0.01s −1 .
(3) The precision of the PSO-SVR model and the Arrhenius model in predicting the flow stress of the Mg-3Dy alloy was compared using the R 2 and MSE.The results showed that the R 2 of the PSO-SVR model (0.99982) was higher than that of the Arrhenius model (0.97214), indicating its better applicability in predicting the flow stress of the Mg-3Dy alloy.

Figure 2 .
Figure 2. IPF maps and grain size distribution maps of compressed Mg-3Dy alloy.

Figure 3 .
Figure 3. Grain boundaries maps and misorientation angle distribution maps of Mg-3Dy alloy.

Figure 9 .
Figure 9. (a) Correlation between calculated and experimental values of hyperbolic sine function, (b) mean square error between calculated and experimental values of hyperbolic sine function.
) represents the pole figure of the R1 region, indicating a certain degree of

Figure 14 .
Figure 14.Depicts the flowchart of the PSO-SVR model for predicting the flow stress of Mg-3Dy alloy.

Figure 16 .
Figure 16.Comparison of the correlation and mean square error between predicted and experimental flow stress values.(a), (c) Arrhenius model; (b), (d) PSO-SVR model.