📄 build_b.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -