Progress Matrices Module¶
- class progress.mod_matrices.RAMatrices(nb)¶
Bases:
object
Creates generation, incidence, and curtailment matrices for the RA model.
- Parameters:
nb (int) – Number of buses in the system.
- Ainc(nl, fb, tb)¶
Creates an incidence matrix for modeling flow constraints.
- Parameters:
nl (int) – Number of lines.
fb (list[int]) – List of “from bus” indices for each line.
tb (list[int]) – List of “to bus” indices for each line.
- Returns:
A 2D NumPy array with shape
(nl, nb)
where each row represents one line. Entries of+1
and-1
indicate the sending and receiving buses, respectively.- Return type:
numpy.ndarray
- chmat(ness, essbus, nb)¶
Creates a matrix for ESS charging variables.
- Parameters:
ness (int) – Number of energy storage systems (ESS).
essbus (list[int]) – List of ESS bus indices.
nb (int) – Number of buses.
- Returns:
A 2D NumPy array with shape
(nb, ness)
where each column corresponds to an ESS unit and the row index indicates the bus at which that ESS is located.- Return type:
numpy.ndarray
- curtmat(nb)¶
Creates a curtailment matrix for load curtailment variables.
- Parameters:
nb (int) – Number of buses.
- Returns:
A 2D identity matrix of shape
(nb, nb)
. This matrix is often used to represent a direct mapping of curtailment variables to each bus.- Return type:
numpy.ndarray
- genmat(ng, genbus, ness, essbus)¶
Creates a generation matrix for the optimization problem.
- Parameters:
ng (int) – Number of generators.
genbus (list[int]) – List of generator bus indices.
ness (int) – Number of energy storage systems (ESS).
essbus (list[int]) – List of ESS bus indices.
- Returns:
A 2D NumPy array with shape
(nb, ng + ness)
where each column corresponds to one generator (or ESS) and the row index indicates the bus to which that generator/ESS is connected.- Return type:
numpy.ndarray