📄 fm_uwfig.m
字号:
function fig = fm_uwfig(varargin)
% FM_UWFIG create GUI for PSAT/UWPFLOW interface.
%
% FIG = FM_UWFIG
%
%see UWPFLOW structure for settings
%
%Author: Federico Milano
%Date: 31-Mar-2003
%Version: 1.0.0
%
%E-mail: fmilano@thunderbox.uwaterloo.ca
%Web-site: http://thunderbox.uwaterloo.ca/~fmilano
%
% Copyright (C) 2002-2006 Federico Milano
global Settings Path PQ UWPFLOW GAMS Theme Fig Hdl History
% initialize UWPFLOW.opt, if necessary
fm_uwpflow('init')
% check for options
if nargin, checkon(varargin{1}), return, end
% do not redraw figure if open
if Fig.uwpflow, figure(Fig.uwpflow), return, end
[u,w] = system('uwpflow');
if isempty(strmatch('UW Continuation Power Flow',w))
uiwait(fm_choice('UWPFLOW is not properly installed on your system.',2))
return
end
% constants and lists
D = 0.9394;
dy = 0.025;
dx = (D-4*dy)/3;
x1 = 0.0329 + dy;
x2 = 0.0329 + 2*dy + dx;
x3 = 0.0329 + 3*dy + 2*dx;
methods = {'[ ] Power Flow';
'[-c] Continuation Method';
'[-C] Direct Method';
'[-H] Parameterized CM'};
output = {'.k'; '.v'; '.w'; '.pf'; '.jac'; '.cf'; '.cpf';
'.mis'; '.var'; '.log'; '.oh'; '.vp'; '.gen'; '.ini';
'.poc'; '.ntv'};
output = strcat(UWPFLOW.file,output);
if PQ.n
PQbuses = strcat('PQ_',num2str(PQ.bus));
if PQ.n < UWPFLOW.opt.B.num, UWPFLOW.opt.B.num = 1; end
if PQ.n < UWPFLOW.opt.f.num, UWPFLOW.opt.f.num = 1; end
if PQ.n < UWPFLOW.opt.one.num, UWPFLOW.opt.one.num = 1; end
else
PQbuses = {'<none>'};
end
h0 = figure('Units','normalized', ...
'Color',Theme.color02, ...
'Colormap',[], ...
'CreateFcn', 'Fig.uwpflow = gcf;', ...
'DeleteFcn', 'Fig.uwpflow = 0;', ...
'MenuBar','none', ...
'Name','PSAT-UWPFLOW', ...
'NumberTitle','off', ...
'PaperPosition',[18 180 576 432], ...
'PaperUnits','points', ...
'Position',sizefig(1.2*0.5645,1.1*0.8451), ...
'Resize','on', ...
'ToolBar','none', ...
'FileName','fm_uwfig');
fm_set colormap
% Menu File
h1 = uimenu('Parent',h0, ...
'Label','File', ...
'Tag','MenuFile');
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwpflow view', ...
'Label','View UWPFLOW Input/Output files', ...
'Tag','OTV', ...
'Accelerator','g');
h2 = uimenu('Parent',h1, ...
'Callback','close(gcf)', ...
'Label','Exit', ...
'Tag','NetSett', ...
'Accelerator','x', ...
'Separator','on');
% Menu Edit
h1 = uimenu('Parent',h0, ...
'Label','Edit', ...
'Tag','MenuEdit');
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwpflow makecom', ...
'Label','Create UWPFLOW command line', ...
'Tag','ToolUWcom', ...
'Accelerator','c');
h2 = uimenu('Parent',h1, ...
'Callback','fm_setting', ...
'Label','General Settings', ...
'Tag','ToolSett', ...
'Separator', 'on', ...
'Accelerator','s');
% Menu Run
h1 = uimenu('Parent',h0, ...
'Label','Run', ...
'Tag','MenuRun');
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwpflow uwrun', ...
'Label','Run UWPFLOW', ...
'Tag','ToolOPFSett', ...
'Accelerator','z');
% Menu Options
h1 = uimenu('Parent',h0, ...
'Label','Options', ...
'Tag','MenuOpt');
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig a', ...
'Label','[-a] No tap/angle limit control', ...
'Tag','aopt', ...
'Checked',onoff(UWPFLOW.opt.a.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig A', ...
'Label','[-A] No intercahnge area control', ...
'Tag','Aopt', ...
'Checked',onoff(UWPFLOW.opt.A.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig b', ...
'Label','[-b] No interchange area control', ...
'Tag','bopt', ...
'Checked',onoff(UWPFLOW.opt.b.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig d', ...
'Label','[-d] Generate debug output', ...
'Tag','dopt', ...
'Checked',onoff(UWPFLOW.opt.d.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig g', ...
'Label','[-g] Force Qg to 0 (IEEE CDF)', ...
'Tag','gopt', ...
'Checked',onoff(UWPFLOW.opt.g.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig G', ...
'Label','[-G] Turn off ac device recovery', ...
'Tag','Gopt', ...
'Checked',onoff(UWPFLOW.opt.G.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig n', ...
'Label','[-n] Turn off all ac limits', ...
'Tag','nopt', ...
'Checked',onoff(UWPFLOW.opt.n.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig N', ...
'Label','[-N] Turn off all ac system controls', ...
'Tag','Nopt', ...
'Checked',onoff(UWPFLOW.opt.N.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig p', ...
'Label','[-p] Turn off P/Q limits in reg. transf.', ...
'Tag','popt', ...
'Checked',onoff(UWPFLOW.opt.p.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig P', ...
'Label','[-P] Turn off P/Q control by reg. transf.', ...
'Tag','Popt', ...
'Checked',onoff(UWPFLOW.opt.P.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig q', ...
'Label','[-q] Turn off Q limits in PV buses', ...
'Tag','qopt', ...
'Checked',onoff(UWPFLOW.opt.q.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig qx', ...
'Label','[-qx] Turn off V limits in BX buses', ...
'Tag','qxopt', ...
'Checked',onoff(UWPFLOW.opt.qx.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig qz', ...
'Label','[-qz] Turn off Q limits in BZ buses', ...
'Tag','qzopt', ...
'Checked',onoff(UWPFLOW.opt.qz.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig Q', ...
'Label','[-Q] Turn off remote Vg control', ...
'Tag','Qopt', ...
'Checked',onoff(UWPFLOW.opt.Q.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig QX', ...
'Label','[-QX] Turn off remote Vg control in BX buses', ...
'Tag','QXopt', ...
'Checked',onoff(UWPFLOW.opt.QX.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig r', ...
'Label','[-r] Turn off V limits in reg. tranf. and PV buses', ...
'Tag','ropt', ...
'Checked',onoff(UWPFLOW.opt.r.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig R', ...
'Label','[-R] Turn off V control by reg. transf.', ...
'Tag','Ropt', ...
'Checked',onoff(UWPFLOW.opt.R.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig s', ...
'Label','[-s] Suppress ASCII output file', ...
'Tag','sopt', ...
'Checked',onoff(UWPFLOW.opt.s.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig x', ...
'Label','[-x] Use single slack bus', ...
'Tag','xopt', ...
'Checked',onoff(UWPFLOW.opt.x.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig X', ...
'Label','[-X] Turn off max Pg limits', ...
'Tag','Xopt', ...
'Checked',onoff(UWPFLOW.opt.X.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig four', ...
'Label','[-4] Turn off Eq limits in all gen.', ...
'Tag','fouropt', ...
'Checked',onoff(UWPFLOW.opt.four.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig five', ...
'Label','[-5] Turn off Ia limits in all gen.', ...
'Tag','fiveopt', ...
'Checked',onoff(UWPFLOW.opt.five.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig seven', ...
'Label','[-7] Enforce Vmax and Vmin', ...
'Tag','sevenopt', ...
'Checked',onoff(UWPFLOW.opt.seven.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig eight', ...
'Label','[-8] Enforce Imax limits', ...
'Tag','eightopt', ...
'Checked',onoff(UWPFLOW.opt.eight.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig nine', ...
'Label','[-9] Do not enforce gen. Smax limits', ...
'Tag','nineopt', ...
'Checked',onoff(UWPFLOW.opt.nine.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig bound', ...
'Label','[-#] Use secondary voltage control', ...
'Tag','boundopt', ...
'Checked',onoff(UWPFLOW.opt.bound.status));
% Menu Output files
h1 = uimenu('Parent',h0, ...
'Label','Output', ...
'Tag','MenuOut');
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig E', ...
'Label','[-E] Print PoC right e-vector', ...
'Tag','eopt', ...
'Checked',onoff(UWPFLOW.opt.E.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig j', ...
'Label','[-j] Write Jacobian matrix (2n+1)x(2n+1)', ...
'Tag','eopt', ...
'Checked',onoff(UWPFLOW.opt.j.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig J', ...
'Label','[-J] Write Jacobian matrix (2n)x(2n)', ...
'Tag','eopt', ...
'Checked',onoff(UWPFLOW.opt.j.status));
h2 = uimenu('Parent',h1, ...
'Callback','fm_uwfig E', ...
'Label','[-E] Print PoC right e-vector', ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -