📄 vecmoviea.m
字号:
% MOVIE OF SPACE VECTORS in AC MACHINES
clc,clear,close all
disp(date)
info= ...
[' SPACE VECTORS IN 3-PHASE AC MACHINES '
' This demo animates the motion of pulsating and '
' traveling waves in AC machines. They show the '
' sinusoidal space distributions of magnetic fields '
' in the air gap represented by space vectors. '
' A movie can also be run under Windows Media Player '
' by activating "vecmovieA.avi" just created. '
' '];
disp(info)
warning off
%
aviwave=avifile('vecmovieA.avi');
dphi=pi/24;alpha=2*pi/3;phi=dphi;
%
figure('units','normalized','Position',[.36 .09 .62 .73],'Name','WAVES ',...
'NumberTitle','off');
set(gcf,'color',[.9 .9 .9])
%
for k=1:48
fa=cos(phi); fb=cos(phi-alpha);fc=cos(phi+alpha);
FAx=fa; FAy=0;
FBx=fb*cos(alpha); FBy=fb*sin(alpha);
FCx=fc*cos(alpha); FCy=-fc*sin(alpha);
FRx=FAx+FBx+FCx; FRy=FAy+FBy+FCy;
%
plot(0,0,'xk',[0 FAx],[0 FAy],'-r',FAx,FAy,'xr','LineWidth',1.5),hold on
set(gca,'Xlim',[-2 2],'Ylim',[-2 2],'visible','off')
axis square
plot([0 1.2],[0 0],'--k','LineWidth',1)
plot([0 -0.6],[0 0.6*sqrt(3)],'--k','LineWidth',1)
plot([0 -0.6],[0 -0.6*sqrt(3)],'--k','LineWidth',1)
plot(0,0,'xk',[0 FBx],[0 FBy],'-g',FBx,FBy,'xg','LineWidth',1.5)
plot(0,0,'xk',[0 FCx],[0 FCy],'-b',FCx,FCy,'xb','LineWidth',1.5)
plot(0,0,'xk',[0 FRx],[0 FRy],'-k',FRx,FRy,'ok','LineWidth',1.5)
title('SPACE VECTORS')
text(1.56,0,'A-axis','color','k')
text(-0.9,1.1,'B-axis','color','k')
text(-0.9,-1.1,'C-axis','color','k')
%text(-0.49,1.8,'SPACE VECTORS','Color','red')
text(1.4,-1.4,'Phase A','Color','red')
text(1.4,-1.55,'Phase B','Color','green')
text(1.4,-1.7,'Phase C','Color','blue')
text(1.4,-1.85,'Resultant','Color','black')
hold off
%
f=getframe(gca);
aviwave=addframe(aviwave,f);
phi=phi+dphi;
%M1(k)=getframe;
end
aviwave=close(aviwave);
%movie(M1,5)
%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -