simplenet.kron¶
Kron reduction core.
Mathematically equivalent to the partial-LU implementation in
matlab/NetworkReduction2/PartialSymLU.m and PartialNumLU.m: given
a partition of buses into external (to be eliminated) and internal
(retained), the equivalent admittance matrix seen from the internal
buses is:
.. math::
Y_{\text{red}} = Y_{ii} - Y_{ie} \, Y_{ee}^{-1} \, Y_{ei}
This module returns the dense reduced internal block (typically far smaller than the full system) so that downstream code can extract equivalent branches and shunts.
KronResult
dataclass
¶
Output of :func:kron_reduce.
Attributes:
| Name | Type | Description |
|---|---|---|
y_red |
ndarray
|
Dense reduced admittance matrix of shape
|
y_ii_orig |
ndarray
|
Original internal block (dense), useful for distinguishing native off-diagonal entries from new fills (equivalent branches). |
kron_reduce
¶
Compute :math:Y_{ii} - Y_{ie} Y_{ee}^{-1} Y_{ei} densely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_full
|
spmatrix
|
Square sparse matrix (any sparse format), typically built by
:func: |
required |
external_idx
|
ndarray
|
0-indexed array of external bus rows/columns. |
required |
internal_idx
|
ndarray
|
0-indexed array of internal bus rows/columns; together with
|
required |