Verification and validation¶
Two different questions decide whether a result can be trusted:
- Verification — does the code solve its model correctly? This page lists the evidence the package carries for that.
- Validation — does the model describe a real installation? That needs comparisons with measurements or with other programs, and for those the answer is plain: groundinsight is not yet validated against field measurements or other programs.
Closed-form reference cases¶
gi.run_reference_cases() runs six configurations whose answer is known in
closed form through the ordinary public API and compares. Each case names the
boundary conditions under which its closed form holds, and its docstring
derives the closed form, so it can be checked line by line against the
literature (see Reference cases). A deviation beyond the
tolerance means that either the model is wrong or a condition was not met.
The table below is produced when this site is built, from the cases in
REFERENCE_CASES and one run of gi.run_reference_cases():
| case | quantity | condition | closed form | model | rel. deviation | tolerance | agrees |
|---|---|---|---|---|---|---|---|
line_ideal_bonding |
reduction factor r [-] | single line, station electrodes negligible against the shield impedance | 0.5 | 0.499999 | 2.0e-06 | 1e-03 | yes |
line_finite_earthing |
reduction factor r [-] | single line, both ends earthed with a finite electrode | 0.005562082816 | 0.005562082816 | 7.8e-16 | 1e-09 | yes |
en50522_chain |
earth-return current I_E [A] | six-station chain, I_E re-derived from an independently assembled nodal system | 32.38457029 | 32.38457029 | 6.6e-16 | 1e-09 | yes |
ladder_input_impedance |
input impedance Z_in [Ohm] | chain long enough to be semi-infinite (80 sections here) | 1.403195874 | 1.403195879 | 3.1e-09 | 1e-06 | yes |
ladder_potential_decay |
potential ratio u_20/u_0 [-] | same chain, far enough from either end | 0.07852933524 | 0.07852931427 | 2.7e-07 | 1e-06 | yes |
parallel_decomposition |
driving-point impedance [Ohm] | cuts covering every branch at the station | 1.724271703 | 1.724271703 | 1.2e-15 | 1e-12 | yes |
Generated when this site was built, with groundinsight 2026.11.1.
The same call is a quick self-test of an installation (about 0.2 s):
import groundinsight as gi
table = gi.run_reference_cases()
print(table.select("case", "rel_deviation", "tolerance", "agrees"))
assert table["agrees"].all()
An independent solver in the test suite¶
The test suite carries a second solver for the stationary model,
tests/_reference_mna.py, written from the model description rather than from
the package code: modified nodal analysis with the branch currents as
unknowns, in the physical sign frame (the package eliminates the shield
currents and uses the reversed earth-side frame, see
Conventions). Against it,
run_fault is checked to 1e-12 on 17 structural networks — chains, rings,
meshes, parallel cables, mixed construction, open ends, two sources, a source
on the fault bus, 0/50/150/250 Hz, inactive elements.
On seeded random meshes the suite checks properties that any correct solution of the model must have, independent of a second implementation:
- Kirchhoff's current law at every bus and over the whole network;
- reciprocity without coupling: the voltage at one pair of buses per ampere injected at another pair equals the reverse;
- passivity and Tellegen's theorem without coupling: the real power the sources inject is positive and equals the losses in electrodes and shields.
On a long homogeneous cable run (64 sections) the fault-bus earth potential rise and the earthing impedance meet the closed forms of the ladder network, \(\lvert u_F\rvert = \lvert 1 - k\rvert\, I\,\lvert Z_\infty\rvert\) and \(Z_\infty = -Z'/2 + \sqrt{Z'^2/4 + Z_e Z'}\), to 1e-5.
Transient solvers¶
The FFT solver evaluates the stationary formulas per frequency bin, the
state-space solver integrates lumped R/L/C fields in time; the two are
cross-checked with each other and with the stationary solve in steady state. A
second transient solver in the test suite, tests/_transient_reference.py
(all branch currents as states, trapezoidal integration), checks the dynamics
of the state-space solver, including the phase-current split in a ring. The
FFT solver does not evaluate the inductive coupling of the branches and warns
when that matters (Transient simulation).
The examples in this documentation¶
The worked examples of the how-to pages are scripts in docs/snippets/ that
the test suite runs. The cable example of
Bus and branch types from data sheets is
computed three ways — closed form, Pollaczek's integral, run_fault — and the
EN 50522 example is checked against
an independent nodal solve.
What is not validated¶
No comparison with measured earthing impedances, earth potential rises or shield currents, and no comparison with another earthing program, is part of the package or its documentation. The model assumptions that such a comparison would test — and that bound what to expect from it — are:
- the coupling acts one way: the phase current is split first, then drives the shields; this is exact when all routes of a mesh have the same construction and an approximation otherwise (Phase currents);
- only the faulted phase conductor is modelled, not the healthy phases;
- electrodes are lumped impedances to remote earth, without resistive coupling between neighbouring electrodes;
- the soil is homogeneous per element (one
rhoper bus and per branch); - the stationary solve is quasi-stationary: no travelling waves, no soil ionisation;
- the impedances are the formulas the user supplies; the package checks their syntax and passivity, not their physics.
References¶
- Reference cases:
groundinsight.analysis.reference. - Test oracles:
tests/_reference_mna.py,tests/_transient_reference.py; physics regressionstests/test_audit_pass19_physics.py,tests/test_audit_pass19_transient.pyin the repository.