Inverse Problem in Stochastic Approach to Modelling of Microstructural Parameters in Metallic Materials during Processing

)e need for a reliable prediction of the distribution of microstructural parameters in metallic materials during processing was the motivation for this work. )e model describing the evolution of dislocation populations, which considers the stochastic aspects of occurring phenomena, was formulated. )e validation of the presented model requires the application of proper parameters corresponding to the considered materials. )ese parameters have to be identified through the inverse analysis, which, on the other hand, uses optimization methods and requires the formulation of the appropriate objective function. In our case, where the model involves the stochastic parameters, it is a crucial task. )erefore, a specific form of the objective function for the inverse analysis was developed using a measure based on histograms.)e elaborated original stochastic approach to modeling the phenomena occurring during the thermomechanical treatment of metals was validated on commercially pure copper and selected multiphase steel.


Introduction
Continuous development of transport, including airplane, automotive, and rail industries, is associated with searching for new construction materials that combine high strength with good formability and a high strength-to-density ratio. ese features can be obtained for metallic materials by a generation of multiphase microstructures with hard constituents dispersed in a soft and ductile matrix. On the other hand, sharp gradients of properties between phases in these materials cause a tendency to the local fracture, limiting the stretch-forming processes [1,2]. Design of the multiphase microstructures with smoother gradients of features gives better local formability, and such a hypothesis was put forward in [3].
Advanced numerical models are needed to gain knowledge on distributions of microstructural features and resulting properties. Numerical tools, which will predict these distributions in heterogeneous materials, are intensively searched for. Extremely fast progress in this field has been observed during the last decades. Meanfield and full-field material models are distinguished in the scientific literature; see review in the Ph.D. thesis [4]. In the former, the microstructure is implicitly represented by closed-form equations describing grain size, dislocation density (uniform per grain), the kinetics of phase transformations, etc. e latter is based on an explicit microstructure representation using Representative Volume Element (RVE) or Digital Materials Representation (DMR) concept [5] and Integrative Computational Materials and Process Engineering (ICMPE) [6]. e predictive capabilities of the full-field models are much more comprehensive, but they involve much larger computing times. erefore, despite their limited predictive capabilities, the fast mean-field models are still used in the design of materials processing.
It is believed that the description of the heterogeneous microstructure of metals and alloys using internal variables as independent ones and with the distribution functions of various features will allow building the mean-field model with the capability to predict gradients of final product properties. e former allows accounting for the history of the process. e latter accounts for a stochastic character of the phenomena and predicts a distribution of parameters instead of the average values.
Internal variables describe microstructure features that determine the material behavior on a macroscale. Implementation of internal variables to a model allows accounting for the history of the process [7,8]. In terms of the above statements, the present work was directed to upgrade the mean-field internal variable model using dislocation density as an example. is upgrade was based on the stochastic solution of the dislocation density equation. In consequence, a bridge between mean-field and advanced full-field models was created. e proposed model should be fast and should give microstructure evolution for a stochastic internal variable, gradients of microstructural parameters, and supply results comparable to full-field models.
Reliable simulations of material processing require proper quantitative evaluation of model coefficients specific to the considered material. e coefficients' estimation for classical material models, called an inverse analysis, is well known and widely discussed in the literature [9,10]. Since the problem is ill-posed, one solution is transformation to an optimization task with an appropriately defined objective function.
e formulation of that objective function is a vivid problem of the inverse analysis. While that problem is pretty well recognized when deterministic equations describe the model, it is not simple for a stochastic approach. e model output is a histogram, not a single quantity. erefore, the authors proposed a method dedicated to inverse problems for stochastic models with an original solution in the formulation of the objective function as the measure of the difference between two histograms: the target one, characteristic for a specific material, and the one obtained with the coefficients returned by optimization.
Recapitulating, the general objectives of the present work compose development and validation of the stochastic approach to modeling metals processing using stochastic internal variables and investigating the possibility of performing an inverse solution for this approach using the original formulation of the objective function based on the histograms. e focus was on the dislocation density fields, which play a crucial role in the microstructure development and influence local properties. e elaborated mean-field model was validated, and the results of its application to real metals, pure copper, and selected multiphase steel are presented in the paper.

Engineering Background and Motivation
As mentioned in the Introduction, there is a continuous search for construction materials, which combine high strength with good formability and a high strength-todensity ratio. In spite of their reasonably high density, steels meet these requirements, and due to their low costs of manufacturing and good recyclability, they are still commonly used. Intensive research during the last few decades has shown a vast potential for improvements in the properties of steel. e development of multiphase Advanced High Strength Steels (AHSSs) is an example of this tendency [11,12]. ese steels combine soft and ductile ferrite matrix with hard constituents of bainite, martensite, and retained austenite. Properties of multiphase steels are controlled not only by volume fractions of phases and the size of particles but also by their distributions [3,13]. It concerns mainly distributions of the dislocation density [14] and the grain size [15] but other microstructural features are considered [16], as well. Similar microstructure heterogeneity is obtained in nonferrous alloys by precipitation, e.g., in Cu-Cr alloys [17]. Since sharp gradients of properties between phases cause a decrease in the local fracture resistance, the design of multiphase microstructures with more homogeneous properties and smoother gradients of their features is a challenge. e growing interest in materials with heterogeneous properties implies intensive research in the area of process modeling toward the prediction of the distribution of various parameters in the microstructure, accounting for the history of the process. is need was a motivation for our work. Models based on the internal stochastic variables and on a statistical description of a microstructure can cope with these requirements. ey can contribute to the analysis of heterogeneity of properties. Among a few factors, which influence the distribution of the properties in the alloy's microstructure (segregation of elements, precipitation, size of hard constituent islands, and dislocation density), the last one was selected for the analysis in the present work. Dislocation density is an internal variable, which accounts for the history of the process and describes phenomena of hardening, recovery, and recrystallization in the conditions of varying temperatures and strain rates. ese phenomena control the behavior of metals and alloys during processing. Beyond this, the dislocation density has an effect on phase transformations during further processing by controlled cooling.
us, the development of the mean-field model, which describes the distribution of the dislocation density in metallic materials during processing, was the paper's primary objective. e model based on the solution of the evolution of dislocations equation for a stochastic variable is described in the next section. e reliability and accuracy of any material model used in numerical simulation depend, to a large extent, on the correctness of the determination of material coefficients. ese coefficients are usually determined based on experiments in conditions similar to those used during the processing in terms of temperature and strain rate. e experiments, which involve the deformation of samples, are usually affected by the heterogeneity of temperatures and strains caused by deformation heating and friction. To eliminate the effect of disturbances in the experiments, they are simulated with numerical methods, e.g., the finite element technique, which reproduces inhomogeneities [18]. e numerical model corresponds with the experiment, while the material model included in the FE code is fed with the coefficients characteristic for the considered material. Hence, the problem of identification of material model coefficients becomes an inverse problem [9,10]. Since such an inverse problem is ill-posed, it requires regularization, and one of the techniques is transformation to an optimization task. A typical application of the inverse approach to the identification of the model parameters requires [10]: us, the objective function has to be built with stochastic information-histograms. erefore, formulation of the inverse problem based on the histograms dedicated to the identification of coefficients of a stochastic material model was our final goal.
For testing the inverse approach based on a stochastic model, the experiment was substituted by the set of histograms generated by the model. e coefficients were obtained by fitting to the mean dislocation density results described in [19]. ese coefficients were disturbed randomly, and an inverse solution was performed. Various metrics describing the distance between histograms were tested in the objective function, and various optimization methods were applied. e efficiency and accuracy of different approaches were evaluated.

Stochastic Approach in Modeling of Evolution of Dislocation Density
Modeling of materials processing based on internal variables (Internal Variable Method (IVM)) has been widely used since the late 1990s [7,8,20]. It is due to an essential drawback of the external variable-based models. During deformation, when processing conditions (temperature, strain rate) are suddenly changed, in the real material, some delay in the response is observed, which is due to the inertia of the microstructure changes. A model defined as a function of only external variables (strain rate, temperature) moves material to a new state with no delay. Implementation of internal variables to a model solves this problem [7,8]. IVMbased model remembers the history of the process and reproduces a delay of the materials' response properly. As was described in the previous section, dislocation density is the primary internal variable in the modeling of metallic materials. e statistical approach to modeling dislocation density fields in the present work is based on the deterministic model. e authors' solution of this model is described in detail in earlier publications [19,21], and only the main equations are repeated here for the completeness of the paper. e considered model was based on a delay differential equation describing the evolution of dislocation populations originated from the Kocks-Estrin-Mecking (KEM) model [22,23] with the dynamic recrystallization term introduced in [24]. e evolution of dislocation populations in the model is controlled by hardening, recovery, and recrystallization. e fluctuation in the dislocation density due to these phenomena was described by the evolution occurrence expressed by the delay differential equation as follows: where t is the time, _ ε is the strain rate, t cr is the time at which critical dislocation density (ρ cr ) for recrystallization is reached and recrystallization begins, 1 (t cr ,+∞) (t) is the indicator function, and A 1 , A 2 , and A 3 are the parameters of the model responsible for of the athermal storage (hardening) of dislocations, recovery, and recrystallization, respectively.
Coefficients in (1) are defined in Table 1, where b is the Burgers vector, Z is the Zener-Hollomon parameter, l is the average free path for dislocations, T is the temperature in K, D is the grain size, G is the shear modulus, and ρ cr is the critical dislocation density for the dynamic recrystallization.
A thorough discussion of the solution of the delayed differential (1) is described in publications [19,20], including mathematical background, analysis of various approximations of the solution, and proof of its stability. e critical time t cr is introduced to reproduce the onset of the dynamic recrystallization. In real material, however, the recrystallization phenomenon occurs in a different time in various parts (various material points), which is stochastic in nature. e model describes this process on average; therefore, it is not able to reproduce this nondeterministic behavior of the material, providing only partial insight into the process. Furthermore, the critical time t cr is not a physical quantity; it only allows for averaging the behavior of the material. is simplification is a weak point of the model (1). To avoid this "artificial" critical time and to build the model consistent with reality, a stochastic approach based on equation (1) was proposed in the present work.
As the first step, (1) was rewritten to the following discrete form: where t i is the time of i th iteration and Δt is a time step.
To eliminate the critical time t cr from (6), the influence of delay in model (1) was replaced by the stochastic variable ξ(t i ), so the evolution of the dislocation density in the function of time becomes stochastic: Mathematical Problems in Engineering Coefficients A 1 and A 2 responsible for hardening and recovery are defined as in the deterministic model (1); see Table 1. An artificial term with coefficient A3 in equation (6) was replaced by a stochastic variable, which accounts for the stochastic character of the recrystallization. e parameter ξ(t i ), representing this stochastic variable, satisfies where p is the function that bounds together with the probability that the material point recrystallizes in a current time step and the present state of the material. is function is calculated as In (9), coefficient c represents a mobile fraction of the recrystallized grain boundary area and is calculated as (see [24]) where q is a small number representing a nucleus of a recrystallized grain, which is added to avoid the zero value of c for P[ξ(t i-1 ) � 0] � 0. We assume q � 0.1 and we define ξ(t 0 ) � 0. ere are two models investigated in the paper: the deterministic model defined by (1) and the stochastic model defined by (7). In the following part of the paper, we will refer to these models as M1 and M2, respectively. Note that (7) deals with probability distributions rather than uniquely determined values of ρ. To reveal those distributions, we executed particular trajectories of (7) several times with randomly generated values of ρ(t i ) and aggregated them into histograms at consecutive time steps t i . is way, each point is subject to dynamic recrystallization depending on the random parameter ξ.. e initial value of the dislocation density ρ(0) for each point at time t 0 � 0 is selected as 104 m −2 .
All numerical tests described in this section and in the next section were performed for the parameters given in Table 2, corresponding to the commercially pure copper. ese coefficients were estimated to correspond to the average dislocation density for the experimental data described in [19]. ese data were obtained from the tests performed at the temperatures of 475°C, 575°C, and 675°C and strain rates of 0.1 s −1 and 1 s −1 .
Examples of solutions obtained for the model M2 for copper are presented in Figure 1, where evolutions of dislocation densities were obtained for two randomly chosen representations of time-dependent values of ξ for the same ρ(t 0 ) (shown with different colors). It can be observed that, due to the stochastic character of (7), any run of the dislocation density model described by that equation may give different solutions presented with different colors in Figure 1.
At first sight, the solution obtained for a particular instance of the stochastic model M2 (see Figure 1) is entirely different from that obtained from the experiment or the deterministic model (1) (see Figure 2(a)). However, as we will see later, since equation (7) has a stochastic character, only the average value of ρ from multiple runs gives the proper representation of average dislocation density in the entire volume of material. Indeed, the calculated trajectory of the evolution of dislocation density obtained from 10 000 solutions of the stochastic model M2 shown in Figure 2(b) is qualitatively similar to that in Figure 2(a).
In practical applications, a single solution of the (7) is related to one material point. Prediction of behavior of a particular volume of material requires information on the behavior of many material points. e equation is solved as many times as there are material points assumed in the model. e influence of the number of assumed material points on the results was investigated in the present work, and the conclusions are presented in the next section. In terms of the stochastic approach, the more points, the more reliable solution for the entire volume of material. Analyzing all solutions together, dislocation density distribution is obtained, which can be represented by histograms. us, each solution at time t i is assigned to the bin, which aggregates the values from a specific range of dislocation densities. e more values assigned to a particular bin, the higher probability of obtaining a value from a certain range.
e example of such a histogram for the selected time t i is presented in Figure 3.

Validation of the Stochastic Model
e investigated model was validated for two materials. To gain the material characteristic, several plastometric tests were performed and loads as a function of time and a displacement of a tool were recorded [25]. ese quantities Table 1: Relationships describing coefficients in equation (1).  were recalculated to the average of dislocation densities with the inverse approach developed by the authors [18]. e commercially pure copper was the first examined material, which, due to the single-phase microstructure, was much easier for testing and validation of the model. Dual-phase steel with heterogeneous multiphase microstructure was the second considered material. e primary validation of the stochastic model is composed of numerical tests, which are aimed at evaluating the influence of the numerical parameters on the model's output and its performance. e computation time of a mathematical model is an impactful factor in terms of optimization techniques used during the inverse analysis, which requires several thousands of model recalculations in order to achieve a satisfactory result. erefore, the preliminary step is the analysis of the possibility of minimization of computation costs. In our case, the simplest way was to reduce the number of solutions used to create a single histogram. However, this reduction should be made with caution because of the stochastic nature of the model. If the number of solutions is too low to create a reliable histogram, then the random factor has a huge impact and the results are not reproducible. erefore, we decided to conduct a series of tests in order to find the optimal number of solutions and bins [26]. Each test was conducted on 10 different sets of parameters.
e values of parameters in these sets were obtained by randomly distorting the values from Table 2 in the range ±20% of the base value. For each of those sets, we computed 10 histograms. e first histogram computed in each set was used as the target histogram for comparison with the remaining nine histograms in the set. To compare histograms, we used the Mean Average Percentage Error, which is defined by the following formula: where n is the number of bins, H 1 and H 2 are the compared histograms, and H j (i) is the number of elements in the i-th bin of histogram H j .
Due to the high probability of obtaining histograms with a significantly different number of elements in each bin, we proposed a slightly modified version of the MAPE, which we call Weighted Mean Average Percentage Error (WMAPE). is error is defined by the following formula: And after mathematical transformation, where m is the number of all elements in histogram H 1 . e results of numerical tests are presented in Table 3. After considering the results, we decided to use 10 bins and 40 000 solutions per histogram, as it is the configuration that yields the best results while retaining acceptable computational time.
In order to test the impact of a time step on a solution for copper, we computed the cumulative probability of dislocation density reduction after the given time. Roughly speaking, it is the probability that ξ(t i ) (equation (7)) obtained the value ξ(t i ) � 1 at least once during the process time t p . e time steps used were 0.008 seconds and 0.0008 seconds. A smaller time step means more testing times t i until reaching t p . e number of solutions was 40000 in each case. e results of the numerical tests for the temperatures of 475°C and 675°C are presented in Figure 4. We can see that cumulative probabilities look similar despite much different time steps.

Inverse Analysis
Application of the developed stochastic model M2 to real materials and processing methods requires the identification of model coefficients. e problem of coefficients identification in material models is well known and widely discussed in the scientific literature as an inverse problem [9,10]. e stochastic model contains a vector of coefficients a � {a1, . . ., a10}, which become design variables in the inverse analysis. However, the classical inverse problems are not defined for stochastic models and the random parameter ξ, corresponding to the recrystallization. e application of the inverse analysis for histograms is not known in scientific literature.
e authors decided to redefine their classical inverse approach described in [10,18] for a stochastic variable material model. Definition of model output is necessary to solve an inverse problem. Taking into account the real materials and the experimental data, a certain volume of material is considered. erefore, the model solution has to be defined as a distribution of dislocation density (histogram); see Figure 3.
us, considering the stochastic nature of the process, it is necessary to be able to compare the model outputs for particular sets of coefficients, taking into account the fact that the random factor ξ can generate completely different single solutions of (7); see Figure 1.

Formulation of the Inverse Problem for Materials
Processing. A mathematical formulation of any material model or material processing model is a direct problem. Let K : X ⟶ Y be a mapping between two normed spaces X and Y: e mapping K describes a process under study. Vector x contains two sets of parameters, coefficients in the model a, and process parameters p, x � {a,p}.
In the case of material processing, the first quantity includes material model coefficients and the latter includes parameters describing the process conditions. Temperature and strain rate are the most common parameters when plastometric tests are considered as a process [25]. For the operator K, two problems can be defined.
(i) A direct problem: for known x, evaluate y � Kx (ii) An inverse problem: for known y, solve the equation for x In the case of the thermomechanical deformation problems, which are considered in the present work, two classes of inverse problems are distinguished: (i) An identification problem: estimation of quantities a characterizing a material (ii) A reconstruction problem: determination of process parameters p for the known model coefficients a Both cases were considered. e problem of reconstruction, which allows finding process parameters giving the required output, is known as process optimization [27].
To solve a physical problem, its mathematical model must be well-posed, which means that a solution to the problem exists, it is unique, and it continuously depends on the data (the stability property). If there is more than one solution, additional, more restriction conditions must be included in the model. Since in the case of thermomechanical processing of metallic materials the material models are nonlinear, the inverse problem is transformed into an optimization task, as shown in Figure 5. e optimal parameters are determined by searching for a minimum of the following objective function: where y c is the outputs calculated for model coefficients a and process parameters p, y m is the measurements in the experimental tests with process parameters p (for identification task) or required output of the technological process (for reconstruction task), and d is the metric in the output space.

Mathematical Problems in Engineering
For the identification task, the objective function (15) is minimized with respect to model coefficients a, and the experimental data include the information on dislocation density distribution for the problem considered in this paper. For the reconstruction task, function (15) is minimized with respect to the process parameters p, and the experimental data consists of, e.g., desired distribution of dislocation densities in the material at the final stage of the process. e author's inverse algorithm is described in [18]. Problems of uniqueness and well-posedness of the solution, as well as application of regularisation, are discussed in that publication. In the present work, considering the stochastic nature of the model M2, this algorithm was adopted and applied to the novel objective function based on a comparison of histograms, as described in the following section.
is comparison requires defining a metric describing how much one histogram differs from the other. In the work, various stochastic metrics were tested in terms of application in the inverse analysis; see the next section.

Objective Function.
For the purpose of evaluating the quality of solutions obtained from the optimization technique used in the inverse analysis, it is crucial to define an objective function, which is adequate to the analyzed problem. In the case of the inverse approach, we are looking for the coefficients a � {a 1 , . . ., a 10 } of the proposed stochastic model M2.
e process parameters are known, and they compose temperatures (T) and strain rates (_ ε) in the tests p � {T 1 , . . ., T k , _ ε 1 ,. . ., _ ε k }, where k is a number of tests. Due to the stochastic issue of the problem, it was decided to use the objective function (15) based on the similarity of histograms generated by the target parameters and the parameters returned by the optimization method. It means that the metric d(y c , y m ) in function (15) has to be substituted by the distance between histograms. Such defined objective function can be considered as a measure of the optimization quality for the stochastic problem. e issue was choosing the appropriate metric for histograms comparison. For that reason, various metrics of histograms were tested. Obtained results for different metrics are compared and discussed in the section Numerical Results and Discussion.
We will present several different definitions determining a function d (H 1 , H 2 ), allowing the comparison of two histograms. In what follows, H j ( i ) is the number of elements in i-th bin of the histogram. We will rely on well-known distance measure functions (e.g., see survey paper [28], cf. [29]): where And if is equal to 0, it is replaced by a small number ε � 10 −9 for numerical reasons. e first to consider is the Euclidean distance, which is perhaps the most intuitive approach to comparing histograms [28]: where n is the number of bins, H 1 and H 2 are the compared histograms, and H j (i) is the number of elements in i-th bin of histogram H j . e Euclidean distance equally punishes the situations with single high errors and numerous small errors. Another approach to define d is the Chi-Square function [29], given by Contrary to the Euclidean distance, this goal function punishes single high errors much more than small errors. is is caused by the fact that it involves the square of the difference between values of a certain bin in two histograms but does not perform a root extraction of this square.
Another standard distance measure is the Hellinger function (see [29]). A drawback of that approach is that it involves an average value of the histograms, which sometimes, in real problems, we may not have. erefore, we decided to use a Matusita function which has a similar formula but does not involve the averages (see [28]): Another approach is the Bhattacharyya distance measure [28]:  ��������� P 1 (i)P 2 (i). (21) e last considered function is the Kullback-Leibler one. It should be noted that this function is not metric, because, in particular, it is asymmetric [29]: e formula (22) includes a logarithm, so it can be expected that the single, high errors will be punished less (smoothed). e metrics of histograms defined by functions (18)- (22), which determine a distance d (H 1 , H 2 ), were tested with the objective to choose the best metric for histograms comparison in the inverse analysis.
Since MAPE and WMAPE give the information regarding only the differences between the considered bins, we will use additionally the Earth Mover's Distance as a ranking function defined by the following formula: e EMD ranking function is more sensitive to the shape of histograms than the difference between particular bins. Obtained results are discussed in the next section.

Numerical Results and Discussion
e whole analysis in this section was performed for commercially pure copper. In order to show the general character of the developed approach, a selected example for the dual-phase (DP) steel is presented, as well.

Commercially Pure Copper.
In what follows, we are going to compare the utility of proposed metrics in optimization.
e test was the inverse analysis based on the histograms described above. e objective function was one of functions d (equations (18)-(22) from the previous section). e target coefficients responsible for hardening (a 1 , a 9 ), recovery (a 2 , a 3 , a 7 ), and recrystallization (a 4 , a 5 , a 6 , a 8 ), as well as activation energy in the Zener-Hollomon parameter (a 10 ), were the real-life values for copper. e target histograms were created for 3 different temperatures 475°C, 575°C, and 675°C, as well as 3 different strain rates 0.1 s −1 , 1 s −1, and 10 s −1 . is means we had 9 different histograms for tests, each aggregated 10 000 different solutions, which were distributed between 10 bins.
In our test procedure, we used two optimization techniques: Particle Swarm Optimization (PSO) [30] and Nelder-Mead Simplex Method. e reason for applying two different methods was to check the insensitivity of the ranking of metrics to the choice of optimization technique.
For each optimization step, we generated a histogram using the same rule as for the target histogram (i.e., 40000 results, 10 bins). e number of particles for PSO was set to 100 and the number of maximum iterations for both methods was set to 100.
Simulation for each target histogram and optimization method was performed 5 times and the resulting histograms were averaged. We wanted to improve the robustness of our results. Repeating the optimization procedures more times would yield even more stable results, but it would come at the cost of higher computation time.
e values of parameters of the Nelder-Mead method for consecutive simulation are presented in Table 4. We have picked 5 randomly generated starting simplexes.
Due to the stochastic nature of the model, the Nelder-Mead method is not deterministic anymore. Because of that, we have repeated the optimization procedure 10 times for 25 (5 sets and 5 starting simplexes) different configurations of parameters. In our ranking, we used the means of percentage errors (MAPE, equation (11)) of all histograms for the final scoring of each proposed histogram (the goal functions (18)- (22) for optimization methods were different, but the scoring was unified). e best results obtained by using the Nelder-Mead algorithm and various objective functions (functions d) are presented in Table 5, which contains percentage mean values per histogram, and in Table 6, which contains EMD values per histogram.
Due to not satisfactory results obtained by using the Nelder-Mead algorithm, we do not present WMAPE values for this algorithm, since it does not change the whole picture much. e PSO results obtained by using various functions d as a goal function are presented in Tables 7-9 in the function of the number of iterations. Table 7 contains MAPE values,  Table 8 contains WMAPE values, and Table 9 contains EMD values. All results are also presented in Figure 6, which contains a bar graph of values of MAPE for each considered case.
As expected, the more iterations of the PSO algorithm are performed, the better results are obtained. Computations costs of different metrics are negligible compared to the significant time-consuming part of a numerical model of dislocation density. From the technical point of view, we have decided to use only the PSO algorithm in the further analysis as it yielded better results for copper. It is worth mentioning that we have also conducted tests with 200 particles and 200 iterations, but it did not improve the results.
A selected example of comparison between target and computed histogram for temperature 575°C and strain rate 1 s −1 is presented in Figure 7. is histogram is qualitatively consistent with experimental observations for pure copper deformed at elevated temperatures. Recrystallization in copper is fast; therefore, some parts of the material are recrystallized during deformation and have lower dislocation density. ese parts are subjected to the second cycle of deformation while the remaining material is not recrystallized and has high dislocation density.
Mathematical Problems in Engineering 6.2. Dual-Phase Steel-Identification Problem. As has been mentioned in the Introduction, steels have a much wider perspective of the generation of multiphase structures with improved properties. erefore, similar calculations were performed in the present work for a dual-phase (DP) steel, which has much lower stacking fault energy than copper      and, in consequence, has a different tendency to dynamic recrystallization. e coefficients in the model for the DP steel are given in Table 10. ese coefficients were estimated to correspond to the average dislocation density for the experimental data described in [31] (DP steel S406 in that publication). e shear modulus of steel depends on the temperature and the following equation was obtained by approximation of published data; see review in [32]: where T is the temperature in°C. Most of the test configuration was the same as with copper-the only differences were the temperatures used for testing (900°C, 1000°C, and 1000°C), which were due to the physical properties of the material. e results of the PSO method obtained using described earlier goal functions (18)- (22) categorized by the number of iterations are presented in Table 11, which contains MAPE values per histogram, while Table 12 contains WMAPE  values per histogram and Table 13 contains EMD values per histogram. A selected example of comparison between target and computed histograms for the temperatures of 900°C and 1100°C and the strain rate 1 s −1 is presented in Figure 8.
is histogram is metallurgically justified and reflects differences between copper and steel. Large parts of the material are not recrystallized and have high dislocation density, while smaller parts are recrystallized and are subjected to the second cycle of deformation.
In all tests, the lowest values of errors were achieved using the Bhattacharyya and Matusita distances. We decided to use the Bhattacharyya function in further simulations as it seems to give slightly better convergence.

Problem of Reconstruction.
As shown on the right-hand side of Figure 5, the problem of the reconstruction comes from the optimization of the process parameters to obtain   the required final product (microstructure, properties, etc.). is problem can be referred to as an optimal design of the processing technology. us, the objective of this part of the work was to evaluate the capability of the model to design process parameters when the required properties of the product are given in the form of a histogram.
On the numerical side, nothing is changed except that the model coefficients are known and the process parameters are the state variables. e coefficients for DP steel are given in Table 10.
e objective is to find process parameters p, which gives the required histogram of the selected quantity. In the present work, it was the histogram of the dislocation density. e objective of the numerical tests was to evaluate the applicability of various metrics to solve the optimization task in the reconstruction problem.
In the conducted numerical tests, we considered a deformation process at the temperature of 900°C with the total strain equal to 1. In our simulation, we assumed that the process is divided into 3 intervals. e mentioned process parameters were strain rates (_ ε 1 , _ ε 2 , _ ε 3 ) at different time intervals as well as the lengths of those time intervals (t 1, t 2 , t 3 ). Due to the fact that the total time (t p ) of the process is known a priori, we could reduce the number of optimization 0.85046 × 10 −3 a 5 110515 a 6 1.67776 a 7 0.151117 a 8 4.5473 a 9 0.1687 a 10 -activation energy, J/molK 312000   variables from 6 (all times and strain rates) to 4 variables (t 1, t 2 , _ ε 1 , _ ε 2 ) with 2 constraints. e reduction is possible due to the following relations: e following target parameters were assumed: t 1 � 4 s, t 1 � 6 s, t 3 � 2 s, _ ε 1 � 0.1 s −1 , _ ε 2 � 0.05 s −1 , and _ ε 3 � 0.15 s −1 . On that basis, the target histogram was generated using 40 000 solutions and 10 bins. e test was conducted using the PSO method. ree sets of bounds for parameters were created. e lower bound for time interval and for strain rate was zero in all sets. e upper bound for the time interval was equal to the total time of the process t � 12 s. e upper bound for strain rate was 1 s −1 , 5 s −1, and 10 s −1 for intervals 1, 2, and 3, respectively. e swarm's particle starting positions were chosen at random from the provided sets of bounds. For the objective function, we used the Bhattacharyya distance (21) and the scoring metric was Mean Average Percentage Error defined by equation (11). We have repeated the optimization procedure 10 times for each set. e number of particles for PSO was set to 100 and the maximum iterations were initially set to 100; however, because of the low value of the cost function, the method stopped after 10 iterations. e results obtained using different sets were as follows: (i) Lowest obtained MAPE after 10 iterations: 1.59 (ii) Highest obtained MAPE after 10 iterations: 3.21 Considering the instability of the model (Table 3), the obtained results are justified. e parameters found by the optimization method were practically the same as the target parameters (the highest difference was 0.00032). An example of a comparison between target and computed histogram for the best solution is presented in Figure 9.

Conclusions
In the present paper, we extended the mean-field model M1 described by differential equation (1) to a stochastic model M2 defined by (7). Although the approach in (7) still can be classified as a mean-field model, it supplies additional information about the distribution of dislocation density, which cannot be obtained from classical mean-field models. e reliability of the inverse solution for this approach, using the objective function based on the histograms, was confirmed. All the tests of the model were performed for the experimental data substituted by the set of histograms generated by the model. e developed model can be used to design metal deformation processes that give a required distribution of the selected microstructural parameter. erefore with (7), we are able to reproduce results similar to (1) by using the mean of the process at time t, while we have a more detailed description of the material in the form of a histogram describing the distribution of the dislocation density.
One of the main aims of the paper was the performance of the model M2 in inverse analysis and identification of material parameters. e difficulty was a proper choice of the objective function in optimization. e following conclusions were drawn: (i) Among considered distance functions (18)-(21), the Bhattacharyya function (21) behaves the best. Its utility seems independent of the optimization method (we tested Particle Swarm Optimization (PSO) and Nelder-Mead Simplex Method); however as expected, the speed of convergence changes with the method (PSO performed better). (ii) As expected, the more iterations of the PSO algorithm were performed, the better results were obtained. erefore, computation costs of different metrics are negligible compared to the significant time-consuming part of the numerical model of dislocation density. (iii) Due to the stochastic nature of (7), the convergence of histograms (that is, the repeatability of distribution) depends on the number of simulations; however, it can be kept at a reasonably low level depending on the design of the experiment. In considered cases, we observed that 40000 simulations with 10 bins allow a decreasing difference between generated histograms at the level of 3% (see Table 3). (iv) With a badly chosen number of bins versus the number of simulations, the increase in the number of iterations of the optimization method does not result in an improvement in results. It means that the stochastic influence of errors cannot be neutralized that way. (v) In tests on the possible effectiveness of Inverse Analysis, error on target to computed histogram can be decreased to 6%, which is a reasonable score (as we said, comparison of two histograms at exactly the same parameters can result in 3% difference). (vi) It may happen that some materials (e.g., DP steel) are represented by histograms with highly concentrated bins (e.g., see Figure 8). For such histograms, the WMAPE function reflects better the difference between histograms than MAPE (Tables 11 and 12). In the case of more uniform distributions (e.g., copper), both measures MAPE and WMAPE provide a similar evaluation (see Tables 7  and 8).
Let us emphasize at this point that measurements of the distribution of microstructural parameters are difficult but possible. Good performance of the model (7) on tests motivates the identification of the stochastic model on the basis of measurements of histograms. Such identification, together with a more advanced procedure of design of the optimal processes, will be the subject of future works.

Data Availability
Data are available on request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.