1 简介
针对三相桥式逆变电路为研究对象,建立了仿真模型,并对逆变器主电路开关器件的开路故障进行仿真,提出了基于BP神经网络的故障诊断方法,确定了网络的结构和参数,并以此训练网络.仿真试验结果表明,该神经网络具有很好的故障识别能力,所选择的基于BP神经网络的三相逆变器故障诊断系统是可行的.



2 部分代码
load T1load T2load T3load T4% wt=cwt(x,wname)使用wname指定的解析小波来计算cwt。% wname的有效选项是“morse”、“amor”和“bump”,它们分别指定morse、Morlet(Gabor)和bump小波。% 如果不指定wname,则wname默认为“morse”。wt1=cwt(T1(1:1100,1));wt2=cwt(T2(1:1100,1));wt3=cwt(T3(1:1100,1));wt4=cwt(T4(1:1100,1));p=[wt1 wt2 wt3 wt4];p=real(p);class=[ones(1100,1);ones(1100,1)*2;ones(1100,1)*3;ones(1100,1)*4];%创建BP网络%特征值归一化[input,minI,maxI] = premnmx(p) ;%构造输出矩阵s = length( class) ;output = zeros( s , 4 ) ;for i = 1 : soutput( i , class( i ) ) = 1 ;end%创建神经网络net = newff( minmax(input) , [10 4] ); %, { 'logsig' 'purelin' } , 'traingdx' ) ;%设置训练参数net.trainparam.show = 50 ;net.trainparam.epochs = 500 ;net.trainparam.goal = 0.03 ;net.trainParam.lr = 0.01 ;%开始训练net = train( net, input , output' ) ;disp('TRAIN OK.')save bpnet net;load bpnet%测试数据归一化testInput = tramnmx ( p, minI, maxI ) ;%仿真Y = sim( net , testInput ) ;%统计识别正确率[s1 , s2] = size( Y ) ;hitNum = 0 ;for i = 1 : s2[m , Index] = max( Y( : , i ) ) ;if( Index == class(i) )hitNum = hitNum + 1 ;endendfprintf('识别率是 %3.3f%%',100 * hitNum / s2 );%% 测试load T1_WRONG.matload bpnetwt1=cwt(T1_WRONG(1:1100,1));testInput = tramnmx (wt1, minI, maxI ) ;testInput=real(testInput);%仿真Y = sim( net , testInput ) ;%统计识别正确率[s1 , s2] = size( Y ) ;hitNum = 0 ;for i = 1 : s2[m , Index] = max( Y( : , i ) ) ;endif Index==1disp('故障T1');endif Index==2disp('故障T2');endif Index==3disp('故障T3');endif Index==4disp('故障T4');end
3 仿真结果



4 参考文献
[1]罗耀华, 从静. 基于BP神经网络的三相逆变器故障诊断研究[J]. 应用科技, 2010, 37(6):5.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
该文建立了一个三相桥式逆变电路的仿真模型,通过仿真模拟开关器件的开路故障。提出了一种基于BP神经网络的故障诊断方法,确定了网络结构和参数,并进行了训练。仿真结果显示,该神经网络在故障识别上表现出色,验证了所提出的故障诊断系统的可行性。
3448

被折叠的 条评论
为什么被折叠?



