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
|
Bulk power-grid network loaded from a MATPOWER-GMD case. |
- class geopulse.network.powergrid.PowerGridNetwork(case)[source]
Bases:
ConductorNetworkBulk power-grid network loaded from a MATPOWER-GMD case.
- Parameters:
case (
MatpowerGMDCase) – Parsed case (seegeopulse.io.matpower.read_matpower_gmd()).
Notes
The DC node id is the 1-based row position within
mpc.gmd_bus(this is whatmpc.gmd_branch.f_bus/t_busreference — NOT AC bus numbers). Seegeopulse.io.matpowerfor 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
Nodeper DC ground node, in matrix-row order.Grounding impedance is stored on the node as
1 / g_gnd(Ohms); forg_gnd == 0(ungrounded / out-of-service),numpy.infis stored.
- assemble_network_admittance()[source]
Assemble the DC nodal admittance matrix
Y_nin 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:
- assemble_earthing_impedance()[source]
Return the diagonal earthing-impedance matrix
Z_ein Ohms.Ungrounded nodes (
g_gnd == 0) get0on the diagonal so thatY_n · Z_edoes not develop infinities; the LPM solver treats those nodes as carrying no ground current.- Return type:
- 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 matchesget_branches()).- Parameters:
ex_Vm (
ndarray|float) – E-field components in V/m. Scalar (uniform) or array of lengthn_active_branches(branch-wise).ey_Vm (
ndarray|float) – E-field components in V/m. Scalar (uniform) or array of lengthn_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:
- 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_NwhereL_E,L_Nare 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) receiveV_th = 0.