⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objfunction.asv

📁 基于灰色系统方法的离散多目标优化设计程序
💻 ASV
字号:
function y=objfunction(x)
 %  计算目标函数的程序。以下提供一计算实例。
 %  实际应用时可以按该格式输入您的目标函数。
 global f1 f0 fe kexample kg nn kdegree nn0; %作灰色优化增加
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  y0=5.3578547*x(3)^2+0.8356891*x(1)*x(5)+37.293239*x(1)-40792.141;   % 玄光男p45例2.2
    %%%%%%%%%%%%%%%%% 原例题,即不作灰色优化。  
 %--------------------------------------------
%起重机箱形主梁优化设计目标函数
%y0=x(1)*x(3)+x(2)*x(4);
%-------------以下作灰色优化增加-------------------------------
if kexample==1,
  x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);
  factor=[1/5;1/5;1/5;1/5;1/5]; 
  if nn<nn0;f0=[1000000;1000000;1000000;1000000];end %f0=[-31025.56;59.85684;289.3242;65.18375];%修改
  nn=nn+1;
  f1=[5.3578547*x3^2+0.8356891*x1*x5+37.293239*x1-40792.141;
    3763609119357585/4503599627370496*x5+1312139197373741/35184372088832;
   6032408107606315/562949953421312*x3;
  3763609119357585/4503599627370496*x1];%修改
elseif kexample==2
    x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);x6=x(6);
    if nn<=nn0;f0=[1000000;1000000;1000000;1000000;1000000;1000000;1000000];end %f0=[21685.02;912.2989;170.6178;49856.14;211.2721;604.7566;1087.986];
   nn=nn+1;
  factor=[1/7;1/7;1/7;1/7;1/7;1/7;1/7];
  f1=[0.78539815*(4.75*x1*x2^2*x3^2+85*x1*x2*x3^2-85*x1*x3^2+0.92*x1*x6^2-x1*x5^2+0.8*x1*x2*x3*x6-1.6*x1*x3*x6+x4*x5^2+x4*x6^2+32*x6^2+28*x5^2);
  67205257497872063/18014398509481984*x2^2*x3^2+300655099332585545/4503599627370496*x2*x3^2-300655099332585545/4503599627370496*x3^2+81353732760581971/112589990684262400*x6^2-3537118815677477/4503599627370496*x5^2+3537118815677477/5629499534213120*x2*x3*x6-3537118815677477/2814749767106560*x3*x6;
  67205257497872063/9007199254740992*x1*x2*x3^2+300655099332585545/4503599627370496*x1*x3^2+3537118815677477/5629499534213120*x1*x3*x6;
  67205257497872063/9007199254740992*x1*x2^2*x3+300655099332585545/2251799813685248*x1*x2*x3-300655099332585545/2251799813685248*x1*x3+3537118815677477/5629499534213120*x1*x2*x6-3537118815677477/2814749767106560*x1*x6;
  3537118815677477/4503599627370496*x5^2+3537118815677477/4503599627370496*x6^2;
  -3537118815677477/2251799813685248*x1*x5+3537118815677477/2251799813685248*x4*x5+24759831709742339/562949953421312*x5;
  81353732760581971/56294995342131200*x1*x6+3537118815677477/5629499534213120*x1*x2*x3-3537118815677477/2814749767106560*x1*x3+3537118815677477/2251799813685248*x4*x6+3537118815677477/70368744177664*x6];
elseif kexample==3
    x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);x6=x(6);x7=x(7);
    if nn<=nn0;f0=[1000000;1000000;1000000;1000000;1000000;1000000;1000000;1000000];end 
   nn=nn+1;
  factor=[1/8;1/8;1/8;1/8;1/8;1/8;1/8;1/8];
    f1=[0.7854*x1*x2^2*(3.333*x3^2+14.933*x3-43.0934)-1.508*x1*(x6^2+x7^2)+7.477*(x6^3+x7^3)+0.7854*(x4*x6^2+x5*x7^2);
        3927/5000*x2^2*(3333/1000*x3^2+14933/1000*x3-1516214220172873/35184372088832)-377/250*x6^2-377/250*x7^2;
        3927/2500*x1*x2*(3333/1000*x3^2+14933/1000*x3-1516214220172873/35184372088832);
        3927/5000*x1*x2^2*(3333/500*x3+14933/1000);
        3927/5000*x6^2;
        3927/5000*x7^2;
        -377/125*x1*x6+22431/1000*x6^2+3927/2500*x4*x6;
        -377/125*x1*x7+22431/1000*x7^2+3927/2500*x5*x7];
elseif kexample==4
     x1=x(1);x2=x(2);x3=x(3);
    if nn<=nn0;
        f0=[1000000;1000000;1000000;1000000];
    end 
    nn=nn+1;
    factor=[1/8;1/8;1/8;1/8]*2;
    f1=[((70*x3*x2^2.16)^2+(17319.46*x1^1.16)^2)^(1/2)/(400*x3*x2^2.16-520997*x1^1.16);
        abs(6572738630206607271920977911581/18889465931478580854784/(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))*x1^(33/25)+15108913/25*(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))^2*x1^(4/25));
        abs(10584/(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))*x3^2*x2^(83/25)-864*(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))^2*x3*x2^(29/25));
        abs(4900/(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))*x3*x2^(108/25)-400*(4900*x3^2*x2^(108/25)+5666153991557420062000843027225/18889465931478580854784*x1^(58/25))^(1/2)/(400*x3*x2^(54/25)-520997*x1^(29/25))^2*x2^(54/25))];
elseif kexample==5
    x1=x(1);x2=x(2);x3=x(3);x4=x(4);
    if nn<=nn0;
        f0=[1000000;1000000;1000000];
    end 
    nn=nn+1;
    factor=[1/3;1/3;1/3];
    f1=[2*x2*x4+x3*(x1-2*x4);
        60000/(x3*(x1-2*x4)^3+2*x2*x4*(4*x4^2+3*x1*(x1-2*x4)));
        180000*x1/(x3*(x1-2*x4)^3+2*x2*x4*(4*x4^2+3*x1*(x1-2*x4)))+15000*x2/((x1-2*x4)*x3^2+2*x2^3*x4)];
else kexample==6
    x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);
    factor=[1/5;1/5;1/5;1/5;1/5]; 
    if nn<nn0;f0=[1000000;1000000;1000000;1000000];end 
     nn=nn+1;
    f1=[37.6901+4.9527*x1-5.8503*x2+2.5132*x3+1.445*x4+0.2898*x5+5.5793*x2^2-4.281*x1*x2-46;
      74.833+60.202*x1+52.4*x2-16.168*x3-40.298*x4+23.824*x5-17.158*x1^2-6.262*x2^2+8.263*x3^2+8.144*x4^2-11.34*x5^2-10.435*x2*x3+10.234*x3*x4-150;
      57-(49.498+1.785*x1+1.28*x2+1.779*x3+0.483*x4+1.609*x5-0.342*x1^2-0.138*x2^2-0.216*x3^2-0.269*x5^2-0.131*x1*x2-0.1*x2*x3-0.142*x3*x4-0.129*x3*x5);
      4.022-1.849*x1-1.0061*x2+0.234*x3+0.079*x4-1.128*x5+0.708*x1^2+0.34*x2^2+0.601*x5^2-0.368*x1*x5-0.296*x2*x5-0.2];
else
   x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);
    factor=[1/5;1/5;1/5;1/5;1/5]; 
    if nn<nn0;f0=[1000000;1000000;1000000];end 
    
     nn=nn+1; 
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if kdegree==1 % absolute degree of grey incidence%%%%%%%%%%%%%%%%%
    f2=AbsoluteGreyIncidence(f0,f1);fe=f2;
elseif  kdegree==2 % degree of grey incidencer%
    f2=DengTypeGreyIncidence(f0,f1,factor);fe=f2;
elseif kdegree==3 % relative degree of grey incidenc
    f2=RelativeGreyIncidence(f0,f1); fe=f2;
elseif kdegree==4 % compositive  degree of grey incidenc
    f2=0.5*AbsoluteGreyIncidence(f0,f1)+0.5*RelativeGreyIncidence(f0,f1);fe=f2;
elseif kdegree==5 % improved relative degree of grey incidenc
    f2=ImproveRelativeGreyIncidence(f0,f1);fe=f2; 
elseif kdegree==6 %improved absolue degree of grey incidenc
     f2=ImproveAbsoluteGreyIncidence(f0,f1);fe=f2; 
elseif kdegree==7 % improved  compositive  degree of grey incidenc
    f2=0.5*ImproveRelativeGreyIncidence(f0,f1)+ImproveRelativeGreyIncidence(f0,f1);fe=f2;
elseif kdegree==8  %B type degree of grey incidenc
    f2=BtypeGreyIncidence(f0,f1); fe=f2;  
else %C type degree of grey incidenc 
     f2=CtypeGreyIncidence(f0,f1); fe=f2;  
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if kg==1
    y=-f2;%1-f2 is grey 差异度转化为最小优化;1/f2倒数转化为最小优化(灰熵计算仅对于邓氏关联度可以)。
elseif kg==2
   y=f1;
else
    y=f1(1);
end
% %%%%%%%%%%%%%%2007.8.15%%%%%%%%%%%%%%%%
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -