build_b.m

来自「用于电力系统的一个很好的分析软件」· M 代码 · 共 49 行

M
49
字号
function a = build_b(a)% build admittance matrix B' and B" for fast decoupled% power flow algorithm (FDPF)%% see also BUILD_Y and Settingsglobal Bus Settingsif ~a.n, return, endnb = Bus.n;% process line data and build admittance matrix [B']ts = exp(j*a.con(:,12)*pi/180);% XB methodswitch Settings.pfsolver case 2  y = -j*a.u./a.con(:,9); case 3  y = a.u./(a.con(:,8) + j*a.con(:,9));enda.Bp = sparse(a.fr, a.to, -y./conj(ts), nb, nb) + ...       sparse(a.to, a.fr, -y./ts, nb, nb) + ...       sparse(a.fr, a.fr, y./ts, nb, nb) + ...       sparse(a.to, a.to, y, nb, nb);a.Bp = -imag(a.Bp);% process line data and build admittance matrix [B"]chrg = a.u.*a.con(:,10);ts = a.con(:,11);ts2= ts.*ts;% BX methodswitch Settings.pfsolver case 3  y = -j*a.u./a.con(:,9); case 2  y = a.u./(a.con(:,8) + j*a.con(:,9));enda.Bpp = sparse(a.fr, a.to, -y./conj(ts), nb, nb) + ...        sparse(a.to, a.fr, -y./ts, nb, nb) + ...        sparse(a.fr, a.fr, (y+j*chrg)./ts2, nb, nb) + ...        sparse(a.to, a.to, y+j*chrg, nb, nb);a.Bpp = -imag(a.Bpp);

⌨️ 快捷键说明

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