% Damavandi's function L. LAURENT -- 05/11/2016 -- luc.laurent@lecnam.net
0001 %% Damavandi's function 0002 %L. LAURENT -- 05/11/2016 -- 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 %1 global minimum : f(2,2)=0 0026 % 0027 %Design space: 0<xi<14 0028 0029 0030 function [p,dp]=funDamavandi(xx) 0031 0032 %constants 0033 a=1; 0034 b=pi; 0035 c=2; 0036 d=7; 0037 0038 %variables 0039 xxx=xx(:,:,1); 0040 yyy=xx(:,:,2); 0041 0042 %evaluation and derivatives 0043 pax=xxx-c; 0044 pay=yyy-c; 0045 sx=sin(b*pax); 0046 sy=sin(b*pay); 0047 kxy=sx.*sy./(b^2*pax.*pay); 0048 % 0049 pbx=xxx-d; 0050 pby=yyy-d; 0051 hxy=c+pbx.^2+c*pby.^2; 0052 % 0053 p=(a-abs(kxy).^5).*hxy; 0054 % 0055 if nargout==2 0056 cx=cos(b*pax); 0057 cy=cos(b*pay); 0058 % 0059 dkx=b*cx.*sy./(b^2*pax.*pay)+b^2*pax.*kxy./(b^2*pax.*pay); 0060 dky=b*cy.*sx./(b^2*pax.*pay)+b^2*pbx.*kxy./(b^2*pax.*pay); 0061 % 0062 dhx=2*pbx; 0063 dhy=2*c*pby; 0064 % 0065 dp(:,:,1)=dhx.*(a-abs(kxy).^5)-5*dkx.*sign(kxy).*kxy.^4.*hxy; 0066 dp(:,:,2)=dhy.*(a-abs(kxy).^5)-5*dky.*sign(kxy).*kxy.^4.*hxy; 0067 end 0068 end