Skip to content

Commit

Permalink
Fix issue #210, multiple gen per bus error - PQSUM
Browse files Browse the repository at this point in the history
Before executing the relevant distribution power flow procedures (such
as calc_v_pq_sum, calc_v_i_sum, calc_v_y_sum), radial_pf consolidates
multiple generators per bus into a single generator. Consequently, the
previously erroneous make_zpv function now consistently obtains a vector
pv comprising only unique indices. The cumulative reactive power of the
combined generator is allocated among the initial generators using
pfsoln. Additionally, the test cases in t_pf_radial have been updated to
include scenarios where 2 generators per bus are introduced.

Fixes: #210
Refs: https://www.mail-archive.com/[email protected]/msg08278.html
  • Loading branch information
todorovski-m committed Dec 2, 2023
1 parent 864c21f commit 980a3b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 126 deletions.
126 changes: 0 additions & 126 deletions data/case22pv.m

This file was deleted.

6 changes: 6 additions & 0 deletions lib/t/t_pf_radial.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ function t_pf_radial(quiet)
[Vm, B] = sort(r.bus(:,VM));
B = B(1:N);
Vm = Vm(1:N);
% Repeat the first M buses K times (K generators per bus)
M = floor(N/2);
K = 2;
B = [repmat(B(1:M),K,1); B(M+1:end)];
Vm = [repmat(Vm(1:M),K,1); Vm(M+1:end)];
N = size(B,1);
% add PV generators at buses in B
% set VG 0.05 pu bigger then voltage at buses in B
mpc.gen = repmat(mpc.gen,N+1,1);
Expand Down

0 comments on commit 980a3b0

Please sign in to comment.