⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 obj_fun.asv

📁 youhua hfghdfgfh fghgf hgf
💻 ASV
字号:
function y=obj_fun(x)


 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Rosenbrock 'Banana' function
%x(1) and x(2)->[-5,5];
% the function has global minimum of 0 at(1,1)! 

% y=100*(x(2)-x(1)^2)^2+(1-x(1))^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Himmelblau's function
%x(1) and x(2) ->[-5,5]
%the function takes its minimum value of 0 at four solutiuon points,given
%by the intersection of the two conic sections y=-x^2+11and x=-y^2+7

% y=(x(1)^2+x(2)-11)^2+(x(1)+x(2)^2-7)^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Freudstein-Roth function
%x(1)and x(2)->[-10,10]
%the global minimum of 0 at (5,4)

% y=(x(1)-13+((5-x(2))*x(2)-2)*x(2))^2+(x(1)-29+((x(2)+1)*x(2)-14)*x(2))^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Rastrigin's function
%x(1) and x(2)->[-1,1]
%the global minimum of -2 occurs at (0,0)!

y=(x(1)^2+x(2)^2)-cos(18*x(1))-cos(18*x(2));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Griewank's function
%x(1) and x(2)->[-100,100]
%with n=2 and d=10 thw global minimum of 0 occurs at (0,0)!
% d=10;
% y=1+(x(1)^2+x(2)^2)/d-cos(x(1))*cos(x(2)/2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Jennrich-Sampson function
%x(1) and x(2)->[-1,1]
%the gloabl minimum of 124.362 occurs at (0.257825,0.257825).
% t=0;
% for i=1:10
%     t=t+(2+2*i-exp(x(1)*i)-exp(x(2)*i))^2;
% end
% y=t;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% y=20+(x(1)-100)^2+(x(2)-9000)^2-10*(cos(2*pi*(x(1)-100))+cos(2*pi*(x(2)-9000)));

% y=x+10*sin(5*x)+7*cos( x);
% y=-y;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -