An Optimal Genetic Algorithm for Fatigue Life Control of Medium Carbon Steel in Laser Hardening Process

The proposed genetic algorithm-optimized empirical model allows us to speed up the characterization of the process. Abstract: This study proposes a genetic algorithm-optimized model for the control of the fatigue life of AISI 1040 steel components after a high-power diode laser hardening process. First, the e ﬀ ect of the process parameters, i.e., laser power and scan speed, on the fatigue life of the components after the laser treatment was evaluated by using a rotating bending machine. Then, in light of the experimental ﬁndings, the optimization model was developed and tested in order to ﬁnd the best regression model able to ﬁt the experimental data in terms of the number of cycles until failure. The laser treatment was found to signiﬁcantly increase the fatigue life of the irradiated samples, thus revealing its suitability for industrial applications. Finally, the application of the proposed genetic algorithm-based method led to the deﬁnition of an optimal regression model which was able to replicate the experimental trend very accurately, with a mean error of about 6%, which is comparable to the standard deviation associated with the process variability.


Introduction
The request for more precise processing operations for an improvement in the mechanical performances of structural components have made traditional manufacturing processes unsuitable for modern engineering. For this reason, innovative and advanced production processes have been introduced to address the needs of modern industry, especially when dealing with technological frontiers. In fact, one of the most important targets to achieve is the satisfaction of the stringent requirements of today's designers and producers in terms of the life of the parts [1,2]. In particular, many engineering components, such as bearings, shafts and gears, must resist the wearing phenomena with a hard surface and, at the same time, a tough inner core should guarantee the absorption of energy without fracture when subjected to high stress [3,4]. Such heterogeneous properties can be engineered by selectively hardening the surface using many different approaches, such as heat and mechanical treatments, alloying or coating the surface of the components, etc. However, these processes are often expensive and time consuming. Moreover, they usually do not allow for the selective treatment of small portions of the component. In light of this, lasers have appeared as an innovative and valuable solution for the thermal surface treatment of steel components thanks to their selectivity, ease of use and control,

Materials and Methods
The starting material is a commercial medium carbon steel (AISI 1040, [27]). The typical mechanical and thermal properties of the AISI 1040 steel are reported in Table 1, while the chemical composition is described in Table 2. Starting from 2 m bars, the geometry reported in Figure 1 was obtained by machining the samples using a milling machine with medium finishing inserts. The thermal treatments for surface hardening were performed using a 1.5 kW high-power diode laser (Rofin-Sinar model DL015, Plymouth, UK), with a wavelength of 940 nm and an elliptical spot of 0.6 and 1.9 mm along the minor and major axes, respectively. During the laser treatments, the samples were held and rotated on a CNC turning device (DENFORD, Brighouse, West Yorkshire, UK), as reported in Figure 2. For protection and insulation purposes, a constant inert gas flow of 2.5 L/h of Argon was directed to the surface of the sample.  were held and rotated on a CNC turning device (DENFORD, Brighouse, West Yorkshire, UK), as reported in Figure 2. For protection and insulation purposes, a constant inert gas flow of 2.5 L/h of Argon was directed to the surface of the sample.      were held and rotated on a CNC turning device (DENFORD, Brighouse, West Yorkshire, UK), as reported in Figure 2. For protection and insulation purposes, a constant inert gas flow of 2.5 L/h of Argon was directed to the surface of the sample.     The experimental factors investigated were laser power (P) and scan speed (Ss), as reported in Table 3. In particular, the scan speed (i.e., peripheral speed) is calculated as the product between the rotational speed and the radius of the samples middle section. The laser focus and the number of passes were fixed, respectively, at 0 and 1, because defocusing the laser beam and increasing the number of times that the laser passed on the treated area reduced the resulting hardness [19,28,29]. For each condition investigated, i.e., 5 terms of P × 5 terms of Ss, the rotational speed and the beam feed were properly chosen to ensure no overlap in the laser scans during the thermal treatment, and therefore only one pass [29]. All the tests were replicated three times, with a total of 75 experimental tests. After that, a four-point rotating bending machine was used to carry out the fatigue tests (see Figure 3), in order to evaluate the number of cycles until failure (N). The samples were loaded with alternate cycles of tensile and compressive stresses as they were simultaneously bent and rotated. To this end, the untreated samples were tested in order to identify the value of the alternating stress to be adopted during the fatigue tests of the heat-treated samples so that a low-cycle fatigue behaviour was assured, i.e., within the range 10 4 -10 5 cycles for steel materials [30,31]. Therefore, from the resulting Wöhler curve (see Figure 4), the alternating stress was set at a value of approximately 425 MPa, i.e., corresponding to a constant load F of about 120 N.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 4 of 14 The experimental factors investigated were laser power ( ) and scan speed ( ), as reported in Table 3. In particular, the scan speed (i.e., peripheral speed) is calculated as the product between the rotational speed and the radius of the samples middle section.

Factor
Values Unit Laser power (P) 100 150 200 250 300 W Scan speed (Ss) 12 14 16 18 20 mm/s The laser focus and the number of passes were fixed, respectively, at 0 and 1, because defocusing the laser beam and increasing the number of times that the laser passed on the treated area reduced the resulting hardness [19,28,29]. For each condition investigated, i.e., 5 terms of × 5 terms of , the rotational speed and the beam feed were properly chosen to ensure no overlap in the laser scans during the thermal treatment, and therefore only one pass [29]. All the tests were replicated three times, with a total of 75 experimental tests. After that, a four-point rotating bending machine was used to carry out the fatigue tests (see Figure 3), in order to evaluate the number of cycles until failure ( ). The samples were loaded with alternate cycles of tensile and compressive stresses as they were simultaneously bent and rotated. To this end, the untreated samples were tested in order to identify the value of the alternating stress to be adopted during the fatigue tests of the heat-treated samples so that a low-cycle fatigue behaviour was assured, i.e., within the range 10 4 -10 5 cycles for steel materials [30,31]. Therefore, from the resulting Wöhler curve (see Figure 4), the alternating stress was set at a value of approximately 425 MPa, i.e., corresponding to a constant load of about 120 N.

Computational Procedure
Manufacturers and researchers are interested in finding the best relationship between input(s) and output(s) with the aim of predicting and controlling the final quality of a process saving time and costs. This is usually accomplished by using empirical models. However, the choice of the best one is a challenging task that is not straightforward because of the very high number of possibilities, especially when dealing with data affected by dispersion due to both process and measurement variability. For this reason, in this work, a genetic algorithm (GA) is proposed and implemented in order to find the best empirical model (see Equation (1)) and, therefore, for the global optimization of the laser hardening process presented in this work in terms of the number of cycles until failure ( ). The choice of this evolutionary-based method is due to the ability to handle the optimization of many variables in a robust and efficient way [32][33][34][35]. , Given a defined number of terms , Equation (2) represents a generic regression model in which and are optimized using the proposed GA, while the empirical coefficients and the constant term are obtained with standard linear regression. Figure 5 reports the procedure of the proposed algorithm as it is typically implemented: it consists of four steps, i.e., initialization, selection, crossover and mutation [36]. In this case, the crossover and mutation operators are used in parallel, in order to emphasize the gains in performance that can be achieved from the concurrent application of operators with different and complementary roles [37]. Furthermore, two other important concepts are the genetic encoding of the parameters and the formulation of the fitness function, which are explained in the following Figure

Computational Procedure
Manufacturers and researchers are interested in finding the best relationship between input(s) and output(s) with the aim of predicting and controlling the final quality of a process saving time and costs. This is usually accomplished by using empirical models. However, the choice of the best one is a challenging task that is not straightforward because of the very high number of possibilities, especially when dealing with data affected by dispersion due to both process and measurement variability. For this reason, in this work, a genetic algorithm (GA) is proposed and implemented in order to find the best empirical model (see Equation (1)) and, therefore, for the global optimization of the laser hardening process presented in this work in terms of the number of cycles until failure (N GA ). The choice of this evolutionary-based method is due to the ability to handle the optimization of many variables in a robust and efficient way [32][33][34][35].
Given a defined number of terms N T , Equation (2) represents a generic regression model in which α i and β i are optimized using the proposed GA, while the empirical coefficients k i and the constant term k 0 are obtained with standard linear regression. Figure 5 reports the procedure of the proposed algorithm as it is typically implemented: it consists of four steps, i.e., initialization, selection, crossover and mutation [36]. In this case, the crossover and mutation operators are used in parallel, in order to emphasize the gains in performance that can be achieved from the concurrent application of operators with different and complementary roles [37]. Furthermore, two other important concepts are the genetic encoding of the parameters and the formulation of the fitness function, which are explained in the following Figure  The implementation of the genetic algorithm starts with the definition of a fixed number of chromosomes, which represent, in this case, one of the possible regression models. At the beginning, chromosomes are encoded and therefore represented in terms of a string of bits, octal numbers, hexadecimal numbers, values, etc. [38]. In this study, real value encoding is adopted, in which every chromosome is represented in terms of a set of real values. The main advantage of this scheme is given by the direct representation of the parameters and by the fact that it avoids any intermediate encoding and decoding steps [32].
In particular, each term of the model: is encoded using two independent genes, i.e., the powers of the variables that constitute each term and , 1, … , , with , ∈ , where is a discrete set of real values representing all the possible considered exponents for the model. Finally, the coefficients of the regression model ( , 0, … , ) are evaluated using a standard linear regression.
The initial population of models is generated by assigning to each gene a random value within the chosen range. The fitness of this population is evaluated by the fitness function, which is built according to the target of the study, thus returning a specific value for the variable of interest: where rms represents the root mean square operation, , is the result obtained by applying the models of the initial population for the specific combination of parameters , , is the corresponding experimental measure and is the number of combinations. The aim of the genetic algorithm is to find the best regression model which minimizes the fit value . Then, if the stop condition is not met, the initial population evolves into the next generation through the genetic operators, i.e., selection (i), crossover (ii) and mutation (iii): i.
during new generation, the selection operator decides which chromosomes in the population are transferred to the next one, while eliminating some of them. In this case, the decision is made using the ranking method. In particular, it implies the selection of the individuals by sorting them accordingly to their fitness values (see Equation (3)). Then, the best 50% individuals are chosen to mate, while the remaining 50% are eliminated. In order to maintain a constant number of individuals in the population, 50% new individuals are generated by applying either crossover or mutation operators to the best ones; ii.
the crossover operator increases the variability of the population by letting two random chromosomes, i.e., parents, to exchange genes between themselves, therefore producing a more powerful individual. Here, the random single-point crossover is considered and applied to every chromosome, as shown in Figure 6; The implementation of the genetic algorithm starts with the definition of a fixed number of chromosomes, which represent, in this case, one of the possible regression models. At the beginning, chromosomes are encoded and therefore represented in terms of a string of bits, octal numbers, hexadecimal numbers, values, etc. [38]. In this study, real value encoding is adopted, in which every chromosome is represented in terms of a set of real values. The main advantage of this scheme is given by the direct representation of the parameters and by the fact that it avoids any intermediate encoding and decoding steps [32].
In particular, each term of the model: is encoded using two independent genes, i.e., the powers of the variables that constitute each term α i and where Q is a discrete set of real values representing all the possible considered exponents for the model. Finally, the coefficients of the regression model (k i , i = 0, . . . , N T ) are evaluated using a standard linear regression. The initial population of models is generated by assigning to each gene a random value within the chosen range. The fitness of this population is evaluated by the fitness function, which is built according to the target of the study, thus returning a specific value for the variable of interest: where rms represents the root mean square operation, N GA (P i , Ss i ) is the result obtained by applying the models of the initial population for the specific combination of parameters i, N E (P i , Ss i ) is the corresponding experimental measure and c is the number of combinations. The aim of the genetic algorithm is to find the best regression model which minimizes the fit value f . Then, if the stop condition is not met, the initial population evolves into the next generation through the genetic operators, i.e., selection (i), crossover (ii) and mutation (iii): i.
during new generation, the selection operator decides which chromosomes in the population are transferred to the next one, while eliminating some of them. In this case, the decision is made using the ranking method. In particular, it implies the selection of the individuals by sorting them accordingly to their fitness values (see Equation (3)). Then, the best 50% individuals are chosen to mate, while the remaining 50% are eliminated. In order to maintain a constant number of individuals in the population, 50% new individuals are generated by applying either crossover or mutation operators to the best ones; ii.
the crossover operator increases the variability of the population by letting two random chromosomes, i.e., parents, to exchange genes between themselves, therefore producing a more powerful individual. Here, the random single-point crossover is considered and applied to every chromosome, as shown in Figure 6; iii.
the mutation operator is used to avoid local convergence of the genetic algorithm by introducing random variation in the genome of some individuals [32,39]. In fact, while increasing the number of generations, even if the crossover rate is high, chromosomes become more and more similar to each other, therefore blocking diversity and preventing the occurrence of more powerful generations [36]. In particular, the mutation operator only starts after some new generations with a fixed probability of occurrence. As in the case of the crossover, a random single-point mutation is considered (see Figure 7). iii. the mutation operator is used to avoid local convergence of the genetic algorithm by introducing random variation in the genome of some individuals [32,39]. In fact, while increasing the number of generations, even if the crossover rate is high, chromosomes become more and more similar to each other, therefore blocking diversity and preventing the occurrence of more powerful generations [36]. In particular, the mutation operator only starts after some new generations with a fixed probability of occurrence. As in the case of the crossover, a random single-point mutation is considered (see Figure 7). Finally, in order to ensure the global convergence of the algorithm, it is iterated until a defined number of generations in which a stationary fitness value is reached.

Results and Discussion
Among the experimental combinations investigated in this research work (see Table 3), it is possible to highlight three main scenarios: i. laser treatments carried out at laser power lower than 150 W did not lead to significant changes in the substrates' morphology and any grain structure modification was observed; ii.
the treatments at 150 and 200 W ensured the best performances. In fact, these process conditions led to a change in substrate properties without melting phenomena, especially with scan speed in the range 16 to 20 mm/s; iii.
when increasing the laser power to 250 or 300 W, surface melting was observed regardless of the scanning speed.
These results are in good agreement with the pertinent literature [40] and are supported by Figure 8, in which it can be observed that increasing the scan speed by values greater than 14 mm/s, increases the number of cycles until failure, which is almost double the number of cycles obtained with the untreated samples (U label). The improvement in the fatigue life can be attributed to the formation of a superficial annealed martensitic structure due to thermal phenomena induced by the iii. the mutation operator is used to avoid local convergence of the genetic algorithm by introducing random variation in the genome of some individuals [32,39]. In fact, while increasing the number of generations, even if the crossover rate is high, chromosomes become more and more similar to each other, therefore blocking diversity and preventing the occurrence of more powerful generations [36]. In particular, the mutation operator only starts after some new generations with a fixed probability of occurrence. As in the case of the crossover, a random single-point mutation is considered (see Figure 7). Finally, in order to ensure the global convergence of the algorithm, it is iterated until a defined number of generations in which a stationary fitness value is reached.

Results and Discussion
Among the experimental combinations investigated in this research work (see Table 3), it is possible to highlight three main scenarios: i. laser treatments carried out at laser power lower than 150 W did not lead to significant changes in the substrates' morphology and any grain structure modification was observed; ii.
the treatments at 150 and 200 W ensured the best performances. In fact, these process conditions led to a change in substrate properties without melting phenomena, especially with scan speed in the range 16 to 20 mm/s; iii.
when increasing the laser power to 250 or 300 W, surface melting was observed regardless of the scanning speed.
These results are in good agreement with the pertinent literature [40] and are supported by Figure 8, in which it can be observed that increasing the scan speed by values greater than 14 mm/s, increases the number of cycles until failure, which is almost double the number of cycles obtained with the untreated samples (U label). The improvement in the fatigue life can be attributed to the formation of a superficial annealed martensitic structure due to thermal phenomena induced by the laser treatment [15,25]. In particular, the amount of thermal energy the steel can absorb during the laser treatment decreases, and the process reaches the condition in which it is possible to have the martensitic transition. The subsequent laser scan causes a further heat treatment which leads to a slight annealing of the steel, i.e., back tempering phenomenon [41,42]. Finally, in order to ensure the global convergence of the algorithm, it is iterated until a defined number of generations in which a stationary fitness value is reached.

Results and Discussion
Among the experimental combinations investigated in this research work (see Table 3), it is possible to highlight three main scenarios: i. laser treatments carried out at laser power lower than 150 W did not lead to significant changes in the substrates' morphology and any grain structure modification was observed; ii.
the treatments at 150 and 200 W ensured the best performances. In fact, these process conditions led to a change in substrate properties without melting phenomena, especially with scan speed in the range 16 to 20 mm/s; iii.
when increasing the laser power to 250 or 300 W, surface melting was observed regardless of the scanning speed.
These results are in good agreement with the pertinent literature [40] and are supported by Figure 8, in which it can be observed that increasing the scan speed by values greater than 14 mm/s, increases the number of cycles until failure, which is almost double the number of cycles obtained with the untreated samples (U label). The improvement in the fatigue life can be attributed to the formation of a superficial annealed martensitic structure due to thermal phenomena induced by the laser treatment [15,25]. In particular, the amount of thermal energy the steel can absorb during the laser treatment decreases, and the process reaches the condition in which it is possible to have the martensitic transition. The subsequent laser scan causes a further heat treatment which leads to a slight annealing of the steel, i.e., back tempering phenomenon [41,42]. It is worth noting that, during the tests, the coordinate-measuring machine showed no appreciable deformations. In fact, the axial symmetry of the laser treatment helped to compensate for possible distortions.
For sake of clarity, Figure 9 shows a cross section of the steel specimen treated at P = 200 W and Ss = 20 mm/s. In particular, it can be seen that the martensitic structure, i.e., the light grey area, reaches a thickness of about 182 µm. On the other hand, Table 4 reports the thickness of the martensitic structure, i.e., heat affected zone (HAZ), obtained for some of the investigated values of the scan speed. In particular, when increasing the scan speed the thickness of the martensitic structure increases, according to the fact that, for lower values of the scan speed, the interaction time is greater and the aforementioned back tempering phenomenon takes place.  From this experimental campaign it is evident that, among the studied process parameter values, only some combinations allow the effective obtainment of the hardening of the samples (see Table 5). Therefore, only these values are used in the optimization process by means of genetic algorithm, as described in Section 2.1. It is worth noting that, during the tests, the coordinate-measuring machine showed no appreciable deformations. In fact, the axial symmetry of the laser treatment helped to compensate for possible distortions.
For sake of clarity, Figure 9 shows a cross section of the steel specimen treated at P = 200 W and Ss = 20 mm/s. In particular, it can be seen that the martensitic structure, i.e., the light grey area, reaches a thickness of about 182 µm. On the other hand, Table 4 reports the thickness of the martensitic structure, i.e., heat affected zone (HAZ), obtained for some of the investigated values of the scan speed. In particular, when increasing the scan speed the thickness of the martensitic structure increases, according to the fact that, for lower values of the scan speed, the interaction time is greater and the aforementioned back tempering phenomenon takes place. It is worth noting that, during the tests, the coordinate-measuring machine showed no appreciable deformations. In fact, the axial symmetry of the laser treatment helped to compensate for possible distortions.
For sake of clarity, Figure 9 shows a cross section of the steel specimen treated at P = 200 W and Ss = 20 mm/s. In particular, it can be seen that the martensitic structure, i.e., the light grey area, reaches a thickness of about 182 µm. On the other hand, Table 4 reports the thickness of the martensitic structure, i.e., heat affected zone (HAZ), obtained for some of the investigated values of the scan speed. In particular, when increasing the scan speed the thickness of the martensitic structure increases, according to the fact that, for lower values of the scan speed, the interaction time is greater and the aforementioned back tempering phenomenon takes place.  From this experimental campaign it is evident that, among the studied process parameter values, only some combinations allow the effective obtainment of the hardening of the samples (see Table 5). Therefore, only these values are used in the optimization process by means of genetic algorithm, as described in Section 2.1.  From this experimental campaign it is evident that, among the studied process parameter values, only some combinations allow the effective obtainment of the hardening of the samples (see Table 5). Therefore, only these values are used in the optimization process by means of genetic algorithm, as described in Section 2.1. Among these optimal combinations, the best one is given by P = 150 W and Ss = 20 mm/s leading to an improvement in the fatigue life more than 4 times that of the untreated samples, i.e., 421,982 against 92,608 cycles until failure, as reported in Table 5.
It is important to highlight here that the laser treatments were carried out in order to maintain a constant scan speed. To this end, the rotating speed of the sample was changed according to the varying section when moving from the largest section zone to the smallest one. Moreover, all the parameters were chosen to avoid, or at least limit, the overlapping phenomenon. This means that the interaction time between the laser beam and the specimen is different at the various scan speeds investigated. In particular, the lower the scan speed, the higher the interaction time. It is worth mentioning that, as reported in the literature [42,43], the interaction time is suggested to be proportional to the laser power. Therefore, increasing the laser power over 250 W, the heat transferred to the sample is greater and the melting phenomena occurs. On the other hand, a laser power that is too low, i.e., 100 W, in combination with the investigated scan speed values, does not promote the martensitic transition, as it happens for too high and too short a treatment time, respectively.

Genetic Algorithm-Based Optimization
The aim of this step is to find the best regression model able to fit the experimental data among the infinite possible combinations of input parameters and their powers in terms of the number of cycles until failure (N GA ), as reported in Equation (1).
A preliminary investigation aimed at identifying the best number of terms for the optimized regression model. To this end, the number of terms was increased starting from two, i.e., one term plus the constant one, to the number of terms after which any more decrease in the fitness value is obtained. Additionally, three different discrete sets of real values representing all the possible exponents were investigated (see Table 6). In this way, the explored space is discrete and contains the number of exponents to the power of N T ·N V possible models, where N V is the number of variables constituting each term (2 in this case). Table 6. Discrete set of real values representing the possible exponents.

Set Exponents
Moreover, in order to evaluate the capability of the optimized models in representing the experimental findings, they were compared with the regression model typically used for statistical investigations, as in the case of two-way ANOVA test, i.e., considering the effect of each single parameter and their combinations [44]. In this case, the set of possible exponents Q R can be defined as {0, 1}, while the statistical regression model is described by the following equation: (4) Figure 10 shows the results obtained during the preliminary investigation. In particular, among the different combinations of numbers of terms and sets of exponents, the worst one, i.e., the one with the highest fitness value, is the model with only two terms, as expected. While the best models were obtained with four terms, adding more terms did not lead to a decrease in the fitness value. It is important to note that, for the regression model, the number of terms is set at four, which is the number of possible combinations. The resulting optimized models are described by Equations (5)-(7), while Table 7 reports the relative empirical coefficients, evaluated by means of standard linear regression.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 10 of 14 Figure 10 shows the results obtained during the preliminary investigation. In particular, among the different combinations of numbers of terms and sets of exponents, the worst one, i.e., the one with the highest fitness value, is the model with only two terms, as expected. While the best models were obtained with four terms, adding more terms did not lead to a decrease in the fitness value. It is important to note that, for the regression model, the number of terms is set at four, which is the number of possible combinations. The resulting optimized models are described by Equations (5)-(7), while Table 7 reports the relative empirical coefficients, evaluated by means of standard linear regression.  As shown in Figure 10, the statistical model is characterized by a fitness value greater, yet more negative, than the optimal value obtained with the genetic algorithm, i.e., −0.1052 against -0.0622. In  As shown in Figure 10, the statistical model is characterized by a fitness value greater, yet more negative, than the optimal value obtained with the genetic algorithm, i.e., −0.1052 against −0.0622. In order to better clarify this result, Figure 11 shows the root mean square error and the standard deviation of the regression models compared with the experimental findings for each combination of parameters (see Table 5). As shown in Figure 11, the genetic algorithm-optimized models are able to accurately replicate the experimental results with an error almost half that of the mean error obtained with the statistical model, i.e., 0.0603 against 0.0998. Moreover, these models are characterized by a mean error comparable to and even lower than the standard deviation of the experimental data, i.e., 0.0603 against 0.0723, which is associated with the variability of the process, highlighting the good capability of the model to replicate the experimental trend. It is worth noting that the best optimized model is given by using the set of exponents (see Table 6), for which the mean error is about 0.0591. For completeness, Figure 12 shows the optimal model results. In general, convergence was reached in less than 15 generations, as shown in Figure 13. In each generation, 1000 individuals (i.e., models) were evaluated. In practice, the GA explores a space of cardinality ≅ 5.7 • 10 solving only 1.5 • 10 models. A further 50 generations were computed to verify if mutation can move the optimum from a local minimum toward a better solution. The optimization algorithm was run several times, always obtaining the same result, ensuring in this way that the GA reached a global minimum. Figure 11. Comparison of the root mean square error for each combination of parameters between the optimized models, the statistical model and the standard deviation of the experimental data.
As shown in Figure 11, the genetic algorithm-optimized models are able to accurately replicate the experimental results with an error almost half that of the mean error obtained with the statistical model, i.e., 0.0603 against 0.0998. Moreover, these models are characterized by a mean error comparable to and even lower than the standard deviation of the experimental data, i.e., 0.0603 against 0.0723, which is associated with the variability of the process, highlighting the good capability of the model to replicate the experimental trend. It is worth noting that the best optimized model is given by using the set of exponents Q 3 (see Table 6), for which the mean error is about 0.0591. For completeness, Figure 12 shows the optimal model results.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 11 of 14 Figure 11. Comparison of the root mean square error for each combination of parameters between the optimized models, the statistical model and the standard deviation of the experimental data.
As shown in Figure 11, the genetic algorithm-optimized models are able to accurately replicate the experimental results with an error almost half that of the mean error obtained with the statistical model, i.e., 0.0603 against 0.0998. Moreover, these models are characterized by a mean error comparable to and even lower than the standard deviation of the experimental data, i.e., 0.0603 against 0.0723, which is associated with the variability of the process, highlighting the good capability of the model to replicate the experimental trend. It is worth noting that the best optimized model is given by using the set of exponents (see Table 6), for which the mean error is about 0.0591. For completeness, Figure 12 shows the optimal model results. In general, convergence was reached in less than 15 generations, as shown in Figure 13. In each generation, 1000 individuals (i.e., models) were evaluated. In practice, the GA explores a space of cardinality ≅ 5.7 • 10 solving only 1.5 • 10 models. A further 50 generations were computed to verify if mutation can move the optimum from a local minimum toward a better solution. The optimization algorithm was run several times, always obtaining the same result, ensuring in this way that the GA reached a global minimum. In general, convergence was reached in less than 15 generations, as shown in Figure 13. In each generation, 1000 individuals (i.e., models) were evaluated. In practice, the GA explores a space of cardinality C 5.7·10 6 solving only 1.5·10 4 models. A further 50 generations were computed to verify if mutation can move the optimum from a local minimum toward a better solution. The optimization algorithm was run several times, always obtaining the same result, ensuring in this way that the GA reached a global minimum.

Conclusions
The 1.5 kW continuous wave high-power diode laser used in this study demonstrated a high suitability for the surface hardening of AISI 1040 medium carbon steel substrates.
The inspection of the cross-sections of the specimens by means of optical microscopy revealed two different main areas: (i) an outer area characterized by a homogenous distribution of the annealed martensite and (ii) an unaltered underling area made of a ferrite and perlite structure.
The laser thermal surface treatment increases the fatigue life of the treated material with respect to the untreated one. In particular, within the tested range of the parameters, the most suitable thermal conditions are obtained using a laser power of 150 W and a scan speed of 20 mm/s, reaching a fatigue life up to four times longer.
The proposed genetic algorithm-based method appeared to be a fast and effective solution for finding the optimal regression model able to replicate the experimental trend. In particular, the mean error achieved is about 5.9%, the same as the standard deviation of the experimental results. Therefore, the simulation reveals a good capability for the proposed solutions to be very helpful in predicting, controlling and managing the laser surface hardening process.

Conclusions
The 1.5 kW continuous wave high-power diode laser used in this study demonstrated a high suitability for the surface hardening of AISI 1040 medium carbon steel substrates.
The inspection of the cross-sections of the specimens by means of optical microscopy revealed two different main areas: (i) an outer area characterized by a homogenous distribution of the annealed martensite and (ii) an unaltered underling area made of a ferrite and perlite structure.
The laser thermal surface treatment increases the fatigue life of the treated material with respect to the untreated one. In particular, within the tested range of the parameters, the most suitable thermal conditions are obtained using a laser power of 150 W and a scan speed of 20 mm/s, reaching a fatigue life up to four times longer.
The proposed genetic algorithm-based method appeared to be a fast and effective solution for finding the optimal regression model able to replicate the experimental trend. In particular, the mean error achieved is about 5.9%, the same as the standard deviation of the experimental results. Therefore, the simulation reveals a good capability for the proposed solutions to be very helpful in predicting, controlling and managing the laser surface hardening process.