opf_veq_fcn

opf_veq_fcn(x, mpc, idx, mpopt)

opf_veq_fcn() - Evaluates voltage magnitude equality constraint and gradients.

[Veq, dVeq] = OPF_VEQ_FCN(X, MPC, IDX, MPOPT)

Computes the voltage magnitudes using real and imaginary part of complex voltage for
AC optimal power flow. Computes constraint vectors and their gradients.

Inputs:
  X : optimization vector
  MPC : MATPOWER case struct
  IDX : index of buses whose voltage magnitudes should be fixed
  MPOPT : MATPOWER options struct

Outputs:
  VEQ  : vector of voltage magnitudes
  DVEQ : (optional) magnitude gradients

Examples:
    Veq = opf_veq_fcn(x, mpc, mpopt);
    [Veq, dVeq] = opf_veq_fcn(x, mpc, idx, mpopt);

See also opf_veq_hess().