您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 国内外标准规范 > 微机继电保护matlab算法仿真(有源程序)
微机继电保护算法仿真电控学院一.两点乘积算法仿真(1)matlab中编写的程序N=12;t=(0:0.02/N:0.02)';m=size(t);y=sin(2*pi*50*t);y1=[zeros(N/4,1);y(1:m-N/4)];ym=sqrt(y.^2+y1.^2);subplot(3,2,1)plot(t,y,'r.',t,y1,'xb');legend('y(k)','y(k-T/4)');title('两点乘积算法N=12');subplot(3,2,2)holdon;plot(t,ym,'-r');axis([0,0.02,0,1.2]);xlabel('t/s');ylabel('ym');title('两点乘积算法算的有效值N=12');text(0.01,0.6,'N=12');N=16;t=(0:0.02/N:0.02)';m=size(t);y=sin(2*pi*50*t);y1=[zeros(N/4,1);y(1:m-N/4)];ym=sqrt(y.^2+y1.^2);subplot(3,2,3)plot(t,y,'r.',t,y1,'xb');legend('y(k)','y(k-T/4)');title('两点乘积算法N=16');subplot(3,2,4)holdon;plot(t,ym,'-r');axis([0,0.02,0,1.2]);xlabel('t/s');ylabel('ym');title('两点乘积算法算的有效值N=16');text(0.01,0.6,'N=16');N=24;t=(0:0.02/N:0.02)';m=size(t);y=sin(2*pi*50*t);y1=[zeros(N/4,1);y(1:m-N/4)];ym=sqrt(y.^2+y1.^2);subplot(3,2,5)plot(t,y,'r.',t,y1,'xb');legend('y(k)','y(k-T/4)');title('两点乘积算法N=24');subplot(3,2,6)holdon;plot(t,ym,'-r');title('两点乘积算法算的有效值N=24');axis([0,0.02,0,1.2]);xlabel('t/s');ylabel('ym');text(0.01,0.6,'N=24');(2)仿真出的波形(3)流程图输入信号y=sin(2*pi*50*t)m=size(t);得到离散的两点y1=[zeros(N/4,1);y(1:m-N/4)]输出ym=sqrt(y.^2+y1.^2)N=12,即采样频率f=600HZ,原始信号离散化二.傅里叶算法仿真(1)matlab中编写的程序T=0.02;t1=0.02;N=12;Ts=T/N;t=0:Ts:4*T;y=(exp(-t/t1)-cos(2*pi*50*t));subplot(3,2,1);plot(t,y,'.r');xlabel('t/ms');ylabel('y(t)');title('输入信号N=12');a=1;i=1:N;bs=sin(2*pi*i/N);bc=cos(2*pi*i/N);ys=filter(bs,a,y);yc=filter(bc,a,y);ym=2*abs(complex(ys,yc))/N;subplot(3,2,2);holdonplot(t,ym)xlabel('t/ms');ylabel('ym');title('傅里叶算法计算的有效值N=12');holdonT=0.02;t1=0.02;N=16;Ts=T/N;t=0:Ts:4*T;y=(exp(-t/t1)-cos(2*pi*50*t));subplot(3,2,3);plot(t,y,'.r');xlabel('t/ms');ylabel('y(t)');title('输入信号N=16');a=1;i=1:N;bs=sin(2*pi*i/N);bc=cos(2*pi*i/N);ys=filter(bs,a,y);yc=filter(bc,a,y);ym=2*abs(complex(ys,yc))/N;subplot(3,2,4);plot(t,ym)xlabel('t/ms');ylabel('ym');title('傅里叶算法计算的有效值N=16');T=0.02;t1=0.02;holdonN=24;Ts=T/N;t=0:Ts:4*T;y=(exp(-t/t1)-cos(2*pi*50*t));subplot(3,2,5);plot(t,y,'.r');xlabel('t/ms');ylabel('y(t)');title('输入信号N=24');a=1;i=1:N;bs=sin(2*pi*i/N);bc=cos(2*pi*i/N);ys=filter(bs,a,y);yc=filter(bc,a,y);ym=2*abs(complex(ys,yc))/N;subplot(3,2,6);plot(t,ym)xlabel('t/ms');ylabel('ym');title('傅里叶算法计算的有效值N=24');(2)仿真出的波形(3)流N即每周波的采样点数,原始信号离散化输入信号y=(exp(-t/t1)-cos(2*pi*50*t))bs=sin(2*pi*i/N);bc=cos(2*pi*i/N);ys=filter(bs,a,y);yc=filter(bc,a,y);输出ym=2*abs(complex(ys,yc))/N
本文标题:微机继电保护matlab算法仿真(有源程序)
链接地址:https://www.777doc.com/doc-5576174 .html