Network decomposition at the fault location¶
Split the grounding network at the faulted station into named directions, and quantify each of them: what parallel grounding impedance it contributes, and what share of the fault current leaves through it.
The impedances come from source-free current division and add up to the driving-point impedance of the whole network exactly, in a radial network and in a ring alike. The currents come from a solved fault and describe how the fault current actually divides. See Splitting the network at the fault for the definitions and their limits.
decomposition ¶
Split a grounding network at the fault location into parallel sides.
The question this module answers is the one a cable-network study starts from: of everything that is bolted onto the faulted station, how much grounding does each direction actually contribute, and how does the fault current divide between them?
parallel impedance left --- fault location --- parallel impedance right
A cut is a named set of branches, all of them incident to the fault bus. Removing the cut separates a far side from the near side that holds the fault bus. Two families of quantity are then computed for each cut, and they answer different questions:
Impedances -- a property of the network, not of the fault.
Z_side is obtained by current division, which keeps it exact in any
topology. One ampere is injected at the fault bus into the network with all
sources and all mutual injections removed; the share of it that leaves through
each cut is read off, and Z_side = u_fault / i_cut. Because the shares and
the local electrode current add up to the injected ampere, the decomposition
closes by construction:
.. math::
\frac{1}{Z_\text{driving point}} = \frac{1}{Z_\text{local}}
+ \sum_\text{sides} \frac{1}{Z_\text{side}}
and the residual of that identity is reported next to the values, so a study
never has to take it on trust. The matrix the ampere is injected into is the
solver's own, taken from network.electrical_network whenever a fault has
been solved: assembling a second one from the same fields lets the two drift --
a 0 Hz short read as an open circuit here and as a small finite value there, a
Thevenin loop closure present in one and absent from the other -- and a
decomposition of a different matrix than the one that was solved answers a
question nobody asked. Because Z_side is source-free it does not
change when the fault bus's own rho-f characteristic is varied -- which is the
useful statement: the network's parallel contribution is a fixed property, the
local electrode is the variable, and the total is their parallel combination.
An earlier formulation isolated each side into its own sub-network instead. That
is equivalent wherever the sides are galvanically separate, and wrong in a
ring: removing one branch of a ring separates nothing, the far side comes out
empty and the impedance comes out infinite. Current division has no such blind
spot -- in a ring both directions simply see much of the same network, which is
reported through sides_are_disjoint.
Currents -- how the fault current actually divides. Taken from a solved fault. Across a cut, the current crossing from the far side splits into a metallic part through the cable shields and a part travelling through the soil:
.. math::
\underline{I}_\text{total} = \underline{I}_\text{shield}
+ \underline{I}_\text{earth}
where I_earth is the sum of the electrode currents of every bus on the far
side and I_total is the sum of the source injections there. The reduction
factor of that side is r = |I_earth| / |I_total| -- the share of the current
crossing the cut that returns through the earth rather than through the shields.
Unlike the EPR-based reduction factor on Result, this one does respond to
the impedance at the fault bus, because the split between electrode and shields
is decided by that impedance.
A cut whose far side carries no source has I_total = 0: nothing has to
cross it, and whatever does is driven purely by the coupling. r is then
None rather than a division by zero, and Z_side is the quantity that
carries the meaning for that side.
I_earth, I_total and r all need a far side that belongs to one cut
alone. Where the sides overlap -- a ring -- they are None and
current_share = |I_shield| / |I_inj at the fault bus| is the quantity that
still holds: the fraction of the fault current that leaves the fault location
metallically in that direction. Together with the local share it always adds up
to the injected current.
Contract
Every branch of a cut must be incident to the fault bus. That is what makes the sides parallel elements at the fault bus and the identity above exact; a cut placed further out is a legitimate thing to want, but it is not a parallel element of the fault location and the sum would not close. Branches incident to the fault bus that no cut claims are collected into an implicit side so the decomposition always covers the whole network.
Cut ¶
Bases: BaseModel
A named set of branches separating one side of the network from the fault.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Label used in the result frame. Must not collide with the reserved
name |
branches |
list of str
|
Names of the branches forming the cut. All of them must exist, be active, carry a grounding conductor and be incident to the fault bus. |
description |
(str, optional)
|
Free text carried through to the result frame. |
Examples:
>>> import groundinsight as gi
>>> cut = gi.Cut(name="towards_source", branches=["b23"])
>>> cut.name, cut.branches
('towards_source', ['b23'])
CutAnalysis ¶
Bases: BaseModel
Result of :func:analyze_cuts for one fault.
Attributes:
| Name | Type | Description |
|---|---|---|
fault |
str
|
Name of the analysed fault. |
fault_bus |
str
|
Bus the fault sits on -- the reference point of the decomposition. |
frequencies |
list of float
|
Frequencies the analysis was run at. |
sides |
dict of str to list of str
|
Buses visible from the fault bus when looking out through that cut, with the other cuts' branches removed. In a ring the entries overlap. |
sides_are_disjoint |
bool
|
|
branches |
dict of str to list of str
|
The branches of each cut, including the implicit |
z_local |
dict of float to complex
|
Impedance of the fault bus's own electrode per frequency. |
z_side |
dict of str to dict of float to complex
|
Impedance of each direction, from source-free current division. |
z_parallel |
dict of float to complex
|
|
z_driving_point |
dict of float to complex
|
Driving-point impedance of the complete network at the fault bus, read
off the solver's assembled nodal system (its 0 Hz substitutes and
its Thevenin loop closures included). Equal to |
identity_residual |
dict of float to float
|
|
i_shield |
dict of str to dict of float to complex
|
Shield current leaving the fault bus in each direction. Empty when no solved result was available. |
i_fault, i_local |
dict of float to complex
|
Injection at the fault bus and the part of it taken by the fault bus's own electrode. |
current_share |
dict of str to dict of float to float or None
|
|
i_earth, i_total |
dict of str to dict of float to complex or None
|
Soil and total current crossing the cut, summed over the far side.
|
r_side |
dict of str to dict of float to float or None
|
|
kcl_residual |
dict of float to float
|
|
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> _ = gi.run_fault(net, "fault")
>>> analysis = gi.analyze_cuts(net, fault="fault",
... cuts=[gi.Cut(name="line", branches=["b23"])])
>>> analysis.has_currents, round(analysis.current_share["line"][50.0], 4)
(True, 0.8411)
has_currents
property
¶
True when a solved fault result was available.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the current columns of :meth: |
to_polars ¶
Return the analysis as one long-format frame.
One row per direction and frequency.
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per (cut, frequency), with a pinned schema and the columns fault, fault_bus, cut, side_buses, n_side_buses, branches, sides_are_disjoint, frequency_Hz, Z_side_Ohm, Z_side_deg, Z_local_Ohm, Z_parallel_Ohm, Z_driving_point_Ohm, identity_residual, I_fault_A, I_local_A, I_shield_A, I_shield_deg, current_share, I_earth_A, I_total_A, r_side, kcl_residual. |
Notes
The dtypes are pinned rather than inferred. Without a solved result the
nine current columns are all-null, and polars infers Null for them
-- a frame that then refuses to concat with one from a solved
analysis, which is exactly the comparison a study makes.
Source code in src/groundinsight/analysis/decomposition.py
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 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
analyze_cuts ¶
analyze_cuts(
network: Network,
*,
fault: str,
cuts: Sequence[Cut],
include_currents: bool = True,
) -> CutAnalysis
Split the network at the fault bus and quantify each direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Network
|
The network. Bus and branch impedances must have been evaluated at
|
required |
fault
|
str
|
Name of the fault whose bus is the reference of the decomposition. |
required |
cuts
|
sequence of Cut
|
Named sets of branches, each incident to the fault bus and disjoint from
the others. Incident branches that no cut claims form the implicit side
|
required |
include_currents
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
CutAnalysis
|
Impedances, currents and the residual of the parallel identity. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the fault is unknown, if a cut names a branch that is not an active grounding branch at the fault bus, or if two cuts claim the same branch. |
Examples:
>>> import groundinsight as gi
>>> from groundinsight.api.examples import build_minimal
>>> net = build_minimal()
>>> _ = gi.run_fault(net, "fault")
>>> analysis = gi.analyze_cuts(net, fault="fault",
... cuts=[gi.Cut(name="line", branches=["b23"])])
>>> frame = analysis.to_polars()
>>> [(cut, f, round(z, 9)) for cut, f, z in
... frame.select("cut", "frequency_Hz", "Z_side_Ohm").rows()]
[('line', 50.0, 1.096518338)]
Source code in src/groundinsight/analysis/decomposition.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 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 | |