% "Mystery" function (Sasena 2002) L. LAURENT -- 01/04/2011 -- luc.laurent@lecnam.net
0001 %% "Mystery" function (Sasena 2002) 0002 %L. LAURENT -- 01/04/2011 -- luc.laurent@lecnam.net 0003 0004 % sources available here: 0005 % https://bitbucket.org/luclaurent/optigtest/ 0006 % https://github.com/luclaurent/optigtest/ 0007 0008 % optiGTest - set of testing functions A toolbox to easy manipulate functions. 0009 % Copyright (C) 2017 Luc LAURENT <luc.laurent@lecnam.net> 0010 % 0011 % This program is free software: you can redistribute it and/or modify 0012 % it under the terms of the GNU General Public License as published by 0013 % the Free Software Foundation, either version 3 of the License, or 0014 % (at your option) any later version. 0015 % 0016 % This program is distributed in the hope that it will be useful, 0017 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0019 % GNU General Public License for more details. 0020 % 0021 % You should have received a copy of the GNU General Public License 0022 % along with this program. If not, see <http://www.gnu.org/licenses/>. 0023 0024 % 0025 %3 local minima 0026 %1 global minimum: f(x)=-1.4565 pour x={2.5044,2.5778} 0027 % 0028 %design space: 0<xi<5 0029 0030 function [p,dp]=funMystery(xx) 0031 0032 a=2; 0033 b=0.01; 0034 c=2; 0035 d=2; 0036 e=7; 0037 f=0.5; 0038 g=0.7; 0039 0040 %responses and derivatives 0041 xxx=xx(:,:,1); 0042 yyy=xx(:,:,2); 0043 0044 myst=a+b*(yyy-xxx.^2).^2+(1-xxx).^2+c*(d-yyy).^2+e*sin(f*xxx).*sin(g*xxx.*yyy); 0045 p=myst; 0046 if nargout==2 0047 dmyst(:,:,1)=-b*4*(yyy-xxx.^2)-2*(1-xxx)+... 0048 e*f*cos(f*xxx).*sin(g*xxx.*yyy)+e*g*yyy.*sin(f*xxx).*cos(g*xxx.*yyy); 0049 dmyst(:,:,2)=2*b*(yyy-xxx.^2)-4*(d-yyy)+e*g*xxx.*sin(f*xxx).*cos(g*xxx.*yyy); 0050 dp=dmyst; 0051 end 0052 end