Using genetic algorithms and setting initial conditions

4 次查看(过去 30 天)
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.

采纳的回答

Walter Roberson
Walter Roberson 2015-6-27
It would seem appropriate to use a LB (lower bound) condition.
  3 个评论
Souad AKKADER
Souad AKKADER 2022-1-24
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
Alan Weiss 2022-1-24
If you are trying to use gamultiobj, then you must do two things:
  1. 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.
  2. 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

请先登录,再进行评论。

更多回答(0 个)

类别

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