Materials Algorithms Project
Program Library
Program STEEL_AUSTENITIC_GA_YS
- Provenance of code.
- Purpose of code.
- Specification.
- Description of program's operation.
- References.
- Parameter descriptions.
- Error indicators.
- Accuracy estimate.
- Any additional information.
- Example of code
- Auxiliary routines required.
- Keywords.
- Download source code.
- Links.
Anne Delorme
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge CB2 3QZ, U.K.
Added to MAP: June 2003.
Top |
Next
This program is an implementation of a genetic algorithm which can reach an optimum set of parameters for a target value of yield strength of austenitic stainless steel. This can in theory be applied to any problem, where a neural network exists.
Top |
Next |
Prev
Language: | C
|
Product form: | Source code
|
Complete program.
Top |
Next |
Prev
The neural network is a powerful method modelling which can
be used to establish physical link between the microstructure and complex
mechanical properties depending on a large number of
parameters. Because of the large multidimensional space of solutions,
if we are interested in finding the best set of parameters for a
target value, an efficient searching tool is needed. 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. This 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. We are looking for an input set (x1,x2,...,xj) which will give a desired output y. The genetic algorithms are based on biological
theory and so, we can assimilate this set as a chromosome. Each input
xi is the equivalent of a gene. In a first time, a population
is randomly generated. This population contains n chromosomes
(x1,x2,...,xj). These inputs are entered in a
model, created by a neural network, and we obtain the output y and
the associated error for each chromosome.
The chromosomes are then ranked according to their fitness. 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 second
generation. This new sets of chromosomes are then still evaluated and
undergo selection, crossover and mutation mechanisms, as
previously. We obtain our third generation and this process takes
place for many generations until the fitness value is reached.
MAP provides a set of data files which can be downloaded from here and explained below:
ga_code.c
A C program used ti run the genetic algorithm
generate44.exeThis is the executable file for the neural network program. It runs on Unix system, reading the normalised input data file norm_test.in and using the weight files. The results are written to the temporary output file _out.
labels.txtThis file contains the name of the inputs.
MINMAX This file contains the minimum and the maximum of the inputs and the yield strength coming from the database.
nn-inputWe write in this file the desired target and accuracy in normalise values.
norm_test.inThis file contains the normalised value of a chromosome initialised by the GA to be fed into the neural network.
outran.xA normalised output file that was created when developing the model. It is accessed by generate44 via spec1.t1.
score_outputA file containing the scores of each chromosome after the program has concluded
spec1.t1An altered version of spec.t1, which is a dynamic file, created by spec.ex/spec.exe, which contains information about the module and the number of data items being supplied. It is read by the program generate44
valuesThis file contains all the inputs for the GA. Each input can be fixed or allowed to vary. In the third column, put "0" and the value of your choice in the fourth column. If you wish to let vary the input between the low and the Hogh value, put "1" in the third column. The ratio is calculated as a function of chemical compositions, so you have to let "2" in this column.
_w*fThe weights files for the different models.
*.luFiles containing information for calculating the size of the error bars for the different models.
treatout.cA C program for un-normalising the output data files, but is kept within the /unnormalise subdirectory.
nn-output_bA file which contains the normalised inputs and outputs of the GA after the program has concluded, but is kept within the /unnormalise subdirectory.
resultA file which contains the unnormalised vales for inputs, outputs and error of each chromosome after unnormalissing data in the normalised nn-output_b file.
How to run the GA to find an optimum set of parameters for a desired yield strength of austenitic stainless steel:
First you have to define in the "values" file the inputs you wish to vary or those you wish to fix and the corresponding fixed value
Then, you must normalised the desired target value of yield strength and enter it in the "nn-input" file, as well as the wanted accuracy.
Finally, compile the C program "ga_code" and execute it.
How to adapt this GA to optimise other mechanical properties:
First, you have to put in the folder "gacode" all the files related to the neural network created for the mechanical properties you want optimise. This files are the following:
generate44.exe
norm_test.in
_w*f
*.lu
spec1.t1
outran.x
MINMAX
Then, write the labels of the inputs of the neural network in the "labels.tct" file
Change as well the file "values" to have the right corresponding parameters in the first column
Repeat the steps described in the previous paragraph
How to change GA parameters:
The efficiency of the GA depend on the values of parameters such as the number of population, the number of generations ... which are not defined for any problem but must be adapted for each GA.
The values are entered directly in the "ga_code.c" file so you have to edit it and change the desired values in the header of the file.
Top |
Next |
Prev
- D. E. Goldberg, 1989 Genetic Algorithms in Search, Optimization and Machine Learning, Addison-Wesley
- I. Shah, 2002, Tensile Properties of Austenitic Stainless Steel, I. Shah, M.Phil. Thesis, University of Cambridge
- Paper describing this GA: Genetic Algorithm for Optimization of Mechanical Properties, A. Delrome, 2003
Top |
Next |
Prev
Input parameters
The desired target and accuracy have to be normalised and entered in the "nn-input" file.
Moreover, the input parameters corresponding to the optimization of the yield strength for austenitic stainless steels are described below. If the GA is used to optimised another mechanical properties, using another neural network, these inputs have to be change, as described in the previous paragraph.
- Cr wt%
- Ni wt%
- Mo wt%
- Mn wt%
- Si wt%
- Nb wt%
- Ti wt%
- V wt%
- Cu wt%
- N wt%
- C wt%
- B wt%
- P wt%
- S wt%
- Co wt%
- Al wt%
- Ratio
- Heat treatment temperature (K)
- Test temperature (K)
The ratio is defined as the stoichiometric stabilisation ratio for titanium and niobium additions:
ratio = (CTi+CNb)/(CC+CN)
Each input is normalised using the equation:
normalised_value = (value - min)/(max - min) - 0.5
Output parameters
The file "nn-output" contains the optimised set of input parameters, the predicted yield strength and the (prediction + error)
To unnormalised the outputs of this file, you have to compile and execute the "treatout.c" program. The corresponding unnormalised values are printed in "result" file.
Top |
Next |
Prev
1. Program text
Complete program.
2. Program data
The target yield strength is 218 MPa, which correspond to a normalised value of 0.1. The wanted accuracy is 0.1. The "nn-input" file is as follows:
0.1
0.1
All the input parameters are allowed to vary.
3. Program results
In /unnormalise/result, we obtain the following outputs:
Cr wt% = 18.88
Ni wt% = 11.30
Mo wt% = 0.00
Mn wt% = 1.98
Si wt% = 1.24
Nb wt% = 0.72
Ti wt% = 0.03
V wt% = 0.01
Cu wt% = 0.13
N wt% = 0.03
C wt% = 0.12
B wt% = 0.002
P wt% = 0.02
S wt% = 0.04
Co wt% = 0.27
Al wt% = 0.06
ratio = 0.65
HTT = 1436 K
TT = 300 K
result yield strength = 219 MPa
error = 21 MPa
Top |
Next |
Prev
Genetic Algorithm, Neural Network, Yield Strength, Austenitic Stainless Steel
Top |
Next |
Prev
Download source code
Top |
Prev