📄 apf.m
字号:
t=linspace(0,0.1,641);
w=2*pi*50;
ia=sin(w*t)+sin(5*w*t);
ib=sin(w*t-2*pi/3)+sin(5*w*t+2*pi/3);
ic=sin(w*t+2*pi/3)+sin(5*w*t-2*pi/3);
% plot(t,ia);
% plot(t,ib);
% plot(t,ic);
% id=zeros(1,128);
% iq=zeros(1,128);
% i0=zeros(1,128);
id=0.6667*(ia.*cos(w*t)+ib.*cos(w*t-(2*pi/3))+ic.*cos(w*t+(2*pi/3)));
iq=0.6667*(ia.*(-sin(w*t))+ib.*(-sin(w*t-2*pi/3))+ic.*(-sin(w*t+2*pi/3)));
i0=(ia+ib+ic)/3;
id1=zeros(1,641);
iq1=zeros(1,641);
i01=zeros(1,641);
for i=3:1:641;
id1(i)=0.000095060029449*(id(i)+2*id(i-1)+id(i-2))+1.972233729195266*id1(i-1)-0.972613969313063*id1(i-2);
iq1(i)=0.000095060029449*(iq(i)+2*id(i-1)+iq(i-2))+1.972233729195266*iq1(i-1)-0.972613969313063*iq1(i-2);
i01(i)=0.000095060029449*(i0(i)+2*id(i-1)+i0(i-2))+1.972233729195266*i01(i-1)-0.972613969313063*i01(i-2);
end
% id1=id;
% iq1=iq;
% i01=i0;
iaf=2*(id1.*cos(w*t)+iq1.*(-sin(w*t))+0.5*i01);
ibf=2*(id1.*cos(w*t-2*pi/3)+iq1.*(-sin(w*t-2*pi/3))+0.5*i01);
icf=2*(id1.*cos(w*t+2*pi/3)+iq1.*(-sin(w*t+2*pi/3))+0.5*i01);
subplot(4,3,1);
plot(t,ia);
subplot(4,3,2);
plot(t,ib);
subplot(4,3,3);
plot(t,ic);
subplot(4,3,4);
plot(t,iaf);
subplot(4,3,5);
plot(t,ibf);
subplot(4,3,6);
plot(t,icf);
subplot(4,3,7);
plot(t,id);
subplot(4,3,8);
plot(t,id1);
subplot(4,3,9);
plot(t,iq);
subplot(4,3,10);
plot(t,iq1);
subplot(4,3,11);
plot(t,i0)
subplot(4,3,12);
plot(t,i01);
% % y4=zeros(1,128);
% %
% y4(1)=0;
% y4(2)=0;
% for i=1:1:126;
% y4(i+2)=(y3(i)+2*y3(i+1)+y3(i+2)-y4(i)-1.28*y4(i+1))/0.48;
% end
% y4
% plot(t,y4)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -