Package pypower :: Module dSbr_dV
[hide private]
[frames] | no frames]

Module dSbr_dV

source code

Computes partial derivatives of power flows w.r.t. voltage.

Functions [hide private]
 
dSbr_dV(branch, Yf, Yt, V)
Computes partial derivatives of power flows w.r.t.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

dSbr_dV(branch, Yf, Yt, V)

source code 

Computes partial derivatives of power flows w.r.t. voltage.

returns four matrices containing partial derivatives of the complex branch power flows at "from" and "to" ends of each branch w.r.t voltage magnitude and voltage angle respectively (for all buses). If Yf is a sparse matrix, the partial derivative matrices will be as well. Optionally returns vectors containing the power flows themselves. The following explains the expressions used to form the matrices:

   If = Yf * V;
   Sf = diag(Vf) * conj(If) = diag(conj(If)) * Vf

Partials of V, Vf & If w.r.t. voltage angles:

   dV/dVa  = j * diag(V)
   dVf/dVa = sparse(range(nl), f, j*V(f)) = j * sparse(range(nl), f, V(f))
   dIf/dVa = Yf * dV/dVa = Yf * j * diag(V)

Partials of V, Vf & If w.r.t. voltage magnitudes:

   dV/dVm  = diag(V / abs(V))
   dVf/dVm = sparse(range(nl), f, V(f) / abs(V(f))
   dIf/dVm = Yf * dV/dVm = Yf * diag(V / abs(V))

Partials of Sf w.r.t. voltage angles:

   dSf/dVa = diag(Vf) * conj(dIf/dVa)
                   + diag(conj(If)) * dVf/dVa
           = diag(Vf) * conj(Yf * j * diag(V))
                   + conj(diag(If)) * j * sparse(range(nl), f, V(f))
           = -j * diag(Vf) * conj(Yf * diag(V))
                   + j * conj(diag(If)) * sparse(range(nl), f, V(f))
           = j * (conj(diag(If)) * sparse(range(nl), f, V(f))
                   - diag(Vf) * conj(Yf * diag(V)))

Partials of Sf w.r.t. voltage magnitudes:

   dSf/dVm = diag(Vf) * conj(dIf/dVm)
                   + diag(conj(If)) * dVf/dVm
           = diag(Vf) * conj(Yf * diag(V / abs(V)))
                   + conj(diag(If)) * sparse(range(nl), f, V(f)/abs(V(f)))

Derivations for "to" bus are similar.

For more details on the derivations behind the derivative code used in PYPOWER information, see:

[TN2] R. D. Zimmerman, "AC Power Flows, Generalized OPF Costs and their Derivatives using Complex Matrix Notation", MATPOWER Technical Note 2, February 2010. http://www.pserc.cornell.edu/matpower/TN2-OPF-Derivatives.pdf

Authors:
Ray Zimmerman (PSERC Cornell), Richard Lincoln