Conductors¶
A Conductor connects two nodes of the network (electrodes or
junctions) or two points: a PEN conductor of a low-voltage network, a
cable screen, a bare bonding wire, an overhead earth wire or a
measurement lead. Unlike an electrode it is not an equipotential body:
it has a series impedance, and depending on its settings it carries
inductance and leaks current into the soil along its length.
Mathematical and physical context¶
A conductor of length \(\ell\), wire radius \(a\), material resistivity \(\rho_\text{mat}\) and cross section \(A\) is a branch of the nodal system with
where \(L_\text{Neumann}\) (self and mutual, from the segment geometry)
and the earth-return correction \(\Delta Z_\text{earth}\) (Carson or
Sommerfeld) are assembled in Coupling when the conductor
sets inductance_model="neumann". The settings that decide the model:
| Field | Values | Meaning |
|---|---|---|
cross_section |
None (default) |
ideal connection: both end nodes form one galvanic cluster |
float (m²) or "from_radius" (\(\pi a^2\)) |
finite resistance \(R = \rho_\text{mat}\ell/A\) | |
lumped_series_resistance_ohm |
Ω | replaces the geometric \(R\) |
discretize_segment_length |
m | distributed conductor: a chain of branches with this segment length (needs a finite resistance) |
coupling_to_soil |
"isolated" (default), "galvanic" |
insulated cable, or bare wire that leaks along its length like an electrode |
inductance_model |
None (default), "neumann" |
resistive branch only, or Neumann inductance with the engine's earth-return model (Engine.earth_inductive_model) |
resistance_model |
"dc" (default), "skin" |
\(R\) at every frequency, or the exact internal impedance of a solid round wire (Bessel functions) |
Units. Lengths and radii in m, cross_section in m²
(95 mm² is 95e-6), resistivity in Ω·m (copper 1.68e-8, the
default). A cross section above MAX_PLAUSIBLE_CROSS_SECTION
(10⁻² m²) warns with CrossSectionUnitWarning, because a value given in
mm² would otherwise be a silent near-ideal short.
Skin effect. With resistance_model="skin" the internal impedance
per unit length is
(Schelkunoff 1934), which tends to \(\rho_\text{mat}/(\pi a^2) + j\omega\mu_0/(8\pi)\) at low frequency. Below 1 kHz the effect matters only for thick conductors: the skin depth of copper at 1 kHz is about 2 mm.
Example¶
import groundfield as gf
world = gf.create_world(soil=gf.TwoLayerSoil(rho_1=100.0, rho_2=500.0, h_1=1.0))
gf.create_electrode(world, "ring", name="g1", center=(0.0, 0.0, 0.8), radius=3.0)
gf.create_electrode(world, "ring", name="g2", center=(40.0, 0.0, 0.8), radius=3.0)
pen = gf.create_conductor(
world, name="pen_1", start="g1", end="g2",
conductor_type="pen",
cross_section=95e-6, # 95 mm² in m²
discretize_segment_length=2.0, # distributed: about 20 inductive segments
inductance_model="neumann", # with the engine's earth-return model
)
assert abs(pen.length - 40.0) < 1e-12 # m, from (3, 0, 0.8) on g1 to (43, 0, 0.8) on g2
assert abs(pen.series_resistance - 1.68e-8 * 40.0 / 95e-6) < 1e-15 # 7.1 mΩ
The conductor object is geometry and material only; the earth-return
model is chosen on the engine (earth_inductive_model, default
"sommerfeld"), so the same world can be solved with different
earth-return models. The theory is on the
earth return page.
find_close_wires and find_close_conductors report pairs of wires
that are closer than the thin-wire model allows (interpenetrating,
crossing or very close); diagnose runs them before a
solve.
API reference¶
conductors ¶
Conductors, PEN, and cable shields.
Subpackage for all current-carrying elements above and inside the soil that are not electrodes themselves but still take part in the current distribution:
- overhead lines (phase conductor, earth wire),
- cables (phase + shield, concentric or three-core),
- PEN conductors in TN low-voltage networks,
- auxiliary electrodes for grounding measurements.
Contents
Conductor
Single conductor segment with end-point coordinates and a type tag
("pen", "cable_shield", "bare_copper", "overhead",
"generic"), its series resistance and — with
resistance_model="skin" — its frequency-dependent internal
impedance.
ConductorType, ResistanceModel
Literal unions of the supported type tags and resistance models.
CrossSectionUnitWarning
Raised for cross sections that look like mm² entered as m².
solid_round_internal_impedance
Exact internal impedance per unit length of a solid round wire
(skin effect).
find_close_wires, find_close_conductors, WireProximity
Detection of close, interpenetrating and crossing wire pairs.
Notes
Carson corrections for the earth-return path are not computed here;
they enter via groundfield.coupling. This keeps the conductor
model purely geometric and material-based, so it can be combined with
different earth-return models.
ConductorType
module-attribute
¶
Kind of a conductor (Conductor.conductor_type).
"pen": PEN conductor of a low-voltage network;"cable_shield": cable shield, a thin-walled tube around its core (user decisions Q32 / Q33);"bare_copper": bare copper wire;"overhead": overhead line or earth wire;"generic": fallback.
MAX_PLAUSIBLE_CROSS_SECTION
module-attribute
¶
Largest cross section in m² accepted without a warning (100 cm²).
Real conductors stay far below it; a value in mm² does not.
ResistanceModel
module-attribute
¶
Series-resistance model of a conductor (Conductor.resistance_model).
"dc":rho * L / Aat every frequency (the default);"skin": the exact internal impedance of a solid round wire (Bessel solution).
Conductor ¶
Bases: BaseModel
Wire segment between two points.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Unique name within the |
start, end |
Start and end point |
|
start_electrode, end_electrode |
Optional name of the electrode anchored at start / end. If
both are set, the solver inserts this conductor as a branch
in the nodal analysis: ideal ( |
|
conductor_type |
ConductorType
|
Type tag from |
wire_radius |
float
|
Wire radius in metres. Default 5 mm. Used for the geometric
thin-wire approximation in the segment self-action and as
a fallback for |
resistivity |
float
|
Material resistivity in \(\Omega\,\mathrm{m}\). Default: copper (1.68e-8). |
cross_section |
float | Literal['from_radius'] | None
|
Conductor cross section in \(\mathrm{m}^2\). |
effective_cross_section
property
¶
Resolved cross section in \(\mathrm{m}^2\) or None.
Returns:
| Type | Description |
|---|---|
float or None
|
|
is_distributed
property
¶
True iff the conductor is split into sub-segments.
A distributed conductor has a finite
discretize_segment_length — the solver builds one
longitudinal segment per sub-piece. False keeps the
conductor lumped (single branch between the two end electrodes).
is_shield
property
¶
Whether the conductor is a cable shield ("cable_shield").
A shield is a thin-walled tube: no internal inductance of a solid wire, and a thinner conductor on its axis is its core (user decisions Q32 and Q33 of 2026.11).
n_segments
property
¶
Number of segments produced by the discretiser.
Returns 1 for a lumped conductor. Otherwise
\(n = \lceil L / \Delta s \rceil\) with \(L\) the
Euclidean length and $\Delta s =
$ discretize_segment_length, with the round-off allowance
of the electrode wires
(_segment_count()): a
conductor that exceeds a whole number of pieces only through the
round-off of its end points gets no extra piece. Up to the
calendar release the count had no allowance, so a 60 m
counterpoise in 10 m pieces got 7 instead of 6 at projected (UTM)
coordinates, where its computed length is 60.0000000012 m.
series_resistance
property
¶
Series DC resistance \(R_\text{ser}\) in Ω.
Resolution order:
- If
lumped_series_resistance_ohmis set (ADR-0012 V1 concrete-shell path or any user-supplied lumped override), return that value verbatim. - Otherwise compute the geometric formula
\(R = \rho_\text{mat}\, L / A\) from
resistivity,lengthandeffective_cross_section. - If
cross_sectionisNone, the conductor is in the ideal-galvanic-short branch and the series resistance is0.0.
Returns:
| Type | Description |
|---|---|
float
|
Total series resistance in Ω consumed by the solver's distributed-conductor model (ADR-0003). |
internal_impedance_per_length ¶
Internal series impedance per unit length in Ω/m.
The conductor's own longitudinal impedance \(Z'_\text{int} =
R'(f) + j\omega L'_\text{int}(f)\), excluding the external
(thin-wire / earth-return) inductance of
groundfield.coupling.
resistance_model="dc": \(R' = R_\text{ser}/L\) and the uniform-current internal inductance \(\mu_0/(8\pi)\) — the convention ofgroundfield.coupling.inductance.thin_wire_self_inductance()withinclude_internal=True; a"cable_shield"(a thin-walled tube) has none (user decision Q33). An ideal conductor has \(R' = 0\).resistance_model="skin": the exact solid-round Bessel solution for the radius \(\sqrt{A/\pi}\) of the conducting cross section (solid_round_internal_impedance()).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
float | ndarray
|
Frequency in Hz (scalar or array, |
required |
Returns:
| Type | Description |
|---|---|
complex or ndarray
|
Internal impedance per unit length in Ω/m. |
Source code in src/groundfield/conductors/conductor.py
is_ideal ¶
Return True when the conductor acts as a galvanic short.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Resistance threshold in Ω. Conductors at or below this
value are treated as ideal by the solver. Default
|
_IDEAL_RESISTANCE_THRESHOLD
|
Source code in src/groundfield/conductors/conductor.py
skin_correction_per_length ¶
Skin-effect correction to the DC convention, in Ω/m.
\(\Delta Z' = Z'_\text{int}(f) - [R'_\text{dc} + j\omega\mu_0/(8\pi)]\):
what a solver that assembles \(R_\text{dc}\) and the DC internal
inductance (include_internal=True) has to add per metre of
branch length. Zero for resistance_model="dc".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
float | ndarray
|
Frequency in Hz (scalar or array, |
required |
Returns:
| Type | Description |
|---|---|
complex or ndarray
|
Correction per unit length in Ω/m. |
Source code in src/groundfield/conductors/conductor.py
CrossSectionUnitWarning ¶
Bases: UserWarning
A conductor cross section is implausibly large for m².
Conductor.cross_section is in m². A value above
MAX_PLAUSIBLE_CROSS_SECTION almost always means the value
was given in mm² (50 instead of 50e-6), which turns the
conductor into an ideal short (series resistance in the nΩ range).
Silence with warnings.simplefilter("ignore", CrossSectionUnitWarning)
when a huge cross section is intended (e.g. a deliberate near-ideal
bond).
WireProximity
dataclass
¶
WireProximity(kind: ProximityKind, name_a: str, name_b: str, index_a: int, index_b: int, distance: float, clearance: float, point_a: tuple[float, float, float], point_b: tuple[float, float, float])
One pair of wire segments that are too close.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
ProximityKind
|
|
name_a |
str
|
Owner name of the first segment (e.g. a conductor name). |
name_b |
str
|
Owner name of the second segment. |
index_a |
int
|
Index of the first segment in the input arrays. |
index_b |
int
|
Index of the second segment in the input arrays. |
distance |
float
|
Minimum axis-to-axis distance \(d\) in m. |
clearance |
float
|
Surface-to-surface distance \(d - (a_a + a_b)\) in m; negative when the wires interpenetrate. |
point_a |
tuple[float, float, float]
|
Closest point on the axis of the first segment, |
point_b |
tuple[float, float, float]
|
Closest point on the axis of the second segment, |
find_close_conductors ¶
find_close_conductors(conductors: Iterable[Conductor], *, rel_threshold: float = 5.0, abs_threshold: float = 0.0, include_junctions: bool = False) -> list[WireProximity]
find_close_wires() for Conductor objects.
Every conductor is one straight wire from start to end with
its wire_radius; pairs are reported by conductor name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conductors
|
Iterable[Conductor]
|
Conductors, e.g. |
required |
rel_threshold
|
float
|
See |
5.0
|
abs_threshold
|
float
|
See |
5.0
|
include_junctions
|
float
|
See |
5.0
|
Returns:
| Type | Description |
|---|---|
list of WireProximity
|
Close / interpenetrating / crossing conductor pairs, worst first. |
Source code in src/groundfield/conductors/proximity.py
find_close_wires ¶
find_close_wires(endpoints: ndarray, radii: Sequence[float] | ndarray, names: Sequence[str], *, rel_threshold: float = 5.0, abs_threshold: float = 0.0, include_junctions: bool = False) -> list[WireProximity]
Find segment pairs of different owners that are too close.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoints
|
ndarray
|
Segment end points, shape |
required |
radii
|
Sequence[float] | ndarray
|
Wire radius of every segment in m, shape |
required |
names
|
Sequence[str]
|
Owner name of every segment (conductor or electrode name),
length |
required |
rel_threshold
|
float
|
A pair is reported when its axis distance is below
|
5.0
|
abs_threshold
|
float
|
Additional absolute threshold in m (default 0); the larger of the two applies. |
0.0
|
include_junctions
|
bool
|
Also report pairs that only meet at a shared end point (default
|
False
|
Returns:
| Type | Description |
|---|---|
list of WireProximity
|
Sorted by ascending clearance (worst first). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/groundfield/conductors/proximity.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
segment_distance ¶
segment_distance(p1_a: ndarray, p2_a: ndarray, p1_b: ndarray, p2_b: ndarray) -> tuple[np.ndarray, np.ndarray, np.ndarray]
Minimum distance between straight segments (vectorised).
Closest points \(p_a(s) = p_{1,a} + s\,d_a\) and \(p_b(t) = p_{1,b} + t\,d_b\) with \(s, t \in [0, 1]\), by the standard clamped two-segment algorithm (Ericson 2005, sec. 5.1.9). Parallel segments and zero-length segments (points) are handled explicitly: the distance of a point to a segment is that of its orthogonal projection, clamped to the segment (audit of review pass 10, F04: a point-like second segment was measured from the start of the first one).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p1_a
|
ndarray
|
End points, arrays of shape |
required |
p2_a
|
ndarray
|
End points, arrays of shape |
required |
p1_b
|
ndarray
|
End points, arrays of shape |
required |
p2_b
|
ndarray
|
End points, arrays of shape |
required |
Returns:
| Type | Description |
|---|---|
distance, s, t : np.ndarray
|
Distance in m and the segment parameters of the closest points,
each of shape |
Source code in src/groundfield/conductors/proximity.py
solid_round_internal_impedance ¶
solid_round_internal_impedance(frequency: float | ndarray, *, radius: float, resistivity: float) -> complex | np.ndarray
Internal series impedance per unit length of a solid round wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
float | ndarray
|
Frequency in Hz (scalar or array, |
required |
radius
|
float
|
Conductor radius \(a\) in m (the radius of a solid conductor with the same conducting cross section, \(a = \sqrt{A/\pi}\)). |
required |
resistivity
|
float
|
Conductor resistivity \(\rho\) in Ω·m. |
required |
Returns:
| Type | Description |
|---|---|
complex or ndarray
|
\(Z'_\text{int} = R'(f) + j\omega L'_\text{int}(f)\) in Ω/m;
at |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/groundfield/conductors/skin.py
Conductor options and constants¶
The literal types of the Conductor settings that the package namespace
does not re-export, and the constants of the conductor models.
SoilCoupling
module-attribute
¶
Galvanic coupling of a conductor to the soil (Conductor.coupling_to_soil).
"isolated": cable or PEN inside an insulating jacket, no leakage;"galvanic": bare copper or exposed shield, leakage along the wire.
InductanceModel
module-attribute
¶
Inductance model of a conductor (Conductor.inductance_model).
"neumann": Neumann double-line integrals plus the earth-return model of the engine (Engine.earth_inductive_model).
ProximityKind
module-attribute
¶
Kind of a close wire pair (WireProximity.kind).
"crossing": the axes intersect inside both segments;"touching": the end point of one segment lies on the interior of the other (a T-contact the model does not connect);"interpenetrating": the axis distance is below the sum of the radii;"close": the axis distance is below the reporting threshold;"junction": the two segments only share an end point.
The exact criteria are in the module docstring.
MU_0
module-attribute
¶
Vacuum permeability μ0 = 4π · 10⁻⁷ H/m (the conventional value).