pwrs.core.opf_gen_cost_fcn#

pwrs.core.opf_gen_cost_fcn.opf_gen_cost_fcn(x, baseMVA, gencost, ig=None, mpopt=None, nargout=1)[source]#

Evaluate polynomial generator costs and derivatives.

Parameters:
  • x (sequence) – Single-element sequence containing the active or reactive dispatch vector in per unit.

  • baseMVA (float) – System power base.

  • gencost (ndarray) – Standard MATPOWER gencost matrix corresponding to the dispatch provided in x.

  • ig (array_like, optional) – Generator indices of interest. Defaults to all polynomial-cost rows.

  • mpopt (dict, optional) – MATPOWER options dict. Accepted for API compatibility.

  • nargout (int, optional) – Number of outputs to emulate from the MATLAB interface.

Returns:

Returns total cost f and, when requested, the gradient df and Hessian d2f.

Return type:

float or tuple

pwrs.core.opf_gen_cost_fcn.opf_gen_cost_fcn_full(x, baseMVA, gencost, ig=None, mpopt=None)[source]#

Return generator cost, gradient and Hessian.