el1xr_opt.Modules.oM_LinDist3Flow

el1xr_opt.Modules.oM_LinDist3Flow#

el1xr_opt.Modules.oM_LinDist3Flow.coupling_matrices(R, X)[source]#

Build the LinDist3Flow A_P, A_Q 3x3 matrices from branch R, X (3x3 each).

R, X are dicts or 3x3 nested lists indexed by phase order (a,b,c). Returns (A_P, A_Q) as dict-of-dicts keyed by (row_phase, col_phase).

el1xr_opt.Modules.oM_LinDist3Flow.solve_lindist3flow(branches, loads, slack, v0=1.0, solver='appsi_highs')[source]#

Solve the LinDist3Flow LP on a radial three-phase feeder.

branches: list of dicts {i, j, R, X} with 3x3 R/X (ohm or pu, consistent). loads: dict bus -> dict phase -> (P, Q) net load (consistent units). Returns dict bus -> dict phase -> voltage magnitude (pu, = sqrt(w)).

el1xr_opt.Modules.oM_LinDist3Flow.balanced_branch(r, x, n_buses=None)[source]#

Helper: a diagonal (uncoupled) balanced 3x3 R, X from scalars r, x.