funDeVilliersGlasser1

PURPOSE ^

% deVilliers Glasser 1 function

SYNOPSIS ^

function [p,dp]=funDeVilliersGlasser1(xx)

DESCRIPTION ^

% deVilliers Glasser 1 function
L. LAURENT -- 15/11/2016 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% deVilliers Glasser 1 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: -500<xi<500
0028 
0029 
0030 function [p,dp]=funDeVilliersGlasser1(xx)
0031 
0032 %constants
0033 a=24;
0034 b=0.1;
0035 c=1;
0036 d=60.137;
0037 f=1.371;
0038 g=3.112;
0039 h=1.761;
0040 %
0041 ii=1:a;
0042 t=reshape(b*(ii-c),[1,1,a]);
0043 y=d*f.^t.*(sin(g*t+h));
0044 
0045 %variables
0046 xxx=xx(:,:,1);
0047 yyy=xx(:,:,2);
0048 zzz=xx(:,:,3);
0049 vvv=xx(:,:,4);
0050 
0051 %evaluation and derivatives
0052 zt=bsxfun(@times,zzz,t);
0053 ztv=bsxfun(@plus,zt,vvv);
0054 szv=sin(ztv);
0055 %
0056 yt=bsxfun(@power,yyy,t);
0057 xyt=bsxfun(@times,yt,xxx);
0058 %
0059 pa=szv.*xyt;
0060 pb=bsxfun(@minus,pa,y);
0061 %
0062 p=sum(pb.^2,3);
0063 %
0064 if nargout==2
0065     xt=bsxfun(@times,xxx,t);
0066     ytm=bsxfun(@power,yyy,t-1);
0067     czv=cos(ztv);
0068     %
0069     dp(:,:,1)=sum(2*yt.*szv.*pb,3);    
0070     dp(:,:,2)=sum(2*xt.*ytm.*szv.*pb,3);
0071     dp(:,:,3)=sum(2*xt.*yt.*czv.*pb,3);
0072     dp(:,:,4)=sum(2*xyt.*czv.*pb,3);
0073 end
0074 end

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