Materials Algorithms Project Program Library

Program MAP_STEEL_HOTROLLED_EL

1. Provenance of Source Code

Min Sung Joo
Pohang University of Science and Technology
Pohang, Kyoungbuk, Republic of Korea

athpimo@postech.ac.kr

Top | Next

2. Purpose of code

This program is an implementation of a genetic algorithm which can reach domains of inputs, such as chemical composition and processing variable, for a desired target value of the elongation to failure of hot-rolled steel. This can in theory be applied to any problem, where a database of inputs and outputs has trained a neural network.

Top | Next | Prev

3. Specification

 Language: C Product form: Source code and executable files for UNIX/Linux machines.

Complete program.

Top | Next | Prev

4. Description

The neural network is a non-linear regression method for modelling which can be used to establish physical link between the microstructure and complex mechanical properties depending on a large number of input parameters. Because of the large multidimensional space of solutions, if we are interested in finding the best sets or domains of input parameters for a target value, an efficient searching tool is needed. In this case, the genetic algorithm ,which is an optimization technique which simulates biological evolution, can be used.
The genetic algorithm is an optimization technique which simulates biological evolution. This is done by a random creation of a population of individuals, represented by chromosomes. These individuals are evaluated and undergo a process of evolution which start with a natural selection, inspired by Darwin's theory of evolution: the best individuals of a population are selected. Then a biological process occurs: some recombinations, as crossover and mutation, are made in order to create a new generation of individuals with the hope that this new one is better. The genetic algorithm is stopped when a target value is reached.
Thus, if the problem is that of looking for the input set(xi), which will give a desired output y:

y = f (x1, x2, ..., xn)

with the function f being non-linear which is made by neural network.
In order to adjust the genetic algorithm to this prolbem, the user need to set the desired target t and then the genetic algorithms randomly generates sets of inputs called 'chromosomes', which exist in populations:

Xi = [xi1, xi2, ..., xin]

These sets are used to calculate the output y for the function f of neural network model and then ranked according to a fitness factor, which describes how well they perform. The best chromosomes are selected and subjected to operations, as well in the biological system, as crossover or mutation. In this way, we obtain the input sets for the next calculation. This new sets of chromosomes are then still evaluated and undergo selection, crossover and mutation mechanisms. This kind of process takes place for many times until the fitness value is reached. It means that the output of function for the inserted input reachs close to the desired target.

MAP provides a set of data files, which can be used with the GA program for finding different sets of inputs. The single_EL.tar.gz file, which can be downloaded from here, contains the following files. A working version of a GA is also included to optimize the elongation to failure of the hot-rolled steels as a function of chemical composition and processing variables.

The following are concerned with the genetic algorithm files that work with the neural network:

genetic.c
A C program used to run the genetic algorithm.
A manual giving further details about running and using the GA program for altering different settings to optimize the process.
single_EL
An executable program of genetic.c.
generate44
It reads the normalized input data file, input/norm_test.in, and uses the weight files in subdicrectory input. The results are written to the temporary output file _ot, _out, _res and _sen.
score_output
A file that contains the scroes of each chromosome after the program has concluded.
unnormalise/treatout.c
A C program for un-normalising the output data files.
unnormalise/treatout
An executable program of unnormalise/treatout.c.
unnormalise/nn-output_b
A file which contains the normalized inputs and outputs of the GA after the program has concluded.
unnormalise/result
A file which contains the unnormalized values for inputs, outputs and error of each chromosome after unnormalising data in the normalized nn-output_b file.
input/labels.txt
A list of input variables.
input/nn-input
Normalised inputs file (target and accuracy values for the GA).
input/norm_test.in
A text file which contains the normalized input variables initialized by the GA to be fed into the neural network.

The following are concerned with the neural network files that work with the GA, but can be changed according to user requirements:

input/_w*f
The weights files for the different models.
input/*.lu
Files containing information for calculating the size of the error bars for the different models.
input/spec1.t1
An altered version of spec.t1 which is a dynamic file, created by neural network. It is read by the program generate44.
input/outran.x
A normalized output file that was created when developing the model. It is accessed by generate44 via input/spec1.t1.
input/MINMAX
Minimum and maximum values for the input variables used in the original database.

The file gareadme.txt contains a manual, which provides a detailed set of instructions for downloading and running the GA program. A summary of the information in this manual is given here.

Top | Next | Prev

5. References

Top | Next | Prev

6. Parameter descriptions

Input parameters

To specify the target value and accuracy desired, input/nn-input must be amended. The normalized target value relates to a real value, according to the input/MINMAX file used.
 Row1 Normalised target value Row2 Accuracy (in decimal e.g. 0.1 for 10%)

To specify the permitted range of the output, genetic.c must be changed.

 #define TARGET_UNNORMAL Unnormalised target value #define MAX_UNNORMAL Maximum of target value in intput/MINMAX #define MIN_UNNORMAL Minimum of target value in input/ MINMAX #define TARGET_PERCENT_PERMIT Permitted range for the target (in decimal e.g. 0.1 for 10%) #define UNCERTAINTY_PERCENT_PERMIT Permitted range for the uncertainty (in decimal e.g. 0.1 for 10%)

To initiate the GA search, the inputs are randomly generated and placed in input/norm_test.in. It should be noted that each chromosome generally relates to a different steel composition, but this could change over the course of optimization. For the current elongation model, the composition and processing variables, totally 17 data items, are specified:

 Gene Number Variable 1 Normalised C, wt% 2 Normalised Mn, wt% 3 Normalised Si, wt% 4 Normalised P, wt% 5 Normalised S, wt% 6 Normalised Cr, wt% 7 Normalised Ni, wt% 8 Normalised Mo, wt% 9 Normalised Ti, wt% 10 Normalised Nb, wt% 11 Normalised V, wt% 12 Normalised Al, wt% 13 Normalised N, ppm 14 Normalised B, ppm 15 Normalised Cu, wt% 16 Normalised Finishing rolling temperature, Centigrade 17 Normalised Coling temperature, Centigrade

Each input is normalized using the equation:
Normalized value = (value - min)/(max-min) - 0.5

Where the values for min and max are defined as follows:

 Gene Number Variable Minimum Maximum 1 C, wt% 0.0204 0.8684 2 Mn, wt% 0.1670 1.4100 3 Si, wt% 0 0.2170 4 P, wt% 0.0040 0.0220 5 S, wt% 0.0020 0.0150 6 Cr, wt% 0 0.1600 7 Ni, wt% 0 0.0600 8 Mo, wt% 0 0.0200 9 Ti, wt% 0 0.0040 10 Nb, wt% 0 0.0040 11 V, wt% 0 0.0030 12 Al, wt% 0 0.0640 13 N, ppm 0 87.00 14 B, ppm 0 2.00 15 Cu, wt% 0 0.0300 16 Finishing rolling temperature, Centigrade 808.00 925.00 17 Coling temperature, Centigrade 478.00 714.00

Output parameters

Two output files are produced by the GA program: unnormalise/nn-output_b and score-output.

score-output simply prints out the scores for each chromosome.
unnormalise/nn-output_b contains the inputs, prediction and (prediction + error).

This is done for the best chromosomes within all populations:

 Column 1-17 The normalized predicted inputs Column 18 The normalized predicted output Column 19 A value for the error, which includes the experimental noise of the database, an estimation of the uncertainty in the prediction and the test error. However, this is added to the prediction value so that the input/MINMAX file can easily handle the value.

The normalized values in all columns must be un-normalised using the equation:

actual value = (normalized value + 0.5) * (max-min) + min

The C program, unnormalise/treatout.c, is used to translate the output files to produce the actual values of inputs and outputs which are written to unnormalise/result.

Top | Next | Prev

7. Error Indicators

None.

Top | Next | Prev

8. Accuracy estimate

See:
Input parameters, output parameters.

Top | Next | Prev

See:

Top | Next | Prev

10. Example

1. Program text

Complete program.

2. Program data

The input file (input/nn-input) is:
0.083333
0.1

The input variables (genetic.c) are:
 #define TARGET_UNNORMAL 35 #define MAX_UNNORMAL 50 #define MIN_UNNORMAL 14 #define TARGET_PERCENT_PERMIT 0.1 #define UNCERTAINTY_PERCENT_PERMIT 0.15

3. Program results

```
After 1000 generations,

The output file unnormalise/nn-output_b, which contains the normalised values
for the elongation model including compositions and processing variables
(after eliminate the duplicates):

C         Mn        Si        P         S         Cr        Ni        Mo
-0.295874 -0.442038 -0.208722  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000  0.000000  0.000000 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000 -0.061242  0.004950 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000 -0.061242  0.004950 1.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 1.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000 -0.061242  0.000000 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000 -0.061242  0.004950 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000
-0.295874 -0.442038 -0.208722  0.000000  0.000000 -0.061242  0.004950 0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000 0.000000

Ti        Nb        V         Al        N         B         Cu        FRT       CT
0.590860 -0.397952  1.000000  0.000000  0.000000 -0.143450  0.269430  1.000000  0.000000
0.590860 -0.397952  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.000000  0.000000  1.000000  0.000000  0.000000  0.000000  0.000000  1.000000  0.000000
0.590860 -0.397952  1.000000  0.000000  0.000000 -0.143450  0.000000  0.000000  0.000000
0.590860 -0.397952  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.590860 -0.397952  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.000000  0.000000  1.000000  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.590860 -0.397952  1.000000  0.000000  0.000000 -0.143450  0.269430  1.000000  0.000000
0.000000  0.000000  1.000000  0.000000  0.000000  0.000000  0.000000  1.000000  0.000000
0.590860 -0.397952  0.000000  0.000000  0.000000  0.000000  1.000000  0.000000  0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  1.000000  1.000000  0.000000
0.590860  0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  1.000000  0.000000
0.000000  0.000000  0.000000  0.000000  0.000000  0.000000  1.000000  0.000000  0.000000

Elongation        Uncertainty for EL
0.085002          0.373183
0.077413          0.344923
0.085002          0.373183
0.114231          0.387601
0.059473          0.322303
0.077413          0.344923
0.123443          0.408855
0.114231          0.387601
0.123443          0.408855
0.070569          0.352171
0.070569          0.352171
0.118405          0.378351
0.059473          0.322303
0.066670          0.318427
0.118405          0.378351

These are then run with unnormalise/treatout.c, where the normalised values are converted
l values to unnormalise/result:

C        Mn       Si       P        S        Cr       Ni       Mo
0.193499 0.239047 0.063207 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.080000 0.030000 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.070201 0.030297 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.070201 0.030297 0.030000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.030000
0.193499 0.239047 0.063207 0.013000 0.008500 0.070201 0.030000 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.070201 0.030297 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000
0.193499 0.239047 0.063207 0.013000 0.008500 0.070201 0.030297 0.010000
0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000

Ti       Nb       V        Al       N         B        Cu       FRT        CT
0.004363 0.000408 0.004500 0.032000 43.500000 0.713100 0.023083 983.500000 596.000000
0.004363 0.000408 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.015000 983.500000 596.000000
0.004363 0.000408 0.004500 0.032000 43.500000 0.713100 0.015000 866.500000 596.000000
0.004363 0.000408 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.002000 0.002000 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.004363 0.000408 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.015000 866.500000 596.000000
0.002000 0.002000 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.004363 0.000408 0.004500 0.032000 43.500000 0.713100 0.023083 983.500000 596.000000
0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.015000 983.500000 596.000000
0.004363 0.000408 0.001500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000
0.002000 0.002000 0.001500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000
0.004363 0.002000 0.001500 0.032000 43.500000 1.000000 0.015000 983.500000 596.000000
0.002000 0.002000 0.001500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000

Elongation        Uncertainty for EL
35.060070         10.374518
34.786869         9.630359
35.060070         10.374518
36.112316         9.841319
34.141029         9.461879
34.786869         9.630359
36.443947         10.274833
36.112316         9.841319
36.443947         10.274833
34.540485         10.137671
34.540485         10.137671
36.262581         9.358055
34.141029         9.461879
34.400120         9.063252
36.262581         9.358055

```

Top | Next | Prev

11. Auxiliary subroutines required

None.

Top | Next | Prev

12. Keywords

hot rolled steel, genetic algorithm, elongation, neural network

Top | Next | Prev