% Kowalik function L. LAURENT -- 17/03/2017 -- luc.laurent@lecnam.net
0001 %% Kowalik 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)=0.00030748610 for x=[0.192833 0.190836 0.123117 0026 %0.135766] 0027 % 0028 %Design space: -5<xi<5 0029 % 0030 0031 0032 0033 function [p,dp]=funKowalik(xx) 0034 %constants 0035 m=11; 0036 a = [0.1957, 0.1947, 0.1735, 0.1600, 0.0844,... 0037 0.0627, 0.0456, 0.0342, 0.0323, 0.0235,... 0038 0.0246]; 0039 b =[4, 2, 1, 1/2, 1/4,... 0040 1/6, 1/8, 1/10, 1/12, 1/14,... 0041 1/16]; 0042 a=reshape(a,1,1,m); 0043 b=reshape(b,1,1,m); 0044 0045 0046 %evaluation and derivatives 0047 x=xx(:,:,1); 0048 y=xx(:,:,2); 0049 z=xx(:,:,3); 0050 w=xx(:,:,4); 0051 % 0052 pa=b.^2+b.*y; 0053 pb=b.^2+b.*z+w; 0054 % 0055 pt=a-x.*pa./pb; 0056 % 0057 p=sum(pt.^2,3); 0058 % 0059 if nargout==2 0060 % 0061 dp=zeros(size(xx)); 0062 % 0063 dp(:,:,1)=sum(-2*pa./pb.*pt,3); 0064 dp(:,:,2)=sum(-2*b.*x./pb.*pt,3); 0065 dp(:,:,3)=sum(2*b.*x.*pa./pb.^2.*pt,3); 0066 dp(:,:,4)=sum(2*x.*pa./pb.^2.*pt,3); 0067 end 0068 end