pwrs.core.load2disp#

pwrs.core.load2disp.load2disp(mpc0, fname=None, idx=None, voll=None)[source]#

Convert fixed loads into dispatchable loads.

Mirrors MATPOWER’s load2disp helper by replacing selected fixed bus loads with negative generators and corresponding piecewise-linear cost data representing value of lost load.

Parameters:
  • mpc0 (dict or str) – MATPOWER case struct or case name/path.

  • fname (str, optional) – Output file name for saving the converted case.

  • idx (array_like, optional) – One-based indices of buses whose loads should be converted.

  • voll (float or array_like, optional) – Value of lost load coefficients for the converted dispatchable loads.

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

Returns:

Updated MATPOWER case struct with dispatchable loads appended to the generator and cost matrices.

Return type:

dict