Schwefel
Problem definition
Objective function
f = @(x) 418.9829*2 - (x(:,1).*sin(sqrt(abs(x(:,1)))) + x(:,2).*sin(sqrt(abs(x(:,2)))))
Optimization settings
o = struct% initializing struct
o.d = 2% dimension of decision variable
o.lb = -500% lower bounds
o.ub = 500% upper bounds
Graphic representation
[x,y] = meshgrid(linspace(o.lb,o.ub,50)) surf(x,y,f([x(:),y(:)]))
Problem properties
convexity | smoothness | minimum |
0 | ∞ | f(420.9687,420.9687) = 0 |
Optimization example with ga
Algorithm options
o.maxit = 23% 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 = [420.9687 420.9687 0]% solution
info.animate = true% plot animation
info.animfreq = 2% frame frequency
info.np = 21% number of points for meshgrid
optimview('ga',info)
References
[1] H. P. Schwefel, "Numerical Optimization for Computer Models", John Wiley Sons, 1981