GA doesn't proceed to the next generation

1 view (last 30 days)
MADAN BEHERA on 13 Jul 2022
Answered: Alan Weiss on 14 Jul 2022
Problem Background: I am working on kinetic model for the conversion of CO to CO2 at different temperatures and other different operational and reaction consitions. I have derived a reaction rate equation on the basis of a kinetic model method known as Langmuir Hinshelwood Hougen Watson (The theory behind the model can be found here: but I don't think it is useful in solving my problem). I have a reaction rate equation of the form Numerator/(Denominator)^2. The task is to regress the parameters of this equation (=20 in total) on the basis of 44 experimental data. The regression routine used for this problem is genertic algorithim 'ga' with lower and upper bounds for the parameters and nonlinear constraints.
Problem Description: When I run my genetic algorithim (ga) function, I visualise the plot showing the mean and best fitness values. However, the optimisation routine terminates at generation number 1 and doesn't proceed further to the next generation (see the picture of the plot in the attachment under the name 'gaplot.png'). I am unable to understand why it is happening. I tried to search for some solutions and I applied some solutions as follows (obviously without any success):
1- Changing the crossover fraction: varied between 0.5 to 1 but the optimisation routine didnot proceed to the next generation. Not much change in the firness value as well.
2- Providing an initial population range: I provided an initial population range using randi function and generating a matrix of random values between the range of [-1e15, 1e15] because any values beyond this range is not accepted by the 'randi' function. Inclusion of this random initial population initially provided a really high fitness value but after very soon get stuck to the fitness values as seen in the case of variation of crossover fraction variation (see point 1-).
3- Increasing the function tolerance: increased the function tolerance from the default value of 1e-6 to 1e-10 . Upon changing this the fitness value improved but the problem of single generation still persisted.
4- Changing the mutation function to mutationadaptfeasible : No improvement in the optimisation was observed
Files attached:
For you to follow my problem, I am attaching the files of my simulation attached to this question.
A little description of the files:
1- Expt_data_CO_conv.xlsx : It is the excel file containing the experimental data with the partial pressures of each of the components, molar conversion of CO, NO2 and N2 and so on. The excel file consists of three sheets. The first sheet is the total experimental data I have. Sheet 2 and Sheet 3 are subsets of sheet 1. I tried to choose some data I think can be good for regression as in the global experimental dataset ( i.e., sheet 1), there are certain rows of data that have a lot of zeros which can make the regression problematic.
2- nonlcon_form10_CO_conv.m : It is the file containing the non-linear constraint function. Since, the objective function is to minimise the difference between the experimental and calculated values of the molar conversion of CO2, the calculate values need to lie between 0 and 1. This is what the nonlinear constraint function defines.
3- objfun_form10_CO_conv.m : It is the file containing the objective function. As mentioned earlier, the objective function is the minimise the sum of the squares of the difference between the calculated and experimental values of molar conversion of CO2.
4- rate_CO2_form10_CO_conv.m : it is the file containing the reaction rate equation (or simply the equation containing the parameter to be regressed). As mentioned earlier, the numùber of parameters to be regressed is 20.
5- optimise_form10_CO_conv.m : It is the script file which executes the 'ga'. It calls all other required functions.
6- lower_bound.xlsx and upper_bound.xlsx : The files contain the lower and upper bounds of the parameters to be regressed.
MADAN BEHERA on 13 Jul 2022
@Star Strider Thank you for your prompt reply. I am already using a initial population size of 200 but I will try to decrease it and see. I will also apply the suggestion you made regarding the output.
One thing that I saw now is when I decrease the range of the values for the initial population ( I use randi function and I decrease the imax value). I see better fitness values but the number of generations is still 2. And as I increased the imax value 5 times, the fitness values detoriorated (obviously without any change in the numvber of generations). I am planning to now run a loop and see the change in the fitness values with the change in the imax values in the initial population matrix and draw some correlation from it. What do you think about this phenomenon ?

Sign in to comment.

Answers (1)

Alan Weiss
Alan Weiss on 14 Jul 2022
Thank you for providing a complete problem, including all supportng function files.
My main question is, why are you trying to solve this problem using ga? As far as I can tell, everything is smooth. If you are worried about getting stuck in local minima, then I suggest that you use MultiStart with fmincon as the local solver, and use the tightest bounds you can. In any case, try using fmincon instead of ga. It will doubtless reach a solution much, much faster than ga. Yes, you need to provide a start point, but feel free to use a collection of random start points.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!