Commit c43abf9a by dongshufeng

完整的make y bus程序

parent 53ba4c94
...@@ -9,13 +9,15 @@ fn make_y_bus(baseMVA, bus, branch) { ...@@ -9,13 +9,15 @@ fn make_y_bus(baseMVA, bus, branch) {
// | | = | | * | | // | | = | | * | |
// | It | | Ytf Ytt | | Vt | // | It | | Ytf Ytt | | Vt |
// //
stat = slice(branch, [0], [BR_STATUS-1,BR_STATUS]); // ones at in-service branches stat = slice(branch, [0], [BR_STATUS-1,BR_STATUS]); // ones at in-service branches
Ys = stat ./ (slice(branch, [0], [BR_R-1,BR_R]) + c(0,1) * slice(branch, [0], [BR_X-1,BR_X])); // series admittance Ys = stat ./ (slice(branch, [0], [BR_R-1,BR_R])
Bc = stat .* slice(branch, [0], [BR_B-1,BR_B]); // line charging susceptance + c(0,1) * slice(branch, [0], [BR_X-1,BR_X])); // series admittance
tap = ones(nl, 1); // default tap ratio = 1 Bc = stat .* slice(branch, [0], [BR_B-1,BR_B]); // line charging susceptance
tap = ones(nl, 1); // default tap ratio = 1
//i = find(branch(:, TAP)); // indices of non-zero tap ratios tap_col = slice(branch, [0], [TAP-1,TAP]); // tap ratio column
//tap(i) = slice(branch, [0], [TAP-1,TAP]); // assign non-zero tap ratios index = find(tap_col); // indices of non-zero tap ratios
tap = set(tap, index, get(tap_col, index)); // assign non-zero tap ratios
tap = tap .* exp(c(0,1)*pi/180 * slice(branch, [0], [SHIFT-1,SHIFT])); // add phase shifters tap = tap .* exp(c(0,1)*pi/180 * slice(branch, [0], [SHIFT-1,SHIFT])); // add phase shifters
Ytt = Ys + c(0,1) * Bc/2; Ytt = Ys + c(0,1) * Bc/2;
Yff = Ytt ./ (tap .* conj(tap)); Yff = Ytt ./ (tap .* conj(tap));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论