rwl / PYPOWER

Port of MATPOWER to Python
http://rwl.github.io/PYPOWER/api/
Other
340 stars 113 forks source link

Error in runopf() #11

Open sscherfke opened 10 years ago

sscherfke commented 10 years ago

https://groups.google.com/forum/#!topic/pypower/0WD2fz9PqRQ

>>> from pypower.api import runopf
>>> runopf(ppc)
PYPOWER Version 4.0.1, 14-Jul-2011 -- AC Optimal Power Flow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pypower\runopf.py", line 37, in runopf
    r = opf(casedata, ppopt)
  File "C:\Python27\lib\site-packages\pypower\opf.py", line 180, in opf
    results, success, raw = opf_execute(om, ppopt)
  File "C:\Python27\lib\site-packages\pypower\opf_execute.py", line 91, in opf_execute
    results, success, raw = pipsopf_solver(om, ppopt)
  File "C:\Python27\lib\site-packages\pypower\pipsopf_solver.py", line 142, in pipsopf_solver
    solution = pips(f_fcn, x0, A, l, u, xmin, xmax, gh_fcn, hess_fcn, opt)
  File "C:\Python27\lib\site-packages\pypower\pips.py", line 265, in pips
    be = uu[ieq, :]
IndexError: too many indice
sscherfke commented 10 years ago

Suggested solution by Iván David Serna Suárez:

Follow the path that appears in the error message (C:\Python27\lib\site-packages\pypower\pips.py) and go to the line in the pips.py file. Change the "be = uu[ieq, :]" to "be = uu[ieq]". Actually the error message was very precise this time.