GA doesn't proceed to the next generation
1 次查看(过去 30 天)
显示 更早的评论
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: https://studylib.net/doc/5631180/rate-equations-langmuir-hinshelwood---hougen-watson 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.
4 个评论
Star Strider
2022-7-13
My pleasure.
One option could be to calculate the result to be returned to ga in the objective function and output that. It would show whether the output is changing.
Another possibility I just thought of is to increase or decrease the number of individuals in the initial population to see if that helps. More individuals mean more possibly appropriate results, however it would require longer to calculate each generation. Fewer individuals would reduce the calculation time in each generation, however could make it more difficult to get a good set of parameters. I usually try both options if I have problems getting ga to converge. I usually begin with an initial population of 200, however I never tried to fit 20 parameters.
回答(1 个)
Alan Weiss
2022-7-14
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!