Code Monkey home page Code Monkey logo

Comments (4)

rwl avatar rwl commented on July 1, 2024

The column bus[:, BUS_I] isn't necessarily a one-based index. It is a positive integer to identify the bus:

https://github.com/rwl/PYPOWER/blob/master/pypower/caseformat.py#L47

The ext2int function will convert to zero-based, consecutive indexing and int2ext will convert back again.

from pypower.

WoodpeckerBaby avatar WoodpeckerBaby commented on July 1, 2024

@rwl

Bus 1 to bus 6 is not in the range of 0 to 5 man! That throws an error.

For running

Ybus, _, _ = makeYbus.makeYbus(thisCase["baseMVA"], thisCase["bus"], thisCase["branch"])

buses must appear in order by bus number
Traceback (most recent call last):
File "...main.py", line 27, in
Ybus, _, _ = makeYbus.makeYbus(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pypower/makeYbus.py", line 71, in makeYbus
Ct = csr_matrix((ones(nl), (range(nl), t)), (nl, nb))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/scipy/sparse/_compressed.py", line 53, in init
self._coo_container(arg1, shape=shape, dtype=dtype)
File "/usr/local/lib/python3.11/site-packages/scipy/sparse/_coo.py", line 197, in init
self._check()
File "/usr/local/lib/python3.11/site-packages/scipy/sparse/_coo.py", line 286, in _check
raise ValueError('column index exceeds matrix dimensions')
ValueError: column index exceeds matrix dimensions

This is the bus print out
[[ 1. 2. 0. 0. 0. 0. 1. 1.05 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]
[ 2. 3. 0. 0. 0. 0. 1. 1.05 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]
[ 3. 2. 0. 0. 0. 0. 1. 1.05 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]
[ 4. 1. 90. 60. 0. 0. 1. 1. 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]
[ 5. 1. 100. 70. 0. 0. 1. 1. 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]
[ 6. 1. 90. 60. 0. 0. 1. 1. 0. 400.
1. 1.05 0.95 0. 0. 0. 0. ]]

DC and AC power flows are working.

Why the FDPF can't take the regular case object ppc like the others?

from pypower.

rwl avatar rwl commented on July 1, 2024

ext2int

from pypower.

WoodpeckerBaby avatar WoodpeckerBaby commented on July 1, 2024

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.

from pypower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.