< MAXGEN;genPe0 = 0.995;pe1 = 0.005; FitnV=ranking(Objv);Selch=select('sus',Chrom,FitnV);Selch=recombin('xovsp', Selch,Pe0);Selch=mut( Selch,pe1);phen1=bs2rv(Selch,FieldD);size(Objv)size(Chrom)size(FitnV)Rs = [];Rr = [];M= [];Ld = [];Lq = [];p= [];J= []; for a=1:1:NINDRs(a) = phen1(a,1);Rr(a) = phen1(a,2); M(a)= phen1(a,3); Ld(a) = phen1(a,4); Lq(a) = phen1(a,5); p(a)= floor(phen1(a,6))+1; J(a)= phen1(a,7); %计算对应的目标值epls= func_obj(Rs(a),Rr(a),M(a),Ld(a),Lq(a),p(a),J(a));E= epls;JJ(a,1) = E;end Objvsel=(JJ);[Chrom,Objv]=reins(Chrom,Selch,1,1,Objv,Objvsel);gen=gen+1; %保存参数收敛过程和误差收敛过程以及函数值拟合结论index1= isnan(JJ);index2= find(index1 == 1);JJ(index2) = [];Error2(gen) = min(JJ);[VV,II]=min(JJ);Rs3(gen)= [mean(Rs)]; %转子电阻Rr3(gen)= [mean(Rr)]; %定子电阻M3(gen)= [mean(M)]; %磁链Ld3(gen)= [mean(Ld)]; %d轴电感Lq3(gen)= [mean(Lq)]; %q轴电感p3(gen)= [mean(p)];%极对数J3(gen)= [mean(J)]; %转动惯量if gen<=64Rs4= [Rs4,mean(Rs3(1:gen))]; %转子电阻Rr4= [Rr4,mean(Rr3(1:gen))]; %定子电阻M4= [M4,mean(M3(1:gen))]; %磁链Ld4= [Ld4,mean(Ld3(1:gen))]; %d轴电感Lq4= [Lq4,mean(Lq3(1:gen))]; %q轴电感p4= [p4,mean(p3(1:gen))];%极对数J4= [J4,mean(J3(1:gen))]; %转动惯量elseRs4= [Rs4,mean(Rs3(gen-64:gen))]; %转子电阻Rr4= [Rr4,mean(Rr3(gen-64:gen))]; %定子电阻M4= [M4,mean(M3(gen-64:gen))]; %磁链Ld4= [Ld4,mean(Ld3(gen-64:gen))]; %d轴电感Lq4= [Lq4,mean(Lq3(gen-64:gen))]; %q轴电感p4= [p4,mean(p3(gen-64:gen))];%极对数J4= [J4,mean(J3(gen-64:gen))]; %转动惯量endend [V,I] = min(JJ);VRs_best = Rs(I) Rr_best = Rr(I)M_best= M(I)Ld_best = Ld(I) Lq_best = Lq(I)p_best= p(I) J_best= J(I)save result.mat Rs_best Rr_best M_best Ld_best Lq_best p_best J_best02_042m
【m基于GA遗传算法的PMSM永磁同步电机参数最优计算matlab仿真】4.完整
- QQ、微信、新浪等第三方登录,集成到基于机智云框架的APP上
- p94-p98 键指offer——动态规划与贪婪算法+面试题14:剪绳子
- 《算法图解》总结第 8 章:贪婪算法
- 基于机器视觉的数字1-10手势识别系统
- 基于可靠消息服务的分布式事务演进
- 《基于OPENPOSE的三维上肢康复系统》论文解读
- 能够同时进出车 可直接运行的基于Java多线程的停车场管理系统
- 机器学习实战2-决策树算法
- 今天给大家介绍几个基于三维重建的开放云平台Altizure
- 【GA三维路径规划】基于matlab遗传算法无人机三维航迹规划【含Matlab源