rwl/PYPOWER

Value error when running case30pwl for OPF

Opened this issue · 0 comments

rwl commented

As reported by Minjiang Chen on the mailing list:

But when I tried to run OPF for the ‘case30pwl’, I has an error which I will show details below. I also tried to run with PF for the ‘case30pwl’, it is fine.

And I also run other cases which are using the polynomial ‘gencost’, they are all working on opf mode.

Here are the code I run:

from pypower.api import runopf, loadcase

ppc = loadcase('case30pwl')
r = runopf(ppc)

Here are the error I got:

            PYPOWER Version 4.1.2, 27-Oct-2014 -- AC Optimal Power Flow

Traceback (most recent call last):

            File "D:\Minjiang\PhD\Research Progress\Programming\PyPower\Work1\Test5.py", line 13, in <module>
             r = runopf(ppc)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\runopf.py", line 44, in runopf
             r = opf(casedata, ppopt)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\opf.py", line 185, in opf
            results, success, raw = opf_execute(om, ppopt)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\opf_execute.py", line 94, in opf_execute
            results, success, raw = pipsopf_solver(om, ppopt)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\pipsopf_solver.py", line 147, 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-4.1.2-py2.7.egg\pypower\pips.py", line 275, in pips
            f, df = f_fcn(x)                 # cost
         File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\pipsopf_solver.py", line 143, in <lambda>
            f_fcn = lambda x, return_hessian=False: opf_costfcn(x, om, return_hessian)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\opf_costfcn.py", line 118, in opf_costfcn
            df_dPgQg[ipol] = baseMVA * polycost(gencost[ipol, :], xx[ipol], 1)
            File "C:\Python27\lib\site-packages\pypower-4.1.2-py2.7.egg\pypower\polycost.py", line 48, in polycost
            maxN = max( gencost[:, NCOST].astype(int) )

ValueError: max() arg is an empty sequence

I didn’t change anything in the ‘case30pwl’.