funLevy13

PURPOSE ^

% Levy 13 function

SYNOPSIS ^

function [p,dp]=funLevy13(xx)

DESCRIPTION ^

% Levy 13 function
L. LAURENT -- 17/03/2017 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Levy 13 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 for xi=1
0026 %
0027 %Design space: -10<xi<10
0028 %
0029 
0030 
0031 function [p,dp]=funLevy13(xx)
0032 %constants
0033 a=1;
0034 b=3*pi;
0035 c=2*pi;
0036 
0037 
0038 %evaluation and derivatives
0039 x=xx(:,:,1);
0040 y=xx(:,:,2);
0041 %
0042 pa=sin(b*y).^2+a;
0043 pb=sin(c*y).^2+a;
0044 pc=x-a;
0045 pd=y-a;
0046 pe=sin(b*x);
0047 %
0048 p=pc.^2.*pa+pd.^2.*pb+pe.^2;
0049 
0050 %
0051 if nargout==2
0052     %
0053     dp=zeros(size(xx));
0054     %
0055     dp(:,:,1)=2*pc.*pa+2*b*pe.*cos(b*x);
0056     dp(:,:,2)=2*b.*pc.^2.*sin(b*y).*cos(b*y)...
0057         +2*pd.*pb...
0058         +2*c*pd.^2.*sin(c*y).*cos(c*y);
0059 end

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