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

📄 fm_status.m

📁 电力系统的psat
💻 M
字号:
function fm_status(varargin)% FM_STATUS display convergence error of the current simulation in%           the main window%% FM_STATUS('init',xmax,colors,styles,faces)% FM_STATUS('update',values,iteration,err_max)%%see also the structure Hdl%%Author:    Federico Milano%Date:      11-Nov-2002%Update:    09-Jul-2003%Version:   1.0.1%%E-mail:    fmilano@thunderbox.uwaterloo.ca%Web-site:  http://thunderbox.uwaterloo.ca/~fmilano%% Copyright (C) 2002-2005 Federico Milano%% This toolbox is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU% General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.global Settings Fig Hdl Theme CPF OPFpersistent handlespersistent statuspersistent hdlif nargin  routine = varargin{1};  flag = varargin{2};else  returnendswitch routine case 'pf'  check = Settings.status; case 'opf'  check = OPF.show; case 'cpf'  check = CPF.show; case 'lib'  check = Settings.status; case 'snb'  check = Settings.status;endif ~(Settings.show & check & Fig.main)  returnendswitch flag case 'init'  xmax = varargin{3};  colors = varargin{4};  styles = varargin{5};  faces = varargin{6};  if nargin > 6    yrange = varargin{7};  else    yrange = [0 1];  end  if Hdl.status ~= 0    delete(Hdl.status);  end  hdl = findobj(Fig.main,'Tag','PushClose');  set(hdl,'String','Stop');  set(Fig.main,'UserData',1);  set(0,'CurrentFigure',Fig.main);  Hdl.status = axes('position',[0.0406 0.1152 0.2537 0.2243]);  set(Hdl.status, ...      'Drawmode','fast', ...      'NextPlot','add', ...      'Color',Theme.color11, ...      'Xlim',[1 xmax], ...      'Ylim',yrange, ...      'Box','on');  grid('on')  handles = zeros(length(colors),1);  for i = 1:length(colors)    handles(i) = line('color',colors{i}, ...                      'LineStyle',styles{i}, ...                      'Marker','o', ...                      'markersize',5, ...                      'xdata',[], ...                      'ydata',[], ...                      'erase','none', ...                      'MarkerFaceColor',faces{i});  end  status = []; case 'update'  values = varargin{3};  iteration = varargin{4};  if iteration == 1    values(2:end) = 1;  else    values(2:end) = abs(values(2:end))./status(1,2:end);  end  status = [status; values];  for i = 1:length(handles)    if status(1,i+1) == 0      status(1,i+1) = 1;    end    set(handles(i), ...        'xdata',status([max(end-1,1),end],1), ...        'ydata',status([max(end-1,1),end],i+1));  end  drawnow case 'close'  set(hdl,'String','Close');end

⌨️ 快捷键说明

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