Characterising a location without its electrode¶
What does the network do at a given station, independently of the electrode installed there?
Adding an electrode is a rank-one change to the nodal matrix, so every nodal
voltage is a Möbius function of its admittance. Two solves with the electrode
removed therefore determine the response for every electrode, exactly and at
no further cost — measured against genuine solves from 0.05 Ω to 500 Ω and at a
complex value, the closed form agrees to 3e-15 relative.
The two extremes — no electrode and an ideal one — are the endpoints of that
curve, and both are exact limits rather than numerical stand-ins. Z_network,
the driving-point impedance with the local electrode removed, is the
site-independent number the whole analysis is built around.
See Characterising a location without its electrode.
response ¶
Characterise a location in the network independently of the electrode there.
The idea this module implements: to describe what the network does at a given station, remove the station's own electrode and ask what is left. Whatever electrode is eventually installed there only ever appears as one shunt admittance, so the network's contribution can be stated once and the electrode varied afterwards -- including to its two extremes, an ideal electrode and none at all.
That intuition turns out to be exact rather than approximate. Adding a shunt
Y_B at bus b is a rank-one change to the nodal matrix, so by the
Sherman-Morrison identity every nodal voltage is a Möbius function of it:
.. math::
\underline{u}(Y_B) = \underline{u}_0
- \frac{Y_B\, \underline{z}\, u_{0,b}}{1 + Y_B Z_\text{net}}
with three site-independent objects, all obtained without knowing the electrode:
u_0
the nodal voltages of the fault solve with the electrode removed -- the
open-circuit response of the location;
z
the column Y_0^{-1} e_b, i.e. the voltage everywhere per ampere injected
at b, source-free;
Z_net = z_b
the driving-point impedance of everything except the local electrode --
the parallel impedance the network offers at that point.
Two solves therefore determine the response for every electrode, exactly and
at no further cost. Measured against real solves at Z_B from 0.05 Ω to 500 Ω
and at a complex value, the closed form agrees to 2e-15 relative.
The extremes
Z_B → ∞ (no electrode) and Z_B → 0 (ideal electrode) are the endpoints of
that curve and both are exact limits, not numerical stand-ins -- the ideal
electrode in particular, which the solver itself rejects because a zero impedance
is not a passive value it can invert.
The driving-point impedance is exactly Z_dp(Y_B) = 1/(Y_B + 1/Z_net). Whether
its magnitude falls as the electrode improves depends on the electrode's phase.
Along Y_B = t e^{j\varphi} with t growing,
d|Y_B + 1/Z_net|^2/dt = 2t + 2\,Re(e^{j\varphi}\,\overline{1/Z_net}), so
|Z_dp| falls monotonically from |Z_net| to zero if and only if
cos(\varphi - arg(1/Z_net)) >= 0. A resistive electrode (real Y_B >= 0)
always qualifies, because Re(1/Z_net) >= 0 in a passive network, and so does
one in phase with 1/Z_net. A reactive electrode of the opposite sign to the
network's susceptance does not: it first raises |Z_dp| above |Z_net|.
The largest magnitude over all passive electrodes is reached at
Y_B = -j\,Im(1/Z_net), which cancels the network's susceptance and gives
|Z_dp| = 1/Re(1/Z_net) = |Z_net|/cos(arg Z_net). That is 0.08 % above
|Z_net| where the network seen from the bus is nearly resistive
(arg Z_net = 2.2°) but 57 % at the far end of a four-bus cable chain
(arg Z_net = 50°), so it is reported next to the two endpoints rather than
assumed to be negligible.
The EPR-based reduction factor
ResultReductionFactor.value is |u_F|/|u_F^{\,\text{no mutual}}| at the
fault bus. When the bus being varied is the fault bus, the closed form
makes it constant along the whole curve: the voltage there is
u_b(Y_B) = u_{0,b} / (1 + Y_B Z_\text{net}) with and without mutual coupling
alike, so the denominator cancels out of the quotient exactly. That is the same
invariance the sensitivity study runs into, here derived rather than measured.
Away from the fault bus it does not cancel: the fault-bus voltage is
u_F(Y_B) = u_{0,F} - Y_B z_F u_{0,b} / (1 + Y_B Z_\text{net}), a difference
whose two terms scale differently, and the quotient moves with the electrode
(1.147 / 1.056 / 0.973 over Z_B = 0.1 / 10 / 1000 Ω on the four-bus chain of
the review). It is therefore evaluated per electrode, from a third right-hand
side of the same factorisation -- the mutual-free injection vector -- rather than
carried through as an invariant.
The three cases are extremes of the local quantities only -- the potential
rise at the bus itself and its driving-point impedance. Quantities transferred
to other buses are not bounded by them: the EPR at a remote bus and the
current-based reduction factor can both exceed the ideal value for a
passive, purely capacitive Z_B, because the phase of Y_B enters those
through a different combination than through 1 + Y_B Z_net alone. Use
:meth:BusResponse.sweep -- which costs no solve -- when the worst case of a
transfer quantity is what a study needs.
BusResponse ¶
Bases: BaseModel
Closed-form response of the network to the electrode at one bus.
Built by :func:bus_response. Evaluating it costs no solve.
Attributes:
| Name | Type | Description |
|---|---|---|
fault |
str
|
Fault the response was built for. |
bus |
str
|
Bus whose electrode is the free parameter. |
fault_bus |
str
|
Bus the fault sits on. Used to anchor which group of buses is named as feeding the soil when the earth-return current is split. |
frequencies |
list of float
|
Frequencies covered. |
bus_names |
list of str
|
The active buses of the network, in the order of the nodal system; the keys of the voltage dictionaries. |
z_network |
dict of float to complex
|
Driving-point impedance at |
u_open |
dict of float to dict of str to complex
|
Nodal voltages with the local electrode removed. |
u_open_no_mutual |
dict of float to dict of str to complex
|
The same, for the injection vector without the mutual Norton
equivalents -- the third right-hand side of the same factorisation.
It is what makes the EPR-based reduction factor evaluable per electrode
instead of assumed invariant. Empty when the solve carried no mutual-free
vector, in which case :meth: |
other_impedance |
dict of float to dict of str to complex
|
Per frequency, the electrode impedance of every bus that carries one, the response bus included; what splits the earth-return current between the electrodes. |
z_column |
dict of float to dict of str to complex
|
Voltage at every bus per ampere injected at |
r_epr |
dict of float to float or None
|
The EPR-based reduction factor of the solved fault, i.e. for the
electrode that was installed at |
i_fault |
dict of float to complex
|
Fault current, the negated sum of source injections. Constant. |
z_fault_open |
dict of float to complex
|
Driving-point impedance of the earthing network at the fault bus
with the electrode at |
z_fault_transfer |
dict of float to complex
|
Transfer impedance between |
z_bus_open |
dict of float to complex
|
Driving-point impedance at |
z_fault_ideal |
dict of float to complex
|
Where the electrode at |
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> _ = gi.run_fault(net, "fault")
>>> response = gi.bus_response(net, fault="fault")
>>> response.bus, round(abs(response.z_network[50.0]), 4)
('bus3', 1.0965)
>>> frame = response.sweep([0.5, 1.0, 2.0])
>>> [round(v, 2) for v in frame["EPR_V"]]
[11.73, 18.03, 24.28]
admittance ¶
Translate an electrode spelling into a shunt admittance.
None and an infinite impedance both mean no electrode
(Y_B = 0); a zero impedance means an ideal one and is returned as
inf, which :meth:voltages handles as a limit rather than a
division.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode impedance in ohms; |
required |
Returns:
| Type | Description |
|---|---|
complex
|
The shunt admittance |
Notes
The electrode is a value, not a frequency-dependent model: the
frequency dependence lives in :attr:z_network and in whatever the
caller passes per frequency. The method therefore takes no frequency:
a parameter it never read would promise an influence it does not
have.
Source code in src/groundinsight/analysis/response.py
driving_point ¶
Z_dp = 1 / (Y_B + 1/Z_net) -- the impedance seen at bus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode at |
required |
frequency
|
float
|
One of the frequencies of the response, in Hz. The former
keyword |
required |
Returns:
| Type | Description |
|---|---|
complex
|
The driving-point impedance in Ohm. |
Source code in src/groundinsight/analysis/response.py
evaluate ¶
Everything the location does for one electrode, as one frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode. |
required |
label
|
str
|
Value of the |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per frequency: |
Notes
r_epr is evaluated for this electrode at the fault bus (see the
module docstring); it is constant across electrodes only when bus is
the fault bus. Z_G_Ohm is the EN 50522 earthing impedance
|Z_E|: the driving-point impedance of the earthing network at the
fault bus for this electrode (:meth:fault_driving_point), the same
definition :func:~groundinsight.network_operations.run_fault reports.
For bus == fault_bus it equals
Z_driving_point_Ohm when the network has no voltage source.
Source code in src/groundinsight/analysis/response.py
extremes ¶
The bracket: no electrode, ideal electrode, and the passive worst case.
Three rows per frequency, labelled "open", "ideal" and
"worst_passive". The first two are the endpoints of the curve; the
third is the reactive electrode that maximises the driving-point
magnitude (see :meth:worst_case_electrode).
Returns:
| Type | Description |
|---|---|
DataFrame
|
The rows of :meth: |
Source code in src/groundinsight/analysis/response.py
fault_driving_point ¶
Z_E, the driving-point impedance at the fault bus, for one electrode.
The electrode sits at bus; the impedance is the one seen at the
fault bus.
The shunt Y_B at bus is a rank-one change of the earthing
network, so the fault-bus driving point is Möbius in it as well:
Z_FF(Y_B) = Z0_FF - Y_B * Z0_Fb**2 / (1 + Y_B * Z0_bb)
with both endpoints as exact limits. It is the quantity
run_fault reports as ResultReductionFactor.z_earthing and as
the grounding impedance; for bus == fault_bus it
reduces to :meth:driving_point of a network without voltage source.
Where the electrode at bus is the only one of the fault side
(:attr:z_fault_ideal), every ampere leaves through it and
Z_FF = Z_B + z_fault_ideal: finite for every electrode, undefined
without one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode at |
required |
frequency
|
float
|
Frequency in Hz. |
required |
Returns:
| Type | Description |
|---|---|
complex or None
|
|
Source code in src/groundinsight/analysis/response.py
sweep ¶
sweep(
z_values: Sequence[ElectrodeSpec],
*,
labels: Optional[Sequence[str]] = None,
) -> pl.DataFrame
Evaluate many electrodes at once. No solve, whatever the length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_values
|
sequence
|
Electrodes, in the spellings :meth: |
required |
labels
|
sequence of str
|
One label per value. Defaults to a rendering of each value. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
The rows of :meth: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/groundinsight/analysis/response.py
voltages ¶
Nodal voltages for one electrode at one frequency.
Both endpoints are evaluated as limits, so an ideal electrode gives
exactly zero at bus instead of a very small number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode at |
required |
frequency
|
float
|
One of the frequencies of the response, in Hz. The former
keyword |
required |
Returns:
| Type | Description |
|---|---|
dict of str to complex
|
The EPR phasor per bus. |
Source code in src/groundinsight/analysis/response.py
voltages_no_mutual ¶
The same, for the injection vector without the mutual Norton sources.
This is the denominator of the EPR-based reduction factor. None when
the response was built without that right-hand side.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_bus
|
(complex, float or None)
|
The electrode at |
required |
frequency
|
float
|
One of the frequencies of the response, in Hz. The former
keyword |
required |
Returns:
| Type | Description |
|---|---|
dict of str to complex or None
|
The EPR phasor per bus without mutual coupling. |
Source code in src/groundinsight/analysis/response.py
worst_case_electrode ¶
The passive electrode that maximises |Z_dp|, and the value it gives.
Over the closed right half-plane of Y_B the magnitude of
1/(Y_B + Y_net) is largest where the imaginary parts cancel and the
real part is as small as it can be, i.e. at Y_B = -j*Im(Y_net). The
result exceeds |Z_net| only slightly in a cable network, but it is
the true bound rather than an assumed one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
float
|
One of the frequencies of the response, in Hz. The former
keyword |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/groundinsight/analysis/response.py
bus_response ¶
Build the closed-form response of the network to the electrode at one bus.
Requires a solved fault: the assembled nodal system is reused, the bus's own shunt is taken back out of it, and three right-hand sides are solved against the one factorisation -- the fault with the electrode removed, a unit injection at the bus, and the same fault without the mutual Norton equivalents. None of them depends on the electrode, which is why the result covers every electrode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
A network with |
required |
fault
|
str
|
The solved fault. |
required |
bus
|
str
|
Bus whose electrode is the free parameter. Defaults to the fault bus. |
None
|
Returns:
| Type | Description |
|---|---|
BusResponse
|
The response of the network to the electrode at |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the fault has not been solved, if the bus is unknown or inactive, or if the network without that electrode has no path to reference earth -- in which case there is nothing to characterise, because the location's behaviour is its own electrode. |
Examples:
The fault bus of the minimal network, with its own electrode as the free parameter -- every electrode is evaluated without another solve:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> _ = gi.run_fault(net, "fault")
>>> response = gi.bus_response(net, fault="fault", bus="bus3")
>>> row = response.evaluate(1.0)
>>> round(row["EPR_V"].item(), 2)
18.03
Source code in src/groundinsight/analysis/response.py
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 | |