📄 disturbance.asv
字号:
%本程序目的在于产生几种扰动信号
%%%%%%%%%电压突降sag
t=0:300;
w0=100*pi;
t1=64;t2=160;
y1=stepfun(t,t1);y2=stepfun(t,t2);
y3=y1-y2;
y=(1-0.6*y3).*sin(w0*0.000625*t);
subplot(4,2,1);
plot(t,y)
title('电压突降')
%%%%%%%%%%电压突升swell
t=0:300;
w0=100*pi;
t1=64;t2=160;
y1=stepfun(t,t1);y2=stepfun(t,t2);
y3=y1-y2;
y=(1+0.8*y3).*sin(w0*0.000625*t);
subplot(4,2,3)
plot(t,y)
title('电压突升')
%%%%%%%%%%%%%电压中断interruption
t=0:300;
w0=100*pi;
t1=64;t2=160;
y1=stepfun(t,t1);y2=stepfun(t,t2);
y3=y1-y2;
y=(1-0.9756*y3).*sin(w0*0.000625*t);
subplot(4,2,5)
plot(t,y)
title('电压中断')
%振荡暂态oscillatory transients
t=0:300;
w0=100*pi;
t1=74;t2=120;
y1=stepfun(t,t1);y2=stepfun(t,t2);
y3=y1-y2;
A=0.7;c=8;a=12;
y=sin(w0*0.000625*t)+A*exp(-c*(t-t1)).*sin(a*w0*0.000625*t).*y3;
subplot(4,2,2);
plot(t,y)
title('振荡暂态')
%谐波hamonics
t=0:300;
w0=100*pi;
y=sin(w0*0.000625*t)+0.03*sin(3*w0*0.000625*t)+0.5*sin(5*w0*0.000625*t)+0.07*sin(7*w0*0.000625*t);
subplot(4,2,4);
plot(t,y)
title('谐波')
%电压尖峰spike
t=0:300;
w0=100*pi;
t1=74;t2=120;
%s=0;
%for n=0:8
% tt1=t1+n*1;
%tt2=t2+n*1;
%s(1,n)=0.2*(stepfun(t,tt1)-stepfun(t,tt2))
%s=s(1,n)+s;
%end
y=sin(w0*0.000625*t)+sign(sin(w0*0.000625*t));%%?????????
subplot(4,2,6);
plot(t,y)
title('电压尖峰')
%电压缺口notch
t=0:300;
w0=100*pi;
t1=74;t2=120;
y=sin(w0*0.000625*t)-sign(sin(w0*0.000625*t));
subplot(4,2,8);
plot(t,y)
title('电压缺口')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -