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

Module opf_consfcn

source code

Evaluates nonlinear constraints and their Jacobian for OPF.

Functions [hide private]
 
opf_consfcn(x, om, Ybus, Yf, Yt, ppopt, il=None, *args)
Evaluates nonlinear constraints and their Jacobian for OPF.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

opf_consfcn(x, om, Ybus, Yf, Yt, ppopt, il=None, *args)

source code 

Evaluates nonlinear constraints and their Jacobian for OPF.

Constraint evaluation function for AC optimal power flow, suitable for use with pips. Computes constraint vectors and their gradients.

Parameters:
  • x - optimization vector
  • om - OPF model object
  • Ybus - bus admittance matrix
  • Yf - admittance matrix for "from" end of constrained branches
  • Yt - admittance matrix for "to" end of constrained branches
  • ppopt - PYPOWER options vector
  • il - (optional) vector of branch indices corresponding to branches with flow limits (all others are assumed to be unconstrained). The default is range(nl) (all branches). Yf and Yt contain only the rows corresponding to il.
Returns:
h - vector of inequality constraint values (flow limits) limit^2 - flow^2, where the flow can be apparent power real power or current, depending on value of OPF_FLOW_LIM in ppopt (only for constrained lines). g - vector of equality constraint values (power balances). dh - (optional) inequality constraint gradients, column j is gradient of h(j). dg - (optional) equality constraint gradients.

See Also: opf_costfcn, opf_hessfcn

Authors:
Carlos E. Murillo-Sanchez (PSERC Cornell & Universidad Autonoma de Manizales), Ray Zimmerman (PSERC Cornell), Richard Lincoln