opf_power_balance_fcn

opf_power_balance_fcn(x, mpc, Ybus, mpopt)

opf_power_balance_fcn() - Evaluates AC power balance constraints and their gradients.

[G, DG] = OPF_POWER_BALANCE_FCN(X, OM, YBUS, MPOPT)

Computes the active or reactive power balance equality constraints for
AC optimal power flow. Computes constraint vectors and their gradients.

Inputs:
  X : optimization vector
  MPC : MATPOWER case struct
  YBUS : bus admittance matrix
  MPOPT : MATPOWER options struct

Outputs:
  G  : vector of equality constraint values (active/reactive power balances)
  DG : (optional) equality constraint gradients

Examples:
    g = opf_power_balance_fcn(x, mpc, Ybus, mpopt);
    [g, dg] = opf_power_balance_fcn(x, mpc, Ybus, mpopt);

See also opf_power_balance_hess().