//Reference: Ernesto P. Adorio and U.P. Diliman,"MVF - Multivariate Test Functions //Library in C for Unconstrained Global Optimization",2005, //http://www.geocities.ws/eadorio/mvf.pdf, Last accessed, 11th June 2018 //Example: The 17-dimensional function mvfCola computes indirectly the formula f(n,u) //by setting x0 = y0, x1 = u0, x(i) = u(2(i−2)), y(i) = u(2(i−2)+1) //f(n,u) = h(x,y) =sum((r(i,j) − d(i,j))^2) for all j2 x(i) = u(2*(i-2));y(i) = u(2*(i-2)+1); end r(i,j) = ((x(i) - x(j))^2 + (y(i)-y(j))^2)^0.5; summation = summation + (( r(i,j) - d(i,j) )^2) end end end endfunction //Lower bound x1 = [0 -4*ones(1,16)]; //Upper bound x2 = 4*ones(1,17); //Options structure options=list("MaxIter",[1500],"CpuTime", [100],"TolX",[1e-6]) [xopt,fopt,exitflag,output,lambda]=fminbnd(Cola,x1,x2,options) // Result representation clc; select exitflag case 0 disp("Optimal Solution Found") disp(xopt',"The optimum solution obtained is") disp(fopt,"The objective function value is") case 1 disp("Maximum Number of Iterations Exceeded. Output may not be optimal") disp(xopt,"The solution obtained") f = Cola(xopt) disp(f,"The objective function value is") case 2 disp("Maximum CPU Time exceeded. Output may not be optimal") disp(xopt',"The solution obtained") f = Cola(xopt) disp(f,"The objective function value is") case 3 disp("Stop at Tiny Step") disp(xopt',"The solution obtained") f = Cola(xopt) disp(f,"The objective function value is") case 4 disp("Solved To Acceptable Level") disp(xopt',"The solution obtained") f = Cola(xopt) disp(f,"The objective function value is") case 5 disp("Converged to a point of local infeasibility") disp(xopt',"The solution obtained") f = Cola(xopt) disp(f,"The objective function value is") end disp(output)