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

📄 fm_view.m

📁 电力系统的psat
💻 M
字号:
function fm_view(flag)% FM_VIEW functions for matrix visualizations%% FM_VIEW(FLAG)%      FLAG matrix visualization type%%see also FM_MATRX%%Author:    Federico Milano%Date:      11-Nov-2002%Version:   1.0.0%%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 DAE Bus Themeif isempty(Bus.n)  fm_disp('No loaded system. Matrix visualization connot be run.',2)  returnendswitch flag case 1  if DAE.n > 0    matrice = [DAE.Fx, DAE.Fy; DAE.Gx, DAE.Jlfv];  else    fm_disp('Since no dynamic component is loaded, AC coincides with Jlfv.',2)    matrice = DAE.Jlfv;  end  titolo = 'Complete System Matrix A_c';  visual(matrice,titolo) case 2  if DAE.n > 0    matrice = DAE.Fx - DAE.Fy*inv(DAE.Jlfv)*DAE.Gx;  else    fm_disp('No dynamic component loaded.',2);    return  end  titolo = 'State jacobian matrix A_s';  visual(matrice,titolo) case 3  matrice = DAE.Jlf;  titolo = 'Jacobian matrix J_l_f';  visual(matrice,titolo) case 4  matrice = DAE.Jlfv;  titolo = 'Jacobian matrix J_l_f_v';  visual(matrice,titolo) case 5  if DAE.n > 0    Fx_mod = DAE.Fx+diag(-1e-5*ones(DAE.n,1));    matrice = DAE.Jlfv - DAE.Gx*inv(Fx_mod)*DAE.Fy;  else    fm_disp(['Since no dynamic component is loaded, ', ...             'Jlfd coincides with Jlfv.'],2)    matrice = DAE.Jlfv;  end  titolo = 'Jacobian matrix J_l_f_d';  visual(matrice,titolo) case 6  ch(1) = findobj(gcf,'Tag','toggle1');  ch(2) = findobj(gcf,'Tag','toggle2');  ch(3) = findobj(gcf,'Tag','toggle3');  ch(4) = findobj(gcf,'Tag','toggle4');  ca = find(ch == gcbo);  vals = zeros(4,1);  vals(ca) = 1;  for i = 1:4, set(ch(i),'Value',vals(i)); end  hdl = findobj(gcf,'Tag','toggle5');  if ca == 3    set(hdl,'Enable','off');  else    set(hdl,'Enable','on');  endend%===================================================================================function visual(matrice,titolo)global DAE Bus Themech(1) = findobj(gcf,'Tag','toggle1');ch(2) = findobj(gcf,'Tag','toggle2');ch(3) = findobj(gcf,'Tag','toggle3');ch(4) = findobj(gcf,'Tag','toggle4');vals = get(ch,'Value');for i = 1:4, valn(i) = vals{i}; endtre_d = find(valn);switch tre_d case 1  surf(full(matrice));  shading('interp') case 2  mesh(full(matrice)); case 3  rotate3d off  hdl = findobj(gcf,'Tag','toggle5');  set(hdl,'Value',0);  spy(matrice);  if flag == 1    hold on    plot([0, DAE.n+2*Bus.n+2],[DAE.n+0.5, DAE.n+0.5],'k:');    plot([DAE.n+0.5, DAE.n+0.5],[0, DAE.n+2*Bus.n+2],'k:');    hold off  end case 4  surf(full(matrice));endhdl = findobj(gcf,'Tag','toggle6');if get(hdl,'Value'), grid on, else grid off, endhdl = findobj(gcf,'Tag','toggle7');if get(hdl,'Value'), zoom on, else zoom off, endset(gca,'Color',Theme.color11);title(titolo);

⌨️ 快捷键说明

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