[MAP Logo]

Materials Algorithms Project
Program Library


  1. Provenance of code.
  2. Purpose of code.
  3. Specification.
  4. Description of program's operation.
  5. References.
  6. Parameter descriptions.
  7. Error indicators.
  8. Accuracy estimate.
  9. Any additional information.
  10. Example of code
  11. Auxiliary routines required.
  12. Keywords.
  13. Download source code.
  14. Links.

Provenance of Source Code

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:


generate44.exe labels.txt MINMAX nn-input norm_test.in outran.x score_output spec1.t1 values _w*f *.lu treatout.c nn-output_b result

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:
  • 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


    1. D. E. Goldberg, 1989 Genetic Algorithms in Search, Optimization and Machine Learning, Addison-Wesley
    2. I. Shah, 2002, Tensile Properties of Austenitic Stainless Steel, I. Shah, M.Phil. Thesis, University of Cambridge
    3. 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%
    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:
    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

    MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.

    Top | Program Index | MAP Homepage Valid HTML 3.2!