9.2 System Information
9.2.1 case_info
case_info(mpc) case_info(mpc, fd) [groups, isolated] = case_info(mpc)
The case_info function prints out detailed information about a Matpower case,
including connectivity information, summarizing the generation, load and other data by
interconnected island. It can optionally print the output to an open file, whose file
identifier (as returned by fopen) is specified in the optional second parameter fd. Optional
return arguments include groups and isolated buses, as returned by the find_islands
function.
9.2.2 compare_case
Compares the bus, branch and gen matrices of two Matpower cases and prints a
summary of the differences. For each column of the matrix it prints the maximum of any
non-zero differences.
9.2.3 find_islands
groups = find_islands(mpc) [groups, isolated] = find_islands(mpc)
The find_islands function returns the islands in a network. The return value groups is a
cell array of vectors of the bus indices for each island. The second and optional return
value isolated is a vector of indices of isolated buses that have no connecting
branches.
9.2.4 get_losses
loss = get_losses(results) loss = get_losses(baseMVA, bus, branch) [loss, chg] = get_losses(results) [loss, fchg, tchg] = get_losses(results) [loss, fchg, tchg, dloss_dv] = get_losses(results) [loss, fchg, tchg, dloss_dv, dchg_dvm] = get_losses(results)
The get_losses function computes branch series losses, and optionally reactive injections
from line charging, as functions of bus voltages and branch parameters, using the
following formulae for a branch, as described in Section 3.2, connecting bus to
bus :
It can also optionally compute the partial derivatives of the line losses and reactive
charging injections with respect to voltage angles and magnitudes.
9.2.5 margcost
marginalcost = margcost(gencost, Pg)
The margcost function computes the marginal cost for generators given a matrix in
gencost format and a column vector or matrix of generation levels. The return value
has the same dimensions as Pg. Each row of gencost is used to evaluate the
cost at the output levels specified in the corresponding row of Pg. The rows of
gencost can specify either polynomial or piecewise linear costs and need not be
uniform.
9.2.6 isload
The isload function returns a column vector of 1’s and 0’s. The 1’s correspond to rows of
the gen matrix which represent dispatchable loads. The current test is and
.
9.2.7 loadshed
shed = loadshed(gen) shed = loadshed(gen, ild)
The loadshed function returns a column vector of MW curtailments of dispatchable loads,
computed as the difference between the PG and PMIN values in the corresponding rows of
the gen matrix. The optional ild argument is a column vector of generator indices to the
dispatchable loads of interest.
9.2.8 printpf
printpf(results, fd, mpopt)
The printpf function prints power flow and optimal power flow results, as returned to fd,
a file identifier which defaults to STDOUT (the screen). The details of what gets printed
are controlled by an optional Matpower options struct mpopt.
9.2.9 total_load
Pd = total_load(mpc) Pd = total_load(mpc, load_zone, opt, mpopt) Pd = total_load(bus) Pd = total_load(bus, gen, load_zone, opt, mpopt) [Pd, Qd] = total_load(...)
The total_load function returns a vector of total load in each load zone. The opt
argument controls whether it includes fixed loads, dispatchable loads or both, and for
dispatchable loads, whether to use the nominal or realized load values. The load_zone
argument defines the load zones across which loads will be summed. It uses the BUS_AREA
column (7) of the bus matrix by default. The string value 'all' can be used to specify a
single zone including the entire system. The reactive demands are also optionally available
as an output.
9.2.10 totcost
totalcost = totcost(gencost, Pg)
The totcost function computes the total cost for generators given a matrix in gencost
format and a column vector or matrix of generation levels. The return value
has the same dimensions as Pg. Each row of gencost is used to evaluate the
cost at the output levels specified in the corresponding row of Pg. The rows of
gencost can specify either polynomial or piecewise linear costs and need not be
uniform.