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
|
Abstract base class for circuit solvers. |
|
Result container from a circuit solve. |
- class geopulse.solver.base.Solver[source]
Bases:
ABCAbstract 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 forSolverResult, and any solver-specific data (transformer types for MNA, netlist for PySpiceSolver, …).network_admittance (
ndarray) –Y_nmatrix. Shape(n_nodes, n_nodes). Units: Siemens.earthing_impedance (
ndarray) –Z_ediagonal matrix. Shape(n_nodes, n_nodes). Units: Ohms.thevenin_voltages (
ndarray) –V_thper branch. Shape(n_branches,)or(n_times, n_branches). Units: Volts.
- Return type:
- Returns:
SolverResult – Node voltages and branch currents.
- class geopulse.solver.base.SolverResult(node_voltages_V, branch_currents_A, node_ids, branch_ids)[source]
Bases:
objectResult 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:
- branch_currents_A
Current in each branch, in Amperes. Shape
(n_branches,)or(n_times, n_branches).- Type:
- node_ids
Ordered node IDs matching the columns of
node_voltages_V.
- branch_ids
Ordered branch IDs matching the columns of
branch_currents_A.