Chichinadze

Problem definition

Objective function
f = @(x) x(:,1).^2 - 12*x(:,1) + 11 + 10*cos(pi*x(:,1)./2) + 8*sin(5*pi*x(:,1)./2) - ((1/5).^0.5)*exp(-0.5*(x(:,2) - 0.5).^2)
Optimization settings
o = struct	

% initializing struct

o.d = 2

% dimension of decision variable

o.lb = -30

% lower bounds

o.ub = 30

% upper bounds

Graphic representation
[x,y] = meshgrid(o.lb:2:o.ub)
surf(x,y,f([x(:),y(:)]))

Problem properties

convexity smoothness minimum
0 f(6.1898,0.5) = -42.944

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 = [6.1898 0.5 -42.944]	

% solution

info.animate = true

% plot animation

info.animfreq = 2

% frame frequency

info.np = 21

% number of points for meshgrid

optimview('ga',info)

Related functions

ga | meshgrid | surf