The purpose of this document is to show how the AC power balance and flow equations used in power flow and optimal power flow computations can be expressed in terms of complex matrices, and how their first and second derivatives can be computed efficiently using complex sparse matrix manipulations. Similarly, the derivatives of the generalized AC OPF cost function used by MATPOWER and the corresponding OPF Lagrangian function are developed. The relevant code in MATPOWER is based on the formulas found in this note, in which nodal balances are expressed in terms of complex power and voltages are represented in polar coordinates, and in the companion MATPOWER Technical Note 3 and MATPOWER Technical Note 4, which present formulas for variations based on nodal current balances and cartesian coordinate voltages, respectively.
No takes yet. Share an insight, caveat, or question.
Ray D. Zimmerman (2010) studied this question.