Thanks! ________________________________ From: bounce-124740723-86837...@list.cornell.edu <bounce-124740723-86837...@list.cornell.edu> on behalf of Ray Daniel Zimmerman <r...@cornell.edu> Sent: Monday, June 29, 2020 12:47:23 PM To: MATPOWER-L <matpowe...@list.cornell.edu> Subject: Re: Bus type indexing in newtonpf.m
That is correct. For the power flow equations F(x) = 0, F, x and the Jacobian J are all constructed with the desired ordering, so the ordering of the original buses in the bus matrix does not matter. Ray On Jun 28, 2020, at 5:04 PM, Liang Chen <liangjie.c...@mail.utoronto.ca<mailto:liangjie.c...@mail.utoronto.ca>> wrote: Hello, Regarding my previous question, I think I see where I'm wrong, but it would be nice for someone to confirm: The j1 ~ j6 indices are for the "reduced" J, i.e., the relevant PQ, PV entries of the V, I or S vectors which are already sorted by the (pv, pq) or (pq) entry indexing, which filter out the unwanted entries. Liangjie ________________________________ From: Liang Chen Sent: Friday, June 26, 2020 3:22 AM To: MATPOWER discussion forum <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>> Subject: Bus type indexing in newtonpf.m Hello, I'm reading the source code (newtonpf.m) and noticed the following lines used to indexing and updating the four "quadrants" of the J matrix according to which variables are updated depending on whether it's a PV, PQ or Ref bus: <Outlook-kgfa51hy.png> My question is, doesn't this assume the ordering of PV-PQ-Ref buses in any V, I or S vectors (that are N_BUS x 1 in size)? That is, say there are 9 buses, where 1 is Ref, 4,6,7 are PV , and 2,3,5,8,9 are PQ, then the buses would be ordered like so before this function was called: 4,6,7 2,3,5,8,9 1 (indices are sorted by bus type) (PV) (PQ) (Ref) And according to the source code it would've been 1,2,3 4,5,6,7,8, 9 (PV) (PQ) (Ref) But I didn't notice where this assumption was checked to be valid... I was thinking it should instead be: Idx_PQ = [(internal/consecutive) indices of PQ buses, sorted] Idx_PV = [... PV ...] Idx_Ref = [... Ref ...] (of course there would only be 1 element) and index as J11 = real(dSbus_dVa[all except Idx_Ref, all except Idx_Ref]), and so on for J12, J21, and J22. But if the source code was truly incorrect in this regard, surely it must have been pointed out before, so I'm thinking I made a mistake somewhere. Could you please point out where I'm wrong? Your time and help are much appreciated. Regards, Liangjie Chen