opf_current_balance_fcn

opf_current_balance_fcn(x, mpc, Ybus, mpopt)

opf_current_balance_fcn() - Evaluates AC current balance constraints and their gradients.

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

Computes the real or imaginary current 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 (real/imaginary current balances)
  DG : (optional) equality constraint gradients

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

See also opf_power_balance_hess().