% Schwefel 26 function L. LAURENT -- 26/01/2011 -- luc.laurent@lecnam.net modif on the 16/09/2011 -- change to n variables sources available here: https://bitbucket.org/luclaurent/optigtest/ https://github.com/luclaurent/optigtest/
0001 %% Schwefel 26 function 0002 %L. LAURENT -- 26/01/2011 -- luc.laurent@lecnam.net 0003 %modif on the 16/09/2011 -- change to n variables 0004 % 0005 % sources available here: 0006 % https://bitbucket.org/luclaurent/optigtest/ 0007 % https://github.com/luclaurent/optigtest/ 0008 0009 % optiGTest - set of testing functions A toolbox to easy manipulate functions. 0010 % Copyright (C) 2017 Luc LAURENT <luc.laurent@lecnam.net> 0011 % 0012 % This program is free software: you can redistribute it and/or modify 0013 % it under the terms of the GNU General Public License as published by 0014 % the Free Software Foundation, either version 3 of the License, or 0015 % (at your option) any later version. 0016 % 0017 % This program is distributed in the hope that it will be useful, 0018 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0019 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0020 % GNU General Public License for more details. 0021 % 0022 % You should have received a copy of the GNU General Public License 0023 % along with this program. If not, see <http://www.gnu.org/licenses/>. 0024 0025 %numerous local minima 0026 %1 global minimum : x=(420.968746,420.968746,...,420.968746) >> f(x)=0 0027 % 0028 %Design space: -500<xi<500 0029 0030 function [p,dp]=funSchwefel26(xx) 0031 0032 %constants 0033 a=418.9829; 0034 nbvar=size(xx,3); 0035 0036 %evaluation and derivatives 0037 pa=abs(xx); 0038 sqa=sqrt(pa); 0039 ssqa=sin(sqa); 0040 pb=xx.*ssqa; 0041 % 0042 p=a*nbvar-sum(pb,3); 0043 % 0044 if nargout==2 0045 % 0046 csqa=cos(sqa); 0047 dp=-ssqa-xx.*sign(xx).*csqa./(2*sqa); 0048 iXZ=(abs(xx(:))<eps); 0049 dp(iXZ)=0; 0050 end 0051 0052 end