资源描述:
《微机继电保护matlab算法仿真(有源程序).doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、微机继电保护算法仿真电控学院一.两点乘积算法仿真(1)matlab中编写的程序N=12;title('两点乘积算法N=16');t=(0:0.02/N:0.02)';subplot(3,2,4)m=size(t);holdon;y=sin(2*pi*50*t);plot(t,ym,'-r');y1=[zeros(N/4,1);y(1:m-N/4)];axis([0,0.02,0,1.2]);ym=sqrt(y.^2+y1.^2);xlabel('t/s');subplot(3,2,1)ylabel('ym')
2、;plot(t,y,'r.',t,y1,'xb');title('两点乘积算法算的有效值N=16');legend('y(k)','y(k-T/4)');text(0.01,0.6,'N=16');title('两点乘积算法N=12');N=24;subplot(3,2,2)t=(0:0.02/N:0.02)';holdon;m=size(t);plot(t,ym,'-r');y=sin(2*pi*50*t);axis([0,0.02,0,1.2]);y1=[zeros(N/4,1);y(1:m-N/4)];
3、xlabel('t/s');ym=sqrt(y.^2+y1.^2);ylabel('ym');subplot(3,2,5)title('两点乘积算法算的有效值N=12');plot(t,y,'r.',t,y1,'xb');text(0.01,0.6,'N=12');legend('y(k)','y(k-T/4)');N=16;title('两点乘积算法N=24');t=(0:0.02/N:0.02)';subplot(3,2,6)m=size(t);holdon;y=sin(2*pi*50*t);plot(t
4、,ym,'-r');y1=[zeros(N/4,1);y(1:m-N/4)];title('两点乘积算法算的有效值N=24');ym=sqrt(y.^2+y1.^2);axis([0,0.02,0,1.2]);subplot(3,2,3)xlabel('t/s');plot(t,y,'r.',t,y1,'xb');ylabel('ym');legend('y(k)','y(k-T/4)');text(0.01,0.6,'N=24');(2)仿真出的波形输入信号y=sin(2*pi*50*t)(3)流程图N=1
5、2,即采样频率f=600HZ,原始信号离散化m=size(t);得到离散的两点y1=[zeros(N/4,1);y(1:m-N/4)]输出ym=sqrt(y.^2+y1.^2)二.傅里叶算法仿真(1)matlab中编写的程序T=0.02;i=1:N;t1=0.02;bs=sin(2*pi*i/N);N=12;bc=cos(2*pi*i/N);Ts=T/N;ys=filter(bs,a,y);t=0:Ts:4*T;yc=filter(bc,a,y);y=(exp(-t/t1)-cos(2*pi*50*t));y
6、m=2*abs(complex(ys,yc))/N;subplot(3,2,1);subplot(3,2,4);plot(t,y,'.r');plot(t,ym)xlabel('t/ms');xlabel('t/ms');ylabel('y(t)');ylabel('ym');title('输入信号N=12');title('傅里叶算法计算的有效值N=16');a=1;T=0.02;i=1:N;t1=0.02;bs=sin(2*pi*i/N);holdonbc=cos(2*pi*i/N);N=24;ys=fi
7、lter(bs,a,y);Ts=T/N;yc=filter(bc,a,y);t=0:Ts:4*T;ym=2*abs(complex(ys,yc))/N;y=(exp(-t/t1)-cos(2*pi*50*t));subplot(3,2,2);subplot(3,2,5);holdonplot(t,y,'.r');plot(t,ym)xlabel('t/ms');xlabel('t/ms');ylabel('y(t)');ylabel('ym');title('输入信号N=24');title('傅里叶算法计算
8、的有效值N=12');a=1;holdoni=1:N;T=0.02;bs=sin(2*pi*i/N);t1=0.02;bc=cos(2*pi*i/N);N=16;ys=filter(bs,a,y);Ts=T/N;yc=filter(bc,a,y);t=0:Ts:4*T;ym=2*abs(complex(ys,yc))/N;y=(exp(-t/t1)-cos(2*pi*50*t));subplot(3