資源描述:
《微機(jī)繼電保護(hù)matlab算法仿真(有源程序).doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、微機(jī)繼電保護(hù)算法仿真電控學(xué)院一.兩點(diǎn)乘積算法仿真(1)matlab中編寫的程序N=12;title('兩點(diǎn)乘積算法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('兩點(diǎn)乘積算法算的有效值N=16');legend('y(k)','y(k-T/4)');text(0.01,0.6,'N=16');title('兩點(diǎn)乘積算法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('兩點(diǎn)乘積算法算的有效值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('兩點(diǎn)乘積算法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('兩點(diǎn)乘積算法算的有效值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)仿真出的波形輸入信號(hào)y=sin(2*pi*50*t)(3)流程圖N=1
5、2,即采樣頻率f=600HZ,原始信號(hào)離散化m=size(t);得到離散的兩點(diǎn)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('輸入信號(hào)N=12');title('傅里葉算法計(jì)算的有效值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('輸入信號(hào)N=24');title('傅里葉算法計(jì)算
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