GA for single variable

2 次查看(过去 30 天)
Swapnil Kavitkar
Swapnil Kavitkar 2021-7-23
评论: Chunru 2021-7-23
Can I use genetic algorithm for single variable constrained optimization?
my function is f (x) = a/(x-log(x/t))
s.t. f(x) < 1
where a & t are constants

回答(1 个)

Chunru
Chunru 2021-7-23
编辑:Chunru 2021-7-23
Yes, you can. Howerver, no gurantee of the optimal solution (just like any other non-linear optimization approaches).
a = 1;
t = 1;
xopt = ga(@(x) min(a./(x-log(x/t)), 1), 1)
Optimization terminated: stall generations limit exceeded.
xopt = -555.4795
a./(xopt-log(xopt/t))
ans = -0.0018 + 0.0000i
  2 个评论
Swapnil Kavitkar
Swapnil Kavitkar 2021-7-23
what about population, mutation ,crossover?? GA options
Chunru
Chunru 2021-7-23
"doc ga" to find out all the options available.

请先登录,再进行评论。

类别

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