Genetic algorithm with non linear constraints

조회 수: 3 (최근 30일)
Devraj Dutt
Devraj Dutt 2016년 2월 3일
답변: Devraj Dutt 2016년 2월 8일
Does the genetic algorithm ensure that all non linear constraints are satisfied before passing variables to the fitness function?
Background: I drive a simulation software using genetic algorithm to optimize parametrized electric machine designs. The software will give an error and exit unless the constraints in nonlcon are satisfied. The constraints I create in nonlcon are to avoid geometrical infeasibility of the model and the software would exit with error if such parameters were passed to it. Since global optimization simulations take weeks, it is very costly (in terms of time) to deal with such an error somewhere in the middle. Currently, I take care of not passing anything infeasible to the program within the fitness function (before calling the program using VB scripts). What I do is set a very high cost for infeasible instances and skip running the electromagnetic simulation altogether, but I am considering letting GA handle the non linear constraints.

채택된 답변

Alan Weiss
Alan Weiss 2016년 2월 8일
Sorry, as documented, no nonlinear solver ensures that it passes only feasible points with respect to nonlinear constraints. ga passes points that are feasible with respect to bounds and linear constraints, but not nonlinear constraints.
Your solution sounds reasonable.
However, I would suggest that you will likely be happier using patternsearch instead of ga as a solver. patternsearch is usually faster, more robust, and easier to tune. You can search for a global optimum with patternsearch using a variety of techniques.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (1개)

Devraj Dutt
Devraj Dutt 2016년 2월 8일
Hi Alan,
I will experiment with the options in pattern search. I was under the impression that that one's only good for local minima. But am going to check it out. The thing about nonlcon, I kind of found out by designing a dummy function and reading the values genetic algorithm creates. That was a bummer. O.o
Thanks Alan, much appreciated :)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by