Bird
Problem definition
Objective function
f = @(x) sin(x(:,1)).*exp(1-cos(x(:,2))).^2 + cos(x(:,2)).*exp(1-sin(x(:,1))).^2 + (x(:,1)-x(:,2)).^2
Optimization settings
o = struct% initializing struct
o.d = 2% dimension of decision variable
o.lb = -2*pi% lower bounds
o.ub = 2*pi% upper bounds
Graphic representation
[x,y] = meshgrid(o.lb:0.5:o.ub) surf(x,y,f([x(:),y(:)]))
Problem properties
convexity | smoothness | minimum |
0 | ∞ | f(4.70104,3.15294) = -106.764537 |
Optimization example with ga
Algorithm options
o.maxit = 21% number of iterations
Optimization
rng(0)% for tractability
[xmin,fmin,popPos,popCost] = ga(f,o)% running minimization
Animation
rng(0) [~,~,~,~,info] = ga(f,o) info.sol = [4.70104 3.15294 -106.764537]% solution
info.animate = true% plot animation
info.animfreq = 2% frame frequency
info.np = 21% number of points for meshgrid
optimview('ga',info)
References
[1] S. K. Mishra, "Global Optimization By Differential Evolution and Particle Swarm Methods: Evaluation On Some Benchmark Functions", Munich Research Papers in Economics