You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the chance to look at the issue you reported.
The ABA_matrix stores the ABA matrix without the column and row of the reference bus. For the system you loaded there are 14 buses, one of them is the reference. This explains why the matrix is a 13x13.
The "lookup" field contains the dictionaries that link the number of the buses of the systems with the number of the rows/columns. In these dictionaries the reference bus is considered in case the full matrix is wanted to be recreated (together by using the information in the field "ref_bus_positions").
To use the "lookup" field in a for loop you just need to get rid of the key related to the reference bus.
@alefcastelli I understand why the ABA matrix has the reference bus row/column removed, but the point is that indexing with a Bus object or a bus ID (not index) will produce incorrect results or throw an error.
For example, in the example provided, ref_bus = 1. Indeed, if you index the reference bus B[ref_bus, ref_bus], you actually get a value, which is the entry in the first row/column of B.data, which is not the correct bus susceptance for the reference bus. Alternatively, bus number 14 is not a reference bus, but produces an error. Other buses will consistently produce
At the very least, the getindex methods should be removed to prevent the incorrect behavior.
The following code seems to generate an error for
v0.7.1
:In general, it seems
B.lookup[1]
has lengthlength(buses)
, whereasB.data
has dimensions(n, n)
wheren = length(buses) - length(B.ref_bus_positions)
.The full code to reproduce the error is in the Pluto notebook here:
https://gist.github.com/degleris1/ea6830f33a0e8ba125286a1c55feaa13
@amirmm11 @jd-lara
The text was updated successfully, but these errors were encountered: