--
You received this message because you are subscribed to the Google Groups "pypower" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pypower+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Code hier#neg_Cg = sparse((-ones(ng), (gen[:, GEN_BUS], range(ng))), (nb, ng))
## construct Jacobian of equality constraints (power flow) and transpose it
# dg = lil_matrix((2 * nb, nxyz))
# blank = sparse((nb, ng))
neg_Cg = csc_matrix((-ones(ng), (gen[:, GEN_BUS], range(ng))), (nb, ng))
dg = csc_matrix((2 * nb, nxyz))
blank = csc_matrix((nb, ng))
cols = vstack([hstack([dSbus_dVa.real, dSbus_dVm.real, neg_Cg, blank]), hstack([dSbus_dVa.imag, dSbus_dVm.imag, blank, neg_Cg])], 'csc')
dg[:, iVaVmPgQg] = cols
#dg = dg.tolil()
# dg[:, iVaVmPgQg] = vstack([
# ## P mismatch w.r.t Va, Vm, Pg, Qg
# hstack([dSbus_dVa.real, dSbus_dVm.real, neg_Cg, blank]),
# ## Q mismatch w.r.t Va, Vm, Pg, Qg
# hstack([dSbus_dVa.imag, dSbus_dVm.imag, blank, neg_Cg])
# ], "csr")
eingeben...
dh = csc_matrix((2 * nl2, nxyz))
cols2 = vstack([
hstack([df_dVa, df_dVm]), ## "from" flow limit
hstack([dt_dVa, dt_dVm]) ## "to" flow limit
], 'csr')
dh[:, r_[iVa, iVm].T] = cols2
#dh.tolil()
# dh = lil_matrix((2 * nl2, nxyz))
# dh[:, r_[iVa, iVm].T] = vstack([
# hstack([df_dVa, df_dVm]), ## "from" flow limit
# hstack([dt_dVa, dt_dVm]) ## "to" flow limit
# ], "csr")
C:\Python34\lib\site-packages\scipy\sparse\compressed.py:730: SparseEfficiencyWarning: Changing the sparsity structure of a csc_matrix is expensive. lil_matrix is more efficient.
SparseEfficiencyWarning)