funDecanomial

PURPOSE ^

% Decanomial function

SYNOPSIS ^

function [p,dp]=funDecanomial(xx)

DESCRIPTION ^

% Decanomial function 
L. LAURENT -- 14/03/2017 -- luc.laurent@lecnam.net

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Decanomial function
0002 %L. LAURENT -- 14/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 x=[2,-3]
0026 %
0027 %Design space: -10<xi<10
0028 
0029 
0030 function [p,dp]=funDecanomial(xx)
0031 %constants
0032 a01=1e-3;
0033 a02=12;
0034 a03=54;
0035 a04=108;
0036 a05=81;
0037 a06=20;
0038 a07=180;
0039 a08=960;
0040 a09=3360;
0041 a10=8064;
0042 a11=13340;
0043 a12=15360;
0044 a13=11520;
0045 a14=5120;
0046 a15=2624;
0047 
0048 %evaluation and derivatives
0049 x=xx(:,:,1);
0050 y=xx(:,:,2);
0051 %
0052 pa=y.^4+a02*y.^3+a03*y.^2+a04*y+a05;
0053 pb=x.^10-a06*x.^9+a07*x.^8-a08*x.^7+a09*x.^6-a10*x.^5+a11*x.^4-a12*x.^3+a13*x.^2-a14*x+a15;
0054 pc=(abs(pa)+abs(pb));
0055 %
0056 p=a01*pc.^2;
0057 %
0058 if nargout==2
0059     %
0060     dp=zeros(size(xx));
0061     %
0062     dp(:,:,1)=2*a01*pc.*sign(pb).*...
0063         (10*x.^9-9*a06*x.^8+8*a07*x.^7-7*a08*x.^6+6*a09*x.^5-5*a10*x.^4+4*a11*x.^3-3*a12*x.^2+2*a13*x-a14);
0064     dp(:,:,2)=2*a01*pc.*sign(pa).*...
0065         (4*y.^3+3*a02*y.^2+2*a03*y+a04);
0066 end
0067 end

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