pwrs.core.scale_load#
- pwrs.core.scale_load.scale_load(dmd, bus, gen=None, load_zone=None, opt=None, gencost=None, *, nargout=None)[source]#
Scale fixed and/or dispatchable loads in a MATPOWER case.
Mirrors MATPOWER’s
scale_loadhelper. It scales fixed bus loads, dispatchable loads represented as negative generators, and optionally their costs, either by multiplicative factors or by target zone load quantities.- Parameters:
dmd (array_like) – Desired scale factors or target load levels by zone.
bus (dict, str, or array_like) – MATPOWER case struct, case name/path, or bus matrix.
gen (array_like, optional) – Generator matrix when operating on explicit matrices.
load_zone (array_like, optional) – Zone mapping for each bus.
opt (dict, optional) – MATPOWER
scale_loadoptions struct.gencost (array_like, optional) – Generator cost matrix to scale along with dispatchable loads when requested.
nargout (int, optional) – MATLAB compatibility flag controlling the returned output form.
- Returns:
Updated case struct, or updated
bus,gen, and optionalgencostmatrices.- Return type:
dict or tuple
- pwrs.core.scale_load.scale_load_bus(dmd, bus, gen=None, load_zone=None, opt=None, gencost=None)[source]#
Scale loads and return the updated bus matrix.