Coder Social home page Coder Social logo

Comments (6)

RichriD avatar RichriD commented on August 15, 2024

When I called the function 'makeYbus.py', it appears 'ValueError: column index exceeds matrix dimensions'. This is caused by an indexing error.

from pypower.

RichriD avatar RichriD commented on August 15, 2024

I'm worried that this will happen with the rest of the similar functions, so I hope you will pay attention when using.

from pypower.

RichriD avatar RichriD commented on August 15, 2024

To add, it is when the makeYbus function is called separately that this happens.

from pypower.

rwl avatar rwl commented on August 15, 2024

https://rwl.github.io/PYPOWER/api/pypower.ext2int-module.html

from pypower.

WoodpeckerBaby avatar WoodpeckerBaby commented on August 15, 2024

Dude, he's right. The script doesn't run if the indexing is wrong.

from pypower.

WoodpeckerBaby avatar WoodpeckerBaby commented on August 15, 2024

I had to use this to patch the bug here

print(thisCase["bus"][:, 0])   # debug Ybus formating.
thisCase["bus"][:, 0] = thisCase["bus"][:, 0] - 1
print(thisCase["bus"][:, 0])

print(thisCase["branch"][:, [0, 1]])
thisCase["branch"][:, [0, 1]] = thisCase["branch"][:, [0, 1]] - 1
print(thisCase["branch"][:, [0, 1]])
[1. 2. 3. 4. 5. 6.]
[0. 1. 2. 3. 4. 5.]
[[2. 3.]
 [3. 6.]
 [4. 5.]
 [3. 5.]
 [5. 6.]
 [2. 4.]
 [1. 2.]
 [1. 4.]
 [1. 5.]
 [2. 6.]
 [2. 5.]]
[[1. 2.]
 [2. 5.]
 [3. 4.]
 [2. 4.]
 [4. 5.]
 [1. 3.]
 [0. 1.]
 [0. 3.]
 [0. 4.]
 [1. 5.]
 [1. 4.]]

And it worked.

So, you have to think about indexing becaue python is zero indexing and matlab is 1 indexing.

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.