From 34f50dcd11293a11d958c9cc64be023f96c918d0 Mon Sep 17 00:00:00 2001 From: friederikemeier Date: Tue, 22 Nov 2016 11:48:36 +0100 Subject: [PATCH] Fixed Value error due to shape mismatch: Need to make sure, that m and b have the same shape. --- pypower/opf_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypower/opf_setup.py b/pypower/opf_setup.py index 213178a..f9bdf60 100644 --- a/pypower/opf_setup.py +++ b/pypower/opf_setup.py @@ -102,7 +102,7 @@ def opf_setup(ppc, ppopt): b = y0 - m * x0 ppc['gencost'][pwl1, MODEL] = POLYNOMIAL ppc['gencost'][pwl1, NCOST] = 2 - ppc['gencost'][pwl1, COST:COST + 2] = r_[m, b] + ppc['gencost'][pwl1, COST:COST + 2] = r_['1',m.reshape(len(m),1), b.reshape(len(b),1)] ## create (read-only) copies of individual fields for convenience baseMVA, bus, gen, branch, gencost, _, lbu, ubu, ppopt, \