pwrs.core.modcost#

pwrs.core.modcost.modcost(gencost, alpha, modtype='SCALE_F')[source]#

Modify generator cost curves by scaling or shifting.

Mirrors MATPOWER’s modcost helper. It applies multiplicative or additive modifications to polynomial or piecewise-linear cost functions in either the cost axis or the quantity axis.

Parameters:
  • gencost (array_like) – Generator cost matrix.

  • alpha (float or array_like) – Scalar or per-generator modification factor.

  • modtype (str, optional) – Modification type, such as 'SCALE_F', 'SCALE_X', 'SHIFT_F', or 'SHIFT_X'.

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

Returns:

Modified generator cost matrix.

Return type:

numpy.ndarray