How to avoid excessive fluctuations of two nearby variables (say by maximum +-20) in 1 generation during optimization with GA

I am using GA Optimization solver to maximize the objfcn. I have 72 input variables (a row vector having 72 entries) as input. 1st 36 entries for upper rule curve and last 36 for lower rule curve.How to avoied/control excessive fluctuation i.e., max difference between any two consecutive entries of vector x can be (say max +- 40) in one generation e.g. for i=1:71, x(1,i+1)-x(1,i+2)=+-40 and x(1,i+1)-x(1,i)=+-40., however in overall generations/progressively it can exceed the limit
Thanks and waiting for favorable response

 Accepted Answer

GA is a strictly feasible solver with respect to bounds and linear constraints. This means that, if you have set the linear constraint matrices properly, you should not see violations of the constraints.
Did you set linear constraint matrices representing this +-40 restriction? They would have the form
A = [-1 1 0 0 ... 0;
1 -1 0 0 ... 0;
0 -1 1 0 ... 0;
0 1 -1 0 ... 0;
...
0 0 0 0 ... -1];
b = 40*ones(N,1);
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

More Answers (0)

Community Treasure Hunt

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

Start Hunting!