scale_load

scale_load(dmd, bus, gen, load_zone, opt, gencost)

scale_load() - Scales fixed and/or dispatchable loads.

MPC = SCALE_LOAD(LOAD, MPC);
MPC = SCALE_LOAD(LOAD, MPC, LOAD_ZONE)
MPC = SCALE_LOAD(LOAD, MPC, LOAD_ZONE, OPT)
BUS = SCALE_LOAD(LOAD, BUS);
[BUS, GEN] = SCALE_LOAD(LOAD, BUS, GEN, LOAD_ZONE, OPT)
[BUS, GEN, GENCOST] = ...
    SCALE_LOAD(LOAD, BUS, GEN, LOAD_ZONE, OPT, GENCOST)

Scales active (and optionally reactive) loads in each zone by a
zone-specific ratio, i.e. R(k) for zone k. Inputs are ...

LOAD - Each element specifies the amount of scaling for the
    corresponding load zone, either as a direct scale factor
    or as a target quantity. If there are nz load zones this
    vector has nz elements.

MPC - standard MATPOWER case struct or case file name

BUS - standard BUS matrix with nb rows, where the fixed active
    and reactive loads available for scaling are specified in
    columns PD and QD

GEN - (optional) standard GEN matrix with ng rows, where the
    dispatchable loads available for scaling are specified by
    columns PG, QG, PMIN, QMIN and QMAX (in rows for which
    ISLOAD(GEN) returns true). If GEN is empty, it assumes
    there are no dispatchable loads.

LOAD_ZONE - (optional) nb element vector where the value of
    each element is either zero or the index of the load zone
    to which the corresponding bus belongs. If LOAD_ZONE(b) = k
    then the loads at bus b will be scaled according to the
    value of LOAD(k). If LOAD_ZONE(b) = 0, the loads at bus b
    will not be modified. If LOAD_ZONE is empty, the default is
    determined by the dimensions of the LOAD vector. If LOAD is
    a scalar, a single system-wide zone including all buses is
    used, i.e. LOAD_ZONE = ONES(nb, 1). If LOAD is a vector, the
    default LOAD_ZONE is defined as the areas specified in the
    BUS matrix, i.e. LOAD_ZONE = BUS(:, BUS_AREA), and LOAD
    should have dimension = MAX(BUS(:, BUS_AREA)).

OPT - (optional) struct with three possible fields, 'scale',
    'pq' and 'which' that determine the behavior as follows:

  OPT.scale (default is 'FACTOR')
    'FACTOR'   : LOAD consists of direct scale factors, where
                 LOAD(k) = scale factor R(k) for zone k
    'QUANTITY' : LOAD consists of target quantities, where
                 LOAD(k) = desired total active load in MW for
                 zone k after scaling by an appropriate R(k)

  OPT.pq    (default is 'PQ')
    'PQ' : scale both active and reactive loads
    'P'  : scale only active loads

  OPT.which (default is 'BOTH' if GEN is provided, else 'FIXED')
    'FIXED'        : scale only fixed loads
    'DISPATCHABLE' : scale only dispatchable loads
    'BOTH'         : scale both fixed and dispatchable loads

  OPT.cost : (default = -1) flag to include cost in scaling or not
    -1 : include cost if gencost is available
     0 : do not include cost
     1 : include cost (error if gencost not available)

GENCOST - (optional) standard GENCOST matrix with ng (or 2*ng)
    rows, where the dispatchable load rows are determined by
    the GEN matrix. If included, the quantity axis of the marginal
    "cost" or benefit function of any dispatchable loads will be
    scaled with the size of the load itself (using MODCOST twice,
    once with MODTYPE equal to SCALE_F and once with SCALE_X).

Examples:
    Scale all real and reactive fixed loads up by 10%.

    bus = scale_load(1.1, bus);

    Scale all active loads (fixed and dispatchable) at the first 10
    buses so their total equals 100 MW, and at next 10 buses so their
    total equals 50 MW.

    load_zone = zeros(nb, 1);
    load_zone(1:10) = 1;
    load_zone(11:20) = 2;
    opt = struct('pq', 'P', 'scale', 'QUANTITY');
    dmd = [100; 50];
    [bus, gen] = scale_load(dmd, bus, gen, load_zone, opt);

See also total_load().