Expand description
Format-neutral network model — the hub every converter meets at.
Readers map their format into a Network; writers map a Network back out.
It is the one canonical data model: format-neutral tables with loads and
shunts first-class, so a format that carries several loads per bus (PSS/E,
PowerModels) maps without losing them, while MATPOWER (which folds demand and
shunts onto the bus row) splits them out on read. The dense-indexed analysis
view the matrix builders consume is IndexedNetwork,
derived from a Network. Two things make conversion honest:
- Retained source. A
Networkkeeps the raw text it was read from plus itsSourceFormat, so writing back to the same format echoes it byte-for-byte (no round-trip drift). - Extras passthrough. Every element carries an
Extrasmap of source-format fields the neutral model doesn’t name, so X→Network→X keeps them and a cross-format writer can pass through what its target understands.
Fully lossless any-to-any isn’t possible (formats model different things); the contract is byte-exact same-format and maximal-fidelity cross-format with the writer reporting whatever it can’t represent.
Structs§
- Branch
- Bus
- BusId
- A bus identifier as it appears in the source file: the external, stable id
(1-based in MATPOWER, and possibly sparse — pegase has gaps in its ids).
Distinct from the dense
[0, n)analysis index, which onlyIndexedNetworkproduces, viabus_index. The two are both integers and trivially confused; making the id its own type stops one being used where the other is meant (using a 1-based id to index a matrix is off-by-one on a contiguous case and pure garbage on a sparse one). - GenCost
- A generator cost curve (
mpc.gencostrow). - Generator
- Hvdc
- A two-terminal HVDC line (MATPOWER
dcline). - Load
- Network
- A format-neutral power network.
- Shunt
- Storage
Enums§
- BusType
- Bus type per MATPOWER convention: 1=PQ, 2=PV, 3=ref/slack, 4=isolated.
- Source
Format - Which format a
Networkwas read from. Drives the same-format byte-exact echo on write.