% Levy 05 function L. LAURENT -- 17/03/2017 -- luc.laurent@lecnam.net
0001 %% Levy 05 function 0002 %L. LAURENT -- 17/03/2017 -- 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 %global minimum : f(x)=-176.1375 for x=[-1.3068 -1.4248] 0026 % 0027 %Design space: -10<xi<10 0028 % 0029 0030 0031 function [p,dp]=funLevy05(xx) 0032 %constants 0033 m=5; 0034 a=1.42513; 0035 b=0.80032; 0036 0037 0038 %evaluation and derivatives 0039 x=xx(:,:,1); 0040 y=xx(:,:,2); 0041 % 0042 lI=reshape(1:m,1,1,m); 0043 % 0044 pa=cos((lI-1).*x+lI); 0045 pb=cos((lI+1).*y+lI); 0046 pc=x+a; 0047 pd=y+b; 0048 % 0049 p=sum(lI.*pa,3).*sum(lI.*pb,3)+pc.^2+pd.^2; 0050 0051 % 0052 if nargout==2 0053 % 0054 dp=zeros(size(xx)); 0055 % 0056 dp(:,:,1)=sum(-lI.*(lI-1).*sin((lI-1).*x+lI),3).*sum(lI.*pb,3)+2*pc; 0057 dp(:,:,2)=sum(-lI.*(lI+1).*sin((lI+1).*y+lI),3).*sum(lI.*pa,3)+2*pd; 0058 end 0059 end