Three-Hump Camel
Problem definition
Objective function
f = @(x) 2*x(:,1).^2 - 1.05*x(:,1).^4 + x(:,1).^6/6 + x(:,1).*x(:,2) + x(:,2).^2
Optimization settings
o = struct% initializing struct
o.lb = -5% lower bounds
o.ub = 5% upper bounds
Graphic representation
[x,y] = meshgrid(o.lb:0.5:o.ub) surf(x,y,f([x(:),y(:)]))
Problem properties
convexity | smoothness | minimum |
1 | ∞ | f(0,0) = 0 |
Optimization example with fminsearch
Optimization
rng(0)% for tractability
x0 = [4.9,2]% initial guess
[xmin,fmin,info] = fminsearch(f,x0,o)% running minimization
Animation
rng(0) x0 = [4.9,2] [~,~,info] = fminsearch(f,x0,o) info.sol = [0 0 0]% solution
info.animate = true% plot animation
info.animfreq = 5% frame frequency
optimview('fminsearch',info)
References
[1] F. H. Branin Jr., "Widely Convergent Method of Finding Multiple Solutions of Simultaneous
Nonlinear Equations", IBM Journal of Research and Development, vol. 16, no.
5, pp. 504-522, 1972