im_flux3.m
来自「关于电机的.m程序」· M 代码 · 共 81 行
M
81 行
%rotating sinusoidal winding and air gap flux density distribution
close all,clear,clc
n=11;n1=19;ra=1.4;rb=1.3;rc=1.0;e=0;z=0;
q=0:pi/80:2*pi;
theta=(0:10:360)*pi/180;
warning off
aviwave=avifile('im_flux3.avi','compression','cinepak');
for e=0:1.5:358.5
z=z+1;
u=cos(theta).*cos(theta);
v=cos(theta).*sin(theta);
x=cos(theta); y=sin(theta);
set(gcf,'color','w')
fill(1.8*cos(q),1.8*sin(q),[.7 .7 .7],'LineWidth',1.0);hold on
fill(rb*cos(q),rb*sin(q),[.95 .98 .95]);
%fill(rc*cos(q),rc*sin(q),[.9 .9 .9]);
%plot(x,y,'y');
%h0=quiver(x,y,u,v,.6,'r');
%rotate(h0,[0 0 1],e,[0 0 0])
for k=1:1:2*n-1
alfa=acos((n-k)/(n-1));
x1=ra*cos(alfa); y1=ra*sin(alfa);
h1=plot(x1,y1,'o','MarkerSize',6,'MarkerFacecolor','r');
rotate(h1,[0 0 1],e,[0 0 0])
end
for j=1:1:2*n-1
alfa=acos((n-j)/(n-1));
x=ra*cos(alfa); y=-ra*sin(alfa);
h2=plot(x,y,'o','MarkerSize',6,'MarkerFacecolor','m');
rotate(h2,[0 0 1],e,[0 0 0])
end
g1=plot(ra,0,'o','MarkerSize',6,'MarkerFacecolor','w');
rotate(g1,[0 0 1],e,[0 0 0])
g2=plot(-ra,0,'o','MarkerSize',6,'MarkerFacecolor','w');
rotate(g2,[0 0 1],e,[0 0 0])
for k=2:1:2*n1-2
alfa=acos((n1-k)/(n1-1));
x1=rb*cos(alfa); y1=rb*sin(alfa);
h1=plot([0 x1],[0 y1],'g');
rotate(h1,[0 0 1],e+90,[0 0 0])
fill(rc*cos(q),rc*sin(q),[.7 .7 .7]);
end
for j=2:1:2*n1-2
alfa=acos((n1-j)/(n1-1));
x=rb*cos(alfa); y=-rb*sin(alfa);
h2=plot([0 x],[0 y],'g');
rotate(h2,[0 0 1],e+90,[0 0 0])
fill(rc*cos(q),rc*sin(q),[.7 .7 .7]);
end
g3=plot(0,0,'xr',[0 1.9 1.85 1.9 1.85],[0 0 .04 0 -.04],'-k','LineWidth',2);
rotate(g3,[0 0 1],e,[0 0 0])
text(-1.55,1.97,'ROTATING SINUSOIDAL WINDING','FontSize',12,'FontWeight','bold','color','blue')
text(-0.84,-1.97,'AIR GAP FLUX PLOT','FontSize',10,'FontWeight','bold','color','blue')
axis square;
set(gca,'Xlim',[-2.1 2.1],'Ylim',[-2.1 2.1],'visible','off')
hold off
M(z)=getframe;
g=getframe(gca);
aviwave=addframe(aviwave,g);
end
aviwave=close(aviwave);
uicontrol('Units','normalized', ...
'Style','PushButton',...
'BackgroundColor',[.2 .3 .8], ...
'Callback','movie(M,.5)', ...
'FontSize',10, ...
'FontWeight','bold', ...
'ForegroundColor',[1 1 1], ...
'Position',[0.35 0.03 0.10 .05], ...
'String','Repeat', ...
'TooltipString','Repeat');
uicontrol('Units','normalized', ...
'Style','PushButton',...
'BackgroundColor',[.2 .3 .8], ...
'Callback','close,clear,close all', ...
'FontSize',10, ...
'FontWeight','bold', ...
'ForegroundColor',[1 1 1], ...
'Position',[0.6 0.03 0.09 .05], ...
'String','Quit', ...
'TooltipString','Quit');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?