DC OPF Bundle Schema (experimental)

powerio dcopf <case>.m -o <out> (or opf_pipeline::write_dcopf_bundle) writes <out>/<case>_dcopf/: a set of Matrix Market files plus dcopf_meta.json. Everything is a pure function of the case. This documents what each file is and the conventions a consumer (e.g. a C++ Laplacian solver) needs.

Conventions

Matrices

file shape what
A.mtx n×m signed incidence; column e has +1 at from-bus, −1 at to-bus
L.mtx n×n generic Laplacian matrix L = A diag(b) Aᵀ, singular (rank n−1), 1 ∈ ker L
L_grounded.mtx (n−k)×(n−k) L with k reference rows and columns removed; SPD when every island is grounded
BAt.mtx m×n flow map B Aᵀ (f = B Aᵀ θ)
Cg.mtx n×n_gen generator→bus incidence, one 1 per column

Vectors

Bus-indexed (length n): pd (load), q/c (cost diag/linear), pmax/pmin (generation bounds), e_r (reference indicator: 1 at every reference bus, else 0), p_shift (phase shift injection, all zero unless Matpower + shifters). Branch-indexed (length m): b (susceptances), fmax (thermal limits; 0 means unlimited per MATPOWER). Generator-space provenance (length n_gen): q_gen, c_gen, pmax_gen, pmin_gen.

Manifest (dcopf_meta.json)

case_name, base_mva, n, m, n_gen, reference_buses (0-based), convention, units, files[], powerio_version.

Solving with it

The grounded system is the one to factor: L_grounded is SPD when every island has a reference. For DC power flow L θ = p with net injection p = g − d, drop all reference_buses entries from p, solve L_grounded θ_red = p_red, and set each reference angle to 0. e_r identifies the grounded buses without parsing the manifest. The full singular L can be used instead with a consistent zero-sum RHS.

An interior point DC OPF solver builds reweighted Laplacians each Newton step from the same A and b (only the edge weights change), so A is the durable operator to hand over.