geopulse.network.powergrid

Power-grid conductor network (substations + transmission lines).

Loads a MATPOWER-GMD .m file via geopulse.io.matpower and exposes it through the ConductorNetwork ABC so the LPM solver can treat it identically to a cable or a pipeline.

Geographic convention

Node coordinates are stored in degrees. Line integrals of the geoelectric field use a local equirectangular projection about the network’s mean lat/lon; adequate for a few hundred kilometres of extent (the Horton EPRI21 network spans ~500 km across TN/GA/AL).

References

Classes

PowerGridNetwork(case)

Bulk power-grid network loaded from a MATPOWER-GMD case.

class geopulse.network.powergrid.PowerGridNetwork(case)[source]

Bases: ConductorNetwork

Bulk power-grid network loaded from a MATPOWER-GMD case.

Parameters:

case (MatpowerGMDCase) – Parsed case (see geopulse.io.matpower.read_matpower_gmd()).

Notes

The DC node id is the 1-based row position within mpc.gmd_bus (this is what mpc.gmd_branch.f_bus / t_bus reference — NOT AC bus numbers). See geopulse.io.matpower for the full convention.

Examples

>>> from geopulse.io.matpower import read_matpower_gmd
>>> case = read_matpower_gmd("benchmarks/horton2012/epri21.m")
>>> net = PowerGridNetwork(case)
>>> Y = net.assemble_network_admittance()
get_nodes()[source]

Return one Node per DC ground node, in matrix-row order.

Grounding impedance is stored on the node as 1 / g_gnd (Ohms); for g_gnd == 0 (ungrounded / out-of-service), numpy.inf is stored.

Return type:

Sequence[Node]

get_branches()[source]

Return one Branch per in-service DC branch.

Return type:

Sequence[Branch]

assemble_network_admittance()[source]

Assemble the DC nodal admittance matrix Y_n in Siemens.

Only line conductances contribute — earthing conductances are returned separately by assemble_earthing_impedance() so the solver can build the LPM matrix (1 + Y_n · Z_e) explicitly.

Return type:

ndarray

assemble_earthing_impedance()[source]

Return the diagonal earthing-impedance matrix Z_e in Ohms.

Ungrounded nodes (g_gnd == 0) get 0 on the diagonal so that Y_n · Z_e does not develop infinities; the LPM solver treats those nodes as carrying no ground current.

Return type:

ndarray

compute_thevenin_voltages(ex_Vm, ey_Vm, lat_deg=None, lon_deg=None)[source]

Compute the Thévenin voltage per branch via V = E · dl.

The E-field is evaluated at the midpoint of each branch. For a uniform field, pass floats for ex_Vm / ey_Vm; for a spatially varying field, pass arrays evaluated at every branch midpoint (order matches get_branches()).

Parameters:
  • ex_Vm (ndarray | float) – E-field components in V/m. Scalar (uniform) or array of length n_active_branches (branch-wise).

  • ey_Vm (ndarray | float) – E-field components in V/m. Scalar (uniform) or array of length n_active_branches (branch-wise).

  • lat_deg (ndarray | None) – Ignored; retained for API compatibility with subclasses that use geo-referenced E-field grids.

  • lon_deg (ndarray | None) – Ignored; retained for API compatibility with subclasses that use geo-referenced E-field grids.

Return type:

ndarray

Returns:

numpy.ndarray – Thévenin voltage per branch, in Volts. Length equals the number of branches returned by get_branches().

Notes

Per-branch: V_th = Ex · L_E + Ey · L_N where L_E, L_N are the east-west and north-south distances between endpoints computed with WGS84 curvature radii evaluated at that segment’s midpoint latitude (matching Horton (2012) Appendix eqns A3, A7 exactly). Branches with an endpoint lacking geographic coordinates (transformer-internal windings) receive V_th = 0.

classmethod from_file(path)[source]

Load a network from a MATPOWER-GMD .m file.

Parameters:

path (str) – Path to the .m file (e.g. benchmarks/horton2012/epri21.m).

Return type:

PowerGridNetwork

Returns:

PowerGridNetwork