遗传算法多目标函数优化

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

多目标遗传算法优化铣削正交试验结果序号vc(m/min)fz(mm/z)ae(mm)ap(mm)F(N)Ra(μm)1400.020.25446.30.1742400.040.5659.70.2113400.060.758106.50.2884400.081.010123.00.3485600.020.25899.30.2526600.040.510134.00.3027600.061.04139.70.2388600.080.756130.40.2769800.020.7510255.80.29810800.041.08255.80.28811800.060.256110.40.25912800.080.54140.80.258131000.021.06314.20.240141000.040.754233.40.239151000.060.510278.60.330161000.080.258144.70.328说明:1.建立切削力和表面粗糙度模型如:3.190.08360.8250.5640.45410cepzFvfaa(1)aR此模型你们来拟合(上面有实验数据,剩下的两个方程已经是我帮你们拟合好的了)(2)𝑅𝑎=10−0.92146𝑣𝑐0.14365𝑓𝑧0.16065𝑎𝑒0.047691𝑎𝑝0.3845710002/czpeQvfaaD(3)变量约束范围:401000.020.080.251.0210czepvfaa公式(1)和(2)值越小越好,公式(3)值越大越好。π=3.14D=82.请将多目标优化操作过程录像(同时考虑三个方程,优化出最优的自变量数值),方便我后续进行修改;将能保存的所有图片及源文件发给我;将最优解多组发给我,类似于下图(黄色部分为达到的要求)遗传算法的结果:vcfzaeapFRaQ69.49510.02010.59362.030144.45690.1507-133.92377.76040.080.80047.7189298.80560.3241-3058.3469.84320.04290.79237.316175.06530.2827-1383.0170.2130.02820.69457.6443117.280.2673-837.41369.49510.02010.59362.030144.45690.1507-133.923程序如下:clear;clc;%遗传算法直接求解多目标优化D=8;%FunctionhandletothefitnessfunctionF=@(X)[10^(3.19)*(X(1).^(-0.0836)).*(X(2).^0.825).*(X(3).^0.564).*(X(4).^0.454)];Ra=@(X)[10^(-0.92146)*(X(1).^0.14365).*(X(2).^0.16065).*(X(3).^0.047691).*(X(4).^0.38457)];Q=@(X)[-1000*2*X(1).*X(2).*X(3).*X(4)/(pi*D)];nvars=4;%Numberofdecisionvariableslb=[40,0.02,0.25,2];%Lowerboundub=[100,0.08,1.0,10];%UpperboundA=[];b=[];%NolinearinequalityconstraintsAeq=[];beq=[];%Nolinearequalityconstraints%遗传算法设定约束options=gaoptimset('ParetoFraction',0.3,'PopulationSize',200,'Generations',300,'StallGenLimit',200,'TolFun',1e-100,'PlotFcns',@gaplotpareto);%thedataofPareto1FUN=@(X)[F(X);Ra(X)];[x,fval]=gamultiobj(FUN,nvars,A,b,Aeq,beq,lb,ub,options);%开启一个新的图形figure;%画出Pareto1plot(fval(:,1),fval(:,2),'mp');%画出网格gridon;%设定横坐标xlabel('F');%设定纵坐标ylabel('Ra');%设定题目title('Paretofront1');%thedataofPareto2FUN=@(X)[F(X);Q(X)];[x,fval]=gamultiobj(FUN,nvars,A,b,Aeq,beq,lb,ub,options);%开启一个新的图形figure;%画出Pareto2plot(fval(:,1),fval(:,2),'mp');%画出网格gridon;%设定横坐标xlabel('F');%设定纵坐标ylabel('Q');%设定题目title('Paretofront2');%thedataofPareto3FUN=@(X)[Ra(X);Q(X)];[x,fval]=gamultiobj(FUN,nvars,A,b,Aeq,beq,lb,ub,options);%开启一个新的图形figure;%画出Pareto3plot(fval(:,1),fval(:,2),'mp');%画出网格gridon;%设定横坐标xlabel('Ra');%设定纵坐标ylabel('Q');%设定题目title('Paretofront3');%thedataofPareto(F,Ra,Q)FUN=@(X)[F(X);Ra(X);Q(X)];[x,fval]=gamultiobj(FUN,nvars,A,b,Aeq,beq,lb,ub,options);%开启一个新的图形figure;%画出Pareto4plot3(fval(:,1),fval(:,2),fval(:,3),'m.');%画出网格gridon;%设定横坐标xlabel('F');%设定纵坐标ylabel('Ra');%设定竖坐标zlabel('Q');%设定题目title('Paretofront4');%重新设定遗传算法options=gaoptimset('ParetoFraction',0.3,'PopulationSize',5,'Generations',1000,'StallGenLimit',200,'TolFun',1e-100,'PlotFcns',@gaplotpareto);%遗传算法求解[x,fval]=gamultiobj(FUN,nvars,A,b,Aeq,beq,lb,ub,options);%显示结果formatshortgxfval=[x,fval]%保存结果到Excelxfval=round(xfval*10000)/10000;xlswrite('data.xlsx',xfval,'sheet1','A1')

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功