pwrs.core.polycost#

pwrs.core.polycost.polycost(gencost, Pg, der=0)[source]#

Evaluate polynomial generator cost functions or derivatives.

Mirrors MATPOWER’s polycost helper by evaluating polynomial cost curves, or their derivatives of order der, for the supplied generator output levels.

Parameters:
  • gencost (array_like) – Polynomial generator cost matrix.

  • Pg (array_like) – Generator output values at which to evaluate the cost.

  • der (int, optional) – Derivative order. 0 evaluates the cost itself.

  • nargout (int, optional) – MATLAB compatibility flag.

Returns:

Evaluated polynomial cost values with the same shape as Pg.

Return type:

numpy.ndarray or float