% Ploloni 1st objective function L. LAURENT -- 09/05/2018 -- luc.laurent@lecnam.net
0001 %% Ploloni 1st objective function 0002 %L. LAURENT -- 09/05/2018 -- 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 function [p,dp]=funObjPoloni1(xx) 0025 0026 %constants 0027 a=0.5; 0028 b=2; 0029 c=1.5; 0030 % 0031 A1=a*sin(1)-b*cos(1)+sin(b)-c*cos(b); 0032 A2=c*sin(1)-cos(1)+b*sin(b)-a*cos(b); 0033 0034 %responses and derivatives 0035 xxx=xx(:,:,1); 0036 yyy=xx(:,:,2); 0037 % 0038 sx=sin(xxx); 0039 sy=sin(yyy); 0040 cx=cos(xxx); 0041 cy=cos(yyy); 0042 % 0043 B1=a*sx-b*cx+sy-c*cy; 0044 B2=c*sx-cx+b*sy-a*cy; 0045 % 0046 tda=A1-B1; 0047 tdb=A2-B2; 0048 % 0049 p=1+tda.^2+tdb.^2; 0050 0051 if nargout==2 0052 % 0053 B1x=a*cx+b*sx; 0054 B1y=cy+c*sy; 0055 B2x=c*cx+sx; 0056 B2y=b*cy+a*sy; 0057 % 0058 dp(:,:,1)=-2*B1x.*tda-2*B2x.*tdb; 0059 dp(:,:,2)=-2*B1y.*tda-2*B2y.*tdb; 0060 end 0061 end