Using genetic algorithms and setting initial conditions
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Racer Ducati
le 27 Juin 2015
Commenté : Alan Weiss
le 24 Jan 2022
Hi,
I am trying to use genetic algorithms to optimize a given problem. Howeever in the constraints file , one of the constraints has a term like y(1)*y(2)^0.5. The genetic algorithms is setting the initial values of y to a negative value and this is returning a complex value and the program is not running. How do I set the initial values of the y since there does not seem to be an option for doing this when I call the ga function. There is nvars , but no initial condition.
0 commentaires
Réponse acceptée
Walter Roberson
le 27 Juin 2015
It would seem appropriate to use a LB (lower bound) condition.
3 commentaires
Souad AKKADER
le 24 Jan 2022
Hi,
I wanna optimize 2 complex functions (that have an imaginary part and a real part) using multiobjective genetic algorithm (MOGA). However one of the constraints has a term like : (z+(x^2/3y))=5
How do I set the matrix Aeq knowing that there is only one equation?
NB: variables are all scalars
thanks in advance :)
Alan Weiss
le 24 Jan 2022
If you are trying to use gamultiobj, then you must do two things:
- Convert your multiple scalar variables into indices of a single variable, usually called x. For example, you might have x = x(1), y = x(2), z = x(3). Then it is clear how to write your scalar equation in the form Aeq*x = beq.
- Separate your complex variables into real and imaginary parts. This means you will have more variables, twice as many if all variables can be complex. For example, you might have x(1) = real(x), x(2) = im(x), x(3) = real(y), x(4) = im(y), x(5) = reall(z), x(6) = im(z).
Alan Weiss
MATLAB mathematical toolbox documentation
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!