您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 国内外标准规范 > 自适应微机继电保护的matlab仿真实现-程序与算法
附录详细计算算法:clc;Zl=0.4;L3=6;L2=6;L1=4;Krel1=1.3;Krel2=1.1;Krel3=1.2;Kss=2;Kre=0.85;Kta=120;ILmax=0;%系统参数的给定i=0;Ifa=0;Ifb=0;Ifc=0;while(i<513)i=i+1;Ifa=Ifa+CT3(i,2)*CT3(i,2);Ifb=Ifb+CT3(i,3)*CT3(i,3);Ifc=Ifc+CT3(i,4)*CT3(i,4);endIfa=sqrt(Ifa/512);Ifb=sqrt(Ifb/512);Ifc=sqrt(Ifc/512);ILmax=(Ifa+Ifb+Ifc)*120/3;%负荷电流的计算i=1;Q=0.1*10000/(1.732*120);m=0;n=0;while(m<512)i=i+1;ifabs(PT3(i,2))<Q||abs(PT3(i,3))<Qm=m+1;endifi>2560disp('系统正常运行');break;endn=i;end%算法启动判据:电压持续低于10%系统电压i=1;Ia2=0;Va2=0;Ib2=0;Vb2=0;Ic2=0;Vc2=0;while(i<513)i=i+1;Ia2=Ia2+CT2(i,2)*CT2(i,2);Va2=Va2+PT2(i,2)*PT2(i,2);Ib2=Ib2+CT2(i,3)*CT2(i,3);Vb2=Vb2+PT2(i,3)*PT2(i,3);Ic2=Ic2+CT2(i,4)*CT2(i,4);Vc2=Vc2+PT2(i,4)*PT2(i,4);endIa2=sqrt(Ia2/512);Va2=sqrt(Va2/512);Zsa2=Va2/Ia2;Ib2=sqrt(Ib2/512);Vb2=sqrt(Vb2/512);Zsb2=Vb2/Ib2;Ic2=sqrt(Ic2/512);Vc2=sqrt(Vc2/512);Zsc2=Vc2/Ic2;Zs2=(Zsa2+Zsb2+Zsc2)/3;%保护二的系统等效阻抗计算i=1;Ia1=0;Va1=0;Ib1=0;Vb1=0;Ic1=0;Vc1=0;while(i<513)i=i+1;Ia1=Ia1+CT1(i,2)*CT1(i,2);Va1=Va1+PT1(i,2)*PT1(i,2);Ib1=Ib1+CT1(i,3)*CT1(i,3);Vb1=Vb1+PT1(i,3)*PT1(i,3);Ic1=Ic1+CT1(i,4)*CT1(i,4);Vc1=Vc1+PT1(i,4)*PT1(i,4);endIa1=sqrt(Ia1/512);Va1=sqrt(Va1/512);Zsa1=Va1/Ia1;Ib1=sqrt(Ib1/512);Vb1=sqrt(Vb1/512);Zsb1=Vb1/Ib1;Ic1=sqrt(Ic1/512);Vc1=sqrt(Vc1/512);Zsc1=Vc1/Ic1;Zs1=(Zsa1+Zsb1+Zsc1)/3;%保护一的系统等效阻抗计算i=n;Ia=0;Ib=0;Ic=0;while(i<n+513)i=i+1;Ia=Ia+S1(i,2)*S1(i,2);Ib=Ib+S1(i,3)*S1(i,3);Ic=Ic+S1(i,4)*S1(i,4);endIa=sqrt(Ia/512);Ib=sqrt(Ib/512);Ic=sqrt(Ic/512);alph2=acos((Ia^2+Ib^2-Ic^2)/(2*Ia*Ib+eps));alph1=acos((Ia^2-Ib^2+Ic^2)/(2*Ia*Ic+eps));th1=pi+alph2;th2=pi-alph1;ia=Ia;ib=Ib*exp(j*th1);ic=Ic*exp(j*th2);a=exp(j*2*pi/3);I2=(ia+a^2*ib+a*ic)/3;r2=abs(I2);if(r2<50)Kd=1;elseif(r2>100)Kd=0.866;%基于负序电流判断故障类型endi=n;ma=1;mb=1;mc=1;%短路相识别标志初始化Vfa1=0;Vfb1=0;Vfc1=0;while(i<n+513)i=i+1;Vfa1=Vfa1+PT3(i,2)*PT3(i,2);Vfb1=Vfb1+PT3(i,3)*PT3(i,3);Vfc1=Vfc1+PT3(i,4)*PT3(i,4);endVfa1=sqrt(Vfa1/512);Vfb1=sqrt(Vfb1/512);Vfc1=sqrt(Vfc1/512);ifKd==0.866ifVfa1<20&Vfb1<20ma=0;mb=0;disp('AB两相短路');endifVfa1<20&Vfc1<20ma=0;mc=0;disp('AC两相短路');endifVfb1<20&Vfc1<20mb=0;mc=0;disp('BC两相短路');endendifKd==1ma=0;mb=0;mc=0;disp('三相短路');end%具体短路相的判断i=n;Ia2b=0;Ib2b=0;Ic2b=0;while(i<n+513)i=i+1;Ia2b=Ia2b+CT1(i,2)*CT1(i,2);Ib2b=Ib2b+CT1(i,3)*CT1(i,3);Ic2b=Ic2b+CT1(i,4)*CT1(i,4);endIa2b=sqrt(Ia2b/512);Ib2b=sqrt(Ib2b/512);Ic2b=sqrt(Ic2b/512);i=n;Va2b=0;Vb2b=0;Vc2b=0;while(i<n+513)i=i+1;Va2b=Va2b+PT1(i,2)*PT1(i,2);Vb2b=Vb2b+PT1(i,3)*PT1(i,3);Vc2b=Vc2b+PT1(i,4)*PT1(i,4);endVa2b=sqrt(Va2b/512);Vb2b=sqrt(Vb2b/512);Vc2b=sqrt(Vc2b/512);i=n;Ia3b=0;Ib3b=0;Ic3b=0;while(i<n+513)i=i+1;Ia3b=Ia3b+CT2(i,2)*CT2(i,2);Ib3b=Ib3b+CT2(i,3)*CT2(i,3);Ic3b=Ic3b+CT2(i,4)*CT2(i,4);endIa3b=sqrt(Ia3b/512);Ib3b=sqrt(Ib3b/512);Ic3b=sqrt(Ic3b/512);i=n;Va3b=0;Vb3b=0;Vc3b=0;while(i<n+513)i=i+1;Va3b=Va3b+PT2(i,2)*PT2(i,2);Vb3b=Vb3b+PT2(i,3)*PT2(i,3);Vc3b=Vc3b+PT2(i,4)*PT2(i,4);endVa3b=sqrt(Va3b/512);Vb3b=sqrt(Vb3b/512);Vc3b=sqrt(Vc3b/512);%保护一、保护二互感器采样值的计算Mf=0;MI=0;MII=0;if(ma==0)ifVfa1<10&Va3b>18Mf=1;endifVfa1<10&Va2b>18&Va3b<10MII=1;endifVfa1<10&Va2b<10&Va3b<10MI=1;endendif(mb==0)ifVfb1<10&Vb3b>18Mf=1;endifVfb1<10&Vb2b>18&Vb3b<10MII=1;endifVfb1<10&Vb2b<10&Vb3b<10MI=1;endendifMf==1disp('负荷段短路');endifMII==1disp('保护二区间短路');endifMI==1disp('保护一区间短路');end%故障区间的判断Id2=Krel1*Kd*1.05*10000/(1.732*(Zs2+L3*Zl));Id2J=Id2/Kta;%保护二的I段整定Id11=Krel1*Kd*1.05*10000/(1.732*(Zs1+L2*Zl));Id11J=Id11/Kta;%保护一的I段整定Id12=Krel2*Kd*1.05*10000/(1.732*(Zs1+L2*Zl+L3*Zl));Id12J=Id12/Kta;%保护一的II段整定Id13=Krel3*Kss*ILmax/Kre;Id13J=Id13/Kta;%保护一的III段整定fprintf('Id2=%.2fId2J=%.2f\n',Id2,Id2J);fprintf('Id11=%.2fId11J=%.2f\n',Id11,Id11J);fprintf('Id12=%.2fId12J=%.2f\n',Id12,Id12J);fprintf('Id13=%.2fId13J=%.2f\n',Id13,Id13J);if(Ia2b>Id11J||Ib2b>Id11J||Ic2b>Id11J)&MI==1DL1=0;elseDL1=1;end%保护一出断路器动作信号判断fprintf('DL1=%.0f\n',DL1);if((Ia3b>Id2J||Ib3b>Id2J||Ic3b>Id2J)&DL1==1||DL1==0)DL2=0;elseDL2=1;end%保护二处断路器动作信号判断fprintf('DL2=%.0f\n',DL2);
本文标题:自适应微机继电保护的matlab仿真实现-程序与算法
链接地址:https://www.777doc.com/doc-6495257 .html