Michalewicz

Problem definition

Objective function
m = 10
f = @(x) - (sin(x(:,1)).*sin((x(:,1).^2)/pi).^(2*m) + sin(x(:,2)).*sin((2*x(:,2).^2)/pi).^(2*m))
Optimization settings
o = struct	

% initializing struct

o.d = 2

% dimension of decision variable

o.lb = 0

% lower bounds

o.ub = pi

% upper bounds

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

Problem properties

convexity smoothness minimum
0 f(2.20, 1.57) = -1.8013

Optimization example with ga

Algorithm options
o.maxit = 24	

% 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 = [2.20 1.57 -1.8013]	

% solution

info.animate = true

% plot animation

info.animfreq = 2

% frame frequency

info.np = 21

% number of points for meshgrid

optimview('ga',info)

References

[1] M. Molga and C. Smutnicki, "Test functions for optimization needs", 2005

Related functions

ga | meshgrid | surf