⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imwavesb.m

📁 关于电机的.m程序
💻 M
字号:
%    MOVIE OF SPACE VECTORS in AC MACHINES

warning off
aviwave=avifile('imwaves.avi','compression','cinepak');
phis=0;phir=0;phim=0;dphi=pi/24;g=pi/6;
n=eval(get(h2,'string'));
%
      figure('units','normalized','Position',[.38 .09 .6 .73],'Name','ROTATING SPACE VECTORS',...
        'NumberTitle','off');
      set(gcf,'color','w')   
    for k=1:96
          
      fas=cos(phis);fbs=sin(phis);
      far=0.7*cos(phir-g);fbr=0.7*sin(phir-g);
      fam=.5*cos(phim);fbm=.5*sin(phim);
      faR=far*cos(phim)-fbr*sin(phim);
      fbR=far*sin(phim)+fbr*cos(phim);
      faS=fas*cos(phim)+fbs*sin(phim);
      fbS=-fas*sin(phim)+fbs*cos(phim);
      
      q=0:pi/20:2*pi;
      fill(.9*cos(q),0.9*sin(q),[.86 .86 .86]),hold on
      fill(.62*cos(q),0.62*sin(q),'w')
      fill(.58*cos(q),0.58*sin(q),[.86 .86 .86])
     
      t0={'SPACE VECTORS in SINUSOIDAL STEADY STATE';'VIEWED IN THREE REFERENCE FRAMES'};
      t1='SPEED OF VECTORS x:' ;
      t2='    Stator frame  1.0';
      t5=['    Shaft  speed  ',num2str(n)]; 
      t3=['    Rotor  frame  ',num2str(1-n)]; 
      t4='    Synchronous    0'; 
      
      plot(0,0,'xk',[0 fas],[0 fbs],'-b',fas,fbs,'xb','MarkerSize',10,'LineWidth',1.5)
      plot(0,0,'xk',[0 far],[0 fbr],'-g',far,fbr,'xg','MarkerSize',10,'LineWidth',1.5)
      plot(0,0,'xk',[0 faR],[0 fbR],'-g',faR,fbR,'xb','MarkerSize',10,'LineWidth',1.5)
      plot(0,0,'xk',[0 faS],[0 fbS],'-b',faS,fbS,'xg','MarkerSize',10,'LineWidth',1.5)
      plot(0,0,'xk',[0 1],[0 0],'-b',1,0,'xk','MarkerSize',10,'LineWidth',1.5)
      plot(0,0,'xk',[0 0.7*cos(g)],[0 -0.7*sin(g)],'-g',0.7*cos(g),-0.7*sin(g),'xk','MarkerSize',10,'LineWidth',1.5)
      plot(fam,fbm,'ro','MarkerSize',12,'MarkerEdgeColor','k','MarkerFacecolor','r')
      
      text(.64,-.8,t1,'FontSize',8,'FontWeight','bold','color','k')
      text(.6,-0.9,t2,'color','b')
      text(.6,-1.0,t3,'color','g')
      text(.6,-1.1,t4,'color','k')
      text(.6,-1.2,t5,'color','r')
      text(0,1.1,t0,'FontSize',14,'FontWeight','bold','ver','middle','hor','center','color','blue')
      
      set(gca,'Xlim',[-1.3 1.3],'Ylim',[-1.3 1.3],'visible','off')
      axis square
      hold off
      %          
      f=getframe(gca);
      aviwave=addframe(aviwave,f);
      phis=phis+dphi;
      phir=(1-n)*phis;
      phim=n*phis;
      M(k)=getframe;
  end
  aviwave=close(aviwave);
  uicontrol('Units','normalized', ...
   'Style','PushButton',...
	'BackgroundColor',[.2 .3 .8], ...
	'Callback','movie(M,1)', ...
	'FontSize',10, ...
	'FontWeight','bold', ...
	'ForegroundColor',[1 1 1], ...
	'Position',[0.24 0.15 0.09 .06], ...
	'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.50 0.15 0.09 .06], ...
	'String','Quit', ...
    'TooltipString','Quit');
     %

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -