📄 smphasor1.m
字号:
% creates figure for SM phasors
clear,clc,close all
h0=figure('Units','normalized', ...
'Color',[0.8 0.8 0.8], ...
'Name','Round Rotor Synchronous Machine',...
'NumberTitle','off',...
'Position',[.52 .07 .45 .75], ...
'ToolBar','none');
uicontrol('Units','normalized', ...
'BackgroundColor',[0.76 0.76 0.76], ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.6], ...
'HorizontalAlignment','left', ...
'Position',[0.05 0.8 0.3 0.04], ...
'String','Terminal voltage V =', ...
'Style','text');
hV=uicontrol('Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'Position',[0.35 .8 .13 .04], ...
'String','1.0', ...
'Style','edit', ...
'TooltipString',' V');
uicontrol( 'Units','normalized', ...
'BackgroundColor',[0.76 0.76 0.76], ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.6], ...
'HorizontalAlignment','left', ...
'Position',[0.05 0.7 0.3 0.04], ...
'String','Internal voltage E =', ...
'Style','text');
hE=uicontrol( 'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'Position',[0.35 .7 .13 .04], ...
'String','1.8', ...
'Style','edit', ...
'TooltipString','E');
uicontrol('Units','normalized', ...
'BackgroundColor',[0.76 0.76 0.76], ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.6], ...
'HorizontalAlignment','left', ...
'Position',[0.05 0.6 0.3 0.045], ...
'String','Reactance X =', ...
'Style','text');
hX=uicontrol('Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'Position',[0.35 .6 .13 .04], ...
'String','1.0', ...
'Style','edit', ...
'TooltipString','X');
uicontrol('Units','normalized', ...
'BackgroundColor',[0.76 0.76 0.76], ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.6], ...
'HorizontalAlignment','left', ...
'Position',[0.05 0.5 0.3 0.045], ...
'String','Power input P =', ...
'Style','text');
hP=uicontrol('Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'Position',[0.35 .5 .13 .04], ...
'String','-1.0', ...
'Style','edit', ...
'TooltipString','P');
uicontrol( 'Units','normalized', ...
'ForegroundColor',[0 0 0.82], ...
'Fontsize',10, ...
'FontWeight','bold', ...
'HorizontalAlignment','left', ...
'Position',[0.17 0.32 0.25 0.06], ...
'String','P>0 for motor P<0 for generator', ...
'Style','text');
uicontrol('Units','normalized', ...
'Callback','smphasor2', ...
'FontSize',12, ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.5], ...
'Position',[0.14 0.15 0.3 0.10], ...
'String','Phasor diagram', ...
'TooltipString','phasors');
uicontrol('Units','normalized', ...
'Callback','clc,clear, close all', ...
'FontSize',12, ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.5], ...
'Position',[0.64 0.15 0.18 0.1], ...
'String','Quit', ...
'TooltipString','Quit');
uicontrol('Units','normalized', ...
'BackgroundColor',[0.75 0.75 0.75], ...
'FontSize',14, ...
'FontWeight','bold', ...
'ForegroundColor',[1 0 0], ...
'Position',[0.1 0.95 0.8 0.04], ...
'String','Round Rotor Synchronous Machine', ...
'Style','text');
uicontrol('Units','normalized', ...
'FontSize',10, ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.82], ...
'Position',[0.06 0.87 0.31 0.06], ...
'String','Enter parameter values in per unit:', ...
'Style','text');
uicontrol('Units','normalized', ...
'FontSize',11, ...
'FontWeight','bold', ...
'ForegroundColor',[0 0 0.82], ...
'Position',[0.6 0.5 0.25 0.06], ...
'String','Equivalent circuit', ...
'Style','text');
% Equivalent circuit
X1=[0.3 .3 .7 .7] ; Y1=[.6 .5 .5 .6];
X2=[0 .3 .3 .7 .7 .9 .9 0 0] ;Y2=[.6 .6 .7 .7 .6 .6 0 0 .6];
X3=[.13 .17 .13];Y3=[.62 .6 .58];
subplot(2,2,2)
plot(X2,Y2,'b',X1,Y1,'b',X3,Y3,'r','linewidth',2),hold on
plot(0,0.3,'ro','MarkerSize',26,'MarkerEdgeColor','b','MarkerFacecolor','w')
plot(0.9,0.3,'ro','MarkerSize',26,'MarkerEdgeColor','b','MarkerFacecolor','w')
fill([0.31 .31 .68 .68 .31],[.51 .69 .69 .51 .51],'w');
text(-.025,0.3,'V','color','k','fontsize',12); text(.87,.3,'E','color','b','fontsize',12);
text(.45,.6,'jX','color','k','fontsize',12)
text(.13,.54,'I','color','r','fontsize',12)
text(0.01,.38,'+','color','k','fontsize',15)
text(0.03,.22,'-','color','k','fontsize',15)
text(0.91,.38,'+','color','k','fontsize',15)
text(0.93,.22,'-','color','k','fontsize',15)
text(-.017,.275,'--','color','k','fontsize',12)
text(.877,.275,'--','color','b','fontsize',12)
text(.12,.508,'--','color','r','fontsize',12)
set(gca,'visible','off')
subplot(2,2,4)
text(.17,.99,'V = E + jXI','color','b','fontsize',13)
text(.16,.945,' - - -','color','b','fontsize',13)
text(.12,.75,'P = (VE/X)sin\delta','color','b','fontsize',13)
text(.12,.65,' = VIcos\phi','color','b','fontsize',13)
set(gca,'visible','off')
%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -