📄 im_field1.m
字号:
%rotating sinusoidal winding and air gap flux density distribution
close all,clear,clc
disp(date)
info= ...
[' SINGLE-PHASE SINUSOIDALLY DISTRIBUTED WINDING '
'A sinusoidally distributed winding is excited with a sinusoidal current. '
'The resulting pulsating radial field distribution is shown plotted along a circular '
'path in the air gap (which is greatly enlarged for visual purposes). '
'The space vector representation of this sinusoidal distribution is shown as a vector'
'pointing to where the field is maximum positive (along the horizontal axis) and of '
'length proportional to the maximum field strength at that moment. '
' '];
disp(info)
n=7;ra=1.55;z=0;
q=0:pi/80:2*pi;
warning off
aviwave=avifile('im_field1.avi','compression','cinepak');
%Phase A
alpha=0 ; e=0;ar='r';
%Phase B:
%alpha=2*pi/3; e=120;ar='g';
%Phase C:
%alpha=-2*pi/3;e=-120;ar='b';
figure('units','normalized','Position',[.25 .2 .50 .50],'Name','Field distribution due to sinusoidal winding',...
'NumberTitle','off');
theta0=(0:10:360)*pi/180;
theta=theta0-alpha;
for beta=(0:2:358)*pi/180;
z=z+1;
p=cos(beta-alpha);
w=abs(p);
%if p>0 ,cot=[1 0 0];cob=[1 0 1]; else cot=[1 0 1];cob=[1 0 0];end
u=cos(theta).*cos(theta);
v=cos(theta).*sin(theta);
x=cos(theta); y=sin(theta); set(gcf,'color','w')
fill(1.85*cos(q),1.85*sin(q),[.6 .6 .6],'LineWidth',1.0);hold on
fill(1.25*cos(q),1.25*sin(q),[.95 .98 .95]);
fill(.75*cos(q),.75*sin(q),[.6 .6 .6]);
plot(x,y,'y');
h0=quiver(x,y,u,v,.6*p,'g');
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',8,'MarkerFacecolor',w*cot);
plot(x1,y1,'ro','MarkerSize',12,'MarkerEdgeColor','k','MarkerFacecolor','w')
plot(x1,y1,'ro','MarkerSize',w*10,'MarkerFacecolor','r')
if p>0
plot(x1,y1,'k.','MarkerSize',7)
else
plot(x1,y1,'kx','MarkerSize',6)
end
%rotate(h1,[0 0 1],e,[0 0 0])
fill(.75*cos(q),.75*sin(q),[.9 .9 .9]);
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',8,'MarkerFacecolor',w*cob);
plot(x,y,'ro','MarkerSize',12,'MarkerEdgeColor','k','MarkerFacecolor','w')
plot(x,y,'ro','MarkerSize',w*10,'MarkerFacecolor','r')
if p>0
plot(x,y,'kx','MarkerSize',6)
else
plot(x,y,'k.','MarkerSize',7)
end
% rotate(h2,[0 0 1],e,[0 0 0])
end
g1=plot(ra,0,'wo','MarkerSize',12,'MarkerFacecolor','w');
rotate(g1,[0 0 1],e,[0 0 0])
g2=plot(-ra,0,'wo','MarkerSize',12,'MarkerFacecolor','w');
rotate(g2,[0 0 1],e,[0 0 0])
fill(.75*cos(q),.75*sin(q),[.6 .6 .6]);
g3=compass(2*p,0,ar);
rotate(g3,[0 0 1],e,[0 0 0])
set(findobj(gca,'Type','line'),'LineWidth',1.5)
text(-1.7,1.97,'SINUSOIDALLY DISTRIBUTED WINDING','FontSize',12,'FontWeight','bold','color','blue')
text(-1.26,-1.97,'MAGNETIC FIELD DISTRIBUTIONS','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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -