www.pudn.com > GA.rar > fitness.m, change:2009-03-17,size:1238b


function z=fitness(x)          %目标函数 
la=25*10^(-3); 
l0=20*10^(-3); 
a=10*10^(-3); 
T=100; 
tao=144*10^6; 
M=80; 
sigma=124*10^6; 
 
for i=1:length(x)  
    
 a=tao-T./((5088.448*x(i,2).^3)*(1-(x(i,1)./x(i,2)).^4))>0; 
 b=sigma-10190.087*M./((x(i,4).^3)-(x(i,3)./x(i,4)).^4)>0; 
 c=x(i,5)-0.5*x(i,2)>0; 
 d=x(i,6)-0.5*x(i,4)>0; 
 e=x(i,4)-x(i,3)>0; 
 f=x(i,2)-x(i,1)>0; 
 g=x(i,5)-x(i,6)>0; 
 h=x(i,6)-5>0; 
 k=x(i,5)-6.25>0; 
  
 if  a==1 & b==1 & c==1 & d==1 & e==1 & f==1 & g==1 & h==1 & k==1; 
  
   
z(i)=0.25*pi*la*(x(i,4).^2-x(i,3).^2)+... 
 0.5*pi*l0*(x(i,2).^2-x(i,1).^2)+... 
    2*a*(x(i,5)+x(i,6)).^2./sqrt(1-((x(i,5)-x(i,6))./(x(i,5)+x(i,6))).^2)+... 
    (x(i,5).^2-x(i,6).^2)*acos((x(i,5)-x(i,6))./(x(i,5)+x(i,6)))+pi*x(i,5).^2; 
 
 else  
     z(i)=0.25*pi*la*(x(i,4).^2-x(i,3).^2)+... 
    0.5*pi*l0*(x(i,2).^2-x(i,1).^2)+... 
    2*a*(x(i,5)+x(i,6)).^2./sqrt(1-((x(i,5)-x(i,6))./(x(i,5)+x(i,6))).^2)+... 
    (x(i,5).^2-x(i,6).^2)*acos((x(i,5)-x(i,6))./(x(i,5)+x(i,6)))+pi*x(i,5).^2+... 
    1000*(tao-T./((5088.448*x(i,2).^3)*(1-(x(i,1)./x(i,2)).^4)))+... 
    1000*(sigma-10190.087*M./((x(i,4).^3)-(x(i,3)./x(i,4)).^4))+... 
    1000*(x(i,5)-0.5*x(i,2))+... 
    1000*(x(i,6)-0.5*x(i,4)); %100为罚因子 
end 
end