-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
makeYbus uses one-indexing #53
Comments
The column https://github.com/rwl/PYPOWER/blob/master/pypower/caseformat.py#L47 The |
Bus 1 to bus 6 is not in the range of 0 to 5 man! That throws an error. For running
buses must appear in order by bus number This is the bus print out DC and AC power flows are working. Why the FDPF can't take the regular case object ppc like the others? |
ext2int |
It's not very well documented. Could you please update the fdpf() function to take a regular ppc object like opf() and dcpf()? I believe the matpower version can. |
makeYbus fails when using pypower test cases due to one-indexing issues. For instance, for:
import pypower.api as pp ppc = pp.case14() baseMVA, bus, branch = ppc['baseMVA'], ppc['bus'], ppc['branch'] pp.makeYbus(baseMVA, bus, branch)
The output is
buses must appear in order by bus number Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/priyadonti/anaconda2/envs/acopf/lib/python3.7/site-packages/pypower/makeYbus.py", line 71, in makeYbus Ct = csr_matrix((ones(nl), (range(nl), t)), (nl, nb)) File "/Users/priyadonti/anaconda2/envs/acopf/lib/python3.7/site-packages/scipy/sparse/compressed.py", line 51, in __init__ other = self.__class__(coo_matrix(arg1, shape=shape)) File "/Users/priyadonti/anaconda2/envs/acopf/lib/python3.7/site-packages/scipy/sparse/coo.py", line 192, in __init__ self._check() File "/Users/priyadonti/anaconda2/envs/acopf/lib/python3.7/site-packages/scipy/sparse/coo.py", line 274, in _check raise ValueError('column index exceeds matrix dimensions') ValueError: column index exceeds matrix dimensions
FIXES:
Line 66 should be
f = branch[:, F_BUS] - 1
and line 67 should be
t = branch[:, T_BUS] - 1
Additionally, the check in line 35 should be
if any(bus[:, BUS_I] != list(range(1, nb+1))):
The text was updated successfully, but these errors were encountered: