geopulse.solver.base

Abstract base class for circuit solvers.

The solver takes a ConductorNetwork (which provides Y_n, Z_e, and V_th) and returns the GIC in every branch and the voltage at every node.

References

Classes

Solver()

Abstract base class for circuit solvers.

SolverResult(node_voltages_V, ...)

Result container from a circuit solve.

class geopulse.solver.base.Solver[source]

Bases: ABC

Abstract base class for circuit solvers.

Subclasses:

  • LPMSolver — Lehtinen-Pirjola matrix (resistive, single-phase).

  • MNASolver — Modified Nodal Analysis (reactive, multi-phase).

  • PySpiceSolver — nonlinear transient via SPICE backend.

abstractmethod solve(network, network_admittance, earthing_impedance, thevenin_voltages)[source]

Solve the circuit for GIC.

Parameters:
  • network (ConductorNetwork) – The network the matrices were assembled from. Solvers use it to pull metadata that the numeric matrices do not carry — branch endpoints, node/branch IDs for SolverResult, and any solver-specific data (transformer types for MNA, netlist for PySpiceSolver, …).

  • network_admittance (ndarray) – Y_n matrix. Shape (n_nodes, n_nodes). Units: Siemens.

  • earthing_impedance (ndarray) – Z_e diagonal matrix. Shape (n_nodes, n_nodes). Units: Ohms.

  • thevenin_voltages (ndarray) – V_th per branch. Shape (n_branches,) or (n_times, n_branches). Units: Volts.

Return type:

SolverResult

Returns:

SolverResult – Node voltages and branch currents.

class geopulse.solver.base.SolverResult(node_voltages_V, branch_currents_A, node_ids, branch_ids)[source]

Bases: object

Result container from a circuit solve.

Parameters:
node_voltages_V

Voltage at each node relative to remote earth. Shape (n_nodes,) or (n_times, n_nodes) for a time series.

Type:

numpy.ndarray

branch_currents_A

Current in each branch, in Amperes. Shape (n_branches,) or (n_times, n_branches).

Type:

numpy.ndarray

node_ids

Ordered node IDs matching the columns of node_voltages_V.

Type:

list of str

branch_ids

Ordered branch IDs matching the columns of branch_currents_A.

Type:

list of str

node_voltages_V: ndarray
branch_currents_A: ndarray
node_ids: list[str]
branch_ids: list[str]