% Zimmerman function L. LAURENT -- 28/02/2017 -- luc.laurent@lecnam.net
0001 %% Zimmerman function 0002 % L. LAURENT -- 28/02/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 %1 minimum global: f(7,2)=0 0025 % 0026 %Design space 0<xi<100 0027 0028 function [p,dp] = funZimmerman(xx) 0029 0030 %constants 0031 a=9; 0032 b=3; 0033 c=2; 0034 d=14; 0035 e=100; 0036 0037 %evaluation and derivatives 0038 x=xx(:,:,1); 0039 y=xx(:,:,2); 0040 % 0041 Zh1=a-x-y; 0042 Zh2=(x-b).^2+(y-c).^2; 0043 Zh3=x.*y-d; 0044 Zp=@(t)e*(a+t); 0045 % 0046 pA(:,:,1)=Zh1; 0047 pA(:,:,2)=Zp(Zh2).*sign(Zh2); 0048 pA(:,:,3)=Zp(Zh3).*sign(Zh3); 0049 pA(:,:,4)=Zp(-x).*sign(x); 0050 pA(:,:,5)=Zp(-y).*sign(y); 0051 % 0052 if nargout==1 0053 p=max(pA,[],3); 0054 else 0055 [p,Ip]=max(abs(xx),[],3); 0056 end 0057 0058 if nargout==2 0059 Zh1dX=-ones(size(p)); 0060 Zh1dY=-ones(size(p)); 0061 Zh2dX=2*(x-b), 0062 Zh2dY=2*(y-c); 0063 Zh3dX=y; 0064 Zh3dX=x; 0065 dp=zeros(size(xx)); 0066 end 0067 end 0068