funDolan

PURPOSE ^

% Dolan's function

SYNOPSIS ^

function [p,dp]=funDolan(xx)

DESCRIPTION ^

% Dolan's function
L. LAURENT -- 15/11/2016 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Dolan's function
0002 %L. LAURENT -- 15/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 %4 global minimas : f(x1,x2,x3,x4)=0
0026 %
0027 %Design space: -100<xi<100
0028 
0029 
0030 function [p,dp]=funDolan(xx)
0031 
0032 %constants
0033 a=1.7;
0034 b=01.5;
0035 c=0.1;
0036 d=0.2;
0037 e=1;
0038 
0039 %variables
0040 xxx=xx(:,:,1);
0041 yyy=xx(:,:,2);
0042 zzz=xx(:,:,3);
0043 vvv=xx(:,:,4);
0044 www=xx(:,:,5);
0045 
0046 %evaluation and derivatives
0047 pa=xxx+a*yyy;
0048 pb=sin(xxx);
0049 pc=b*zzz;
0050 pd=c*vvv;
0051 pe=cos(vvv+www-xxx);
0052 pf=d*www.^2-yyy-e;
0053 %
0054 pt=pa.*pb-pc-pd.*pe+pf;
0055 p=abs(pt);
0056 %
0057 if nargout==2
0058     sf=sign(pt);
0059     %
0060     dp(:,:,1)=sf.*(cos(xxx).*pa+pb-pd.*sin(vvv+www-xxx));
0061     dp(:,:,2)=sf.*(a*pb-1);
0062     dp(:,:,3)=-sf.*b;
0063     dp(:,:,4)=sf.*(-c*pe+pd.*sin(vvv+www-xxx));
0064     dp(:,:,5)=sf.*(pd.*sin(vvv+www-xxx)+2*d*www);
0065 end
0066 end

Generated on Tue 28-May-2019 16:00:34 by m2html © 2005