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

📄 fm_y.m

📁 电力系统的psat
💻 M
字号:
function fm_y%FM_Y build admittance matrix%%FM_Y%%see also FM_LF and DAE, Bus and Line structures%%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 Line Bus Shunt Settingsif ~Line.n, return, end% process line data and build admittance matrix Line.Ychrg = Line.con(:,10);y = 1./(Line.con(:,8) + j*Line.con(:,9));ts = Line.con(:,11).*exp(j*Line.con(:,12)*pi/180);ts2= ts.*conj(ts);Line.Y = sparse(Line.from, Line.to, -y./conj(ts), Bus.n, Bus.n) + ...         sparse(Line.to, Line.from, -y./ts, Bus.n, Bus.n) + ...         sparse(Line.from, Line.from, (y+j*chrg/2)./ts2, Bus.n, Bus.n) + ...         sparse(Line.to, Line.to, y+j*chrg/2, Bus.n, Bus.n);% add diagonal shunt admittancesLine.Y = Line.Y + sparse(1:Bus.n,1:Bus.n,Shunt.g+j*Shunt.b, ...                         Bus.n,Bus.n);if Settings.octave, Line.Y = full(Line.Y); end% check for missing connections (0 diagonal elements)idx = find(diag(Line.Y)==0);if ~isempty(idx)  Line.Y = Line.Y + sparse(idx,idx,eps,Bus.n,Bus.n);end

⌨️ 快捷键说明

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