Help

Earth Fault Loop Calculator

Jump to section

Overview

The Earth Fault Loop Impedance Calculator determines whether a protective device (circuit breaker) will disconnect within the required time during an earth fault, as mandated by IEC 60364 and BS 7671.

It computes the total impedance of the earth fault loop — from the supply transformer, through the active (phase) conductor, through the fault, and back via the earth conductor — then compares this against the maximum impedance that still allows enough fault current to trip the breaker. The fault loop comprises:

  • Supply transformer impedance (optional)
  • Active (phase) conductor impedance — resistance and reactance over cable length
  • Earth conductor impedance — including optional supplementary earth path in parallel

If the calculated loop impedance \( Z_s \) is less than or equal to the maximum allowed impedance \( Z_{max} \), the circuit is compliant and the breaker will trip within the required disconnection time.

Input Parameters

Transformer (conditional on use_transformer)

Parameter Type Default Range Description
use_transformer Boolean False — Whether to include transformer impedance in the loop calculation
transformer_mva Number 1.0 min 0.01 Transformer rating in MVA
transformer_z_percent Number 6.0% 0.1 – 20% Transformer impedance percentage

Cable

Parameter Type Default Range Description
insulation_type Enum pvc pvc / xlpe Cable insulation type — affects resistance and reactance lookup values
active_csa Enum 4 mm² 1 – 500 mm² Active (phase) conductor cross-sectional area
earth_csa Enum 4 mm² 1 – 500 mm² Earth conductor cross-sectional area
cable_length Number 50 m min 0.1 Cable run length in metres

Supplementary Earthing (conditional on use_supplementary)

Parameter Type Default Range Description
use_supplementary Boolean False — Add a parallel supplementary earth conductor
supplementary_csa Enum 4 mm² 1 – 500 mm² Supplementary earth conductor cross-sectional area

Electrical

Parameter Type Default Range Description
nominal_voltage Number 230 V 100 – 1000 V Phase-to-neutral supply voltage (\( U_o \))
breaker_rating Number 32 A 1 – 1000 A Protective device nominal current (\( I_n \))
trip_curve Enum 7.5 4 / 7.5 / 12.5 Trip multiplier — Type B = 4, Type C = 7.5, Type D = 12.5

Output Results

Output Unit Description
zs Ω Total earth fault loop impedance
zmax Ω Maximum allowed impedance for disconnection
is_compliant Boolean Whether \( Z_s \leq Z_{max} \)
trip_current A Minimum fault current to trip the breaker (\( I_n \times K_t \))
transformer_impedance {r, x, Z} Ω Transformer R + jX and magnitude
active_impedance {r, x, Z} Ω Active conductor impedance
earth_main_impedance {r, x, Z} Ω Main earth conductor impedance
earth_equiv_impedance {r, x, Z} Ω Equivalent earth impedance (with parallel supplementary if used)
cable_loop_impedance {r, x, Z} Ω Combined cable loop impedance (active + earth)
total_loop_impedance {r, x, Z} Ω Total loop impedance = transformer + cable loop
table_8_2_check dict Compliance against Table 8.2 maximum impedance limits
table_b1_check dict Compliance against Table B1 maximum cable length limits

Formulas

Transformer Impedance

When a transformer is included, its impedance referred to the secondary (LV) side:

\[ V_{base} = U_o \times \sqrt{3} \] \[ |Z_t| = \frac{Z\%}{100} \times \frac{V_{base}^2}{S_{base}} \]

An X/R ratio of 10 is assumed for typical distribution transformers, giving the R and X components:

\[ R_t = \frac{|Z_t|}{\sqrt{1 + (X\!/\!R)^2}}, \qquad X_t = R_t \times (X\!/\!R) \]

where \( U_o \) is the nominal phase-to-neutral voltage, \( V_{base} \) is the line voltage, \( Z\% \) is the transformer impedance percentage, and \( S_{base} = S_{MVA} \times 10^6 \).

Cable Impedance per Length

Resistance and reactance are looked up from tables (per insulation type and CSA) and scaled by cable length:

\[ R_{cable} = R_{per\_km} \times \frac{L}{1000} \] \[ X_{cable} = X_{per\_km} \times \frac{L}{1000} \]

where \( L \) is the cable length in metres.

Active Conductor Impedance

\[ Z_a = R_a + jX_a \]

Earth Conductor Impedance

\[ Z_e = R_e + jX_e \]

Parallel Earth (with supplementary earthing)

When a supplementary earth conductor is used, the two earth paths combine in parallel:

\[ Z_{e,equiv} = \frac{Z_e \times Z_{supp}}{Z_e + Z_{supp}} \]

Cable Loop Impedance

\[ Z_c = Z_a + Z_{e,equiv} \]

Total Loop Impedance

\[ Z_s = Z_t + Z_c \] \[ |Z_s| = \sqrt{R_{total}^2 + X_{total}^2} \]

Trip Current

\[ I_a = I_n \times K_t \]

where \( K_t \) is the trip multiplier: Type B = 4, Type C = 7.5, Type D = 12.5.

Maximum Impedance

\[ Z_{max} = \frac{U_o}{I_a} = \frac{U_o}{I_n \times K_t} \]

Compliance Check

The circuit is compliant when:

\[ Z_s \leq Z_{max} \]

Data Tables

Resistance Data (Ω/km @ 50 Hz)

CSA (mm²) PVC R (Ω/km) XLPE R (Ω/km)
125.827
1.516.517.3
2.59.019.45
45.615.88
63.753.93
102.232.33
161.41.47
250.8840.927
350.6380.668
500.4710.494
700.3270.342
950.2360.247
1200.1880.197
1500.1530.16
1850.1230.129
2400.09480.0991
3000.0770.0803
4000.0620.0646
5000.05060.0525

Reactance Data (Ω/km @ 50 Hz)

CSA (mm²) PVC X (Ω/km) XLPE X (Ω/km)
10.1190.114
1.50.1110.107
2.50.1020.0988
40.1020.093
60.09670.0887
100.09060.084
160.08610.0805
250.08530.0808
350.08260.0786
500.07970.0751
700.0770.0741
950.07660.0725
1200.07430.0713
1500.07450.0718
1850.07440.072
2400.07350.0709
3000.07320.0704
4000.07280.0702
5000.07230.0707

Table 8.2 — Maximum Cable Resistance for Protection Devices (Ω)

Active CSA (mm²) CB Rating (A) Type B (×4) Type C (×7.5) Type D (×12.5)
2.5162.321.240.74
2.5201.861.000.60
4251.500.800.48
4321.170.620.37
6400.930.500.30
10500.760.400.24
16630.600.320.19

Table B1 — Maximum Cable Length for Protection Devices (m)

Active CSA (mm²) CB Rating (A) Type B (×4) Type C (×7.5) Type D (×12.5)
161709155
1101025533
1.5101538249
1.516965131
2.5161608551
2.5201286841
4201266740
432985231
640904829
10501176237
16631427645
16801125936
25801246640
25100995332
351001598551
351251276841
5012519810663
501601558351
7016023512675
7020018810060

Worked Examples

The 10 examples below are the validation cases for this calculation. Each one was produced by the calculation engine from the inputs shown, every figure was checked against the independent reference quoted at the end of the example, and the same cases are run against every engine build (see validation scorecard, tool fe_calc_efli; worked examples for every calculation).

#CaseZs (Ω)Zmax (Ω)If (A)Lmax (m)GoverningResult
110 mm² with 4 mm² earth, 60 m, 50 A type C — fails Table 8.20.47050.6133488.851table 8 2 loop resistanceFAIL
2Same circuit rescued by a 10 mm² supplementary earth0.22970.61331,001.362table b1 route lengthPASS
3120 mm² XLPE feeder, 200 m, 250 A type B at Uo = 400 V0.11160.40003,584.2716earth fault loop impedancePASS
42.5 mm² PVC, 40 m, 16 A type D (c0003)0.72081.1500319.141table 8 2 loop resistancePASS
54 mm² with 2.5 mm² earth, 50 m, 32 A type C (c0003)0.73100.9583314.642table 8 2 loop resistanceFAIL
64 mm² PVC, 25 m, 32 A type C (help-page example 1)0.28050.9583820.052table b1 route lengthPASS
725 m circuit with a 1 MVA 6 % source transformer (help-page example 2, c0003)0.28180.9583816.252table b1 route lengthPASS
84 mm² PVC, 30 m, 25 A type D (c0003)0.33660.7360683.342table 8 2 loop resistancePASS
96 mm² PVC, 150 m, 63 A type C — too long1.12500.4867204.464earth fault loop impedanceFAIL
106 mm² XLPE, 60 m, 40 A type B (c0003)0.47171.4370487.690table b1 route lengthPASS

Example 1 — 10 mm² with 4 mm² earth, 60 m, 50 A type C — fails Table 8.2

An undersized 4 mm² earth pushes the loop resistance past the Table 8.2 row while Zs itself still clears Zmax.

Given: 10 mm² PVC active with 4 mm² earth, route length 60 m, Uo = 230 V, 50 A type C MCB (trip multiple 7.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 10 mm² table: 2.23 + j0.0906 Ω/km → Z1 = (2.23 + j0.0906) × 60/1000 = 0.1338 + j0.0054 Ω
Earth conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z2 = (5.61 + j0.102) × 60/1000 = 0.3366 + j0.0061 Ω
Cable loopZcable = Z1 + Ze = (0.1338 + j0.0054) + (0.3366 + j0.0061) = 0.4704 + j0.0116 Ω; loop resistance R = 0.4704 Ω
Loop impedanceZs = |Zt + Zcable| = |0.4704 + j0.0116| = √(0.4704² + 0.0116²) = 0.4705 Ω; rounded down to 4 s.f. → 0.4705 Ω
Trip currentIa = In × k = 50 × 7.5 = 375 A; Zmax = Uo / Ia = 230 / 375 = 0.6133 Ω; rounded down to 4 s.f. → Zmax 0.6133 Ω, Ia 375 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 76.7 % of Zmax → 0.4705 vs limit 0.6133 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.4705 = 488.8 A ≥ Ia → 488.8 vs limit 375.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (10 mm², 50 A, type C) maximum loop resistance 0.40 Ω vs R = 0.4704 Ω → 0.4704 vs limit 0.4000 Ω FAIL
Table B1AS/NZS 3000 Table B1 row (10 mm², 50 A, type C) maximum length 62 m vs route 60 m → 60 vs limit 62 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.00784 + j0.00019)| = 0.6133 Ω → L = 78 m (≈ 0.6133 / 0.00784 Ω/m); Table 8.2: 0.40 / 0.00784 Ω/m = 51.0 → 51 m; Table B1: 62 m. Governing: 51 m (AS/NZS 3000 Table 8.2 resistance)
Result3/4 checks pass → FAIL; Zs 0.4705 Ω vs Zmax 0.6133 Ω; max route 51 m (AS/NZS 3000 Table 8.2 resistance); governing: table 8 2 loop resistance. Fails: table_8_2_loop_resistance. Options: shorten the route below 51 m, increase the active/earth size, use a lower-multiple curve, or provide additional protection such as an RCD (not assessed by this engine).
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 10 mm² 2.23 + j0.0906 Ω/km → Z1 = 0.13380 + j0.00544 Ω; earth 4 mm² 5.61 + j0.102 Ω/km → Z2 = 0.33660 + j0.00612 Ω; Zloop = 0.47040 + j0.01156 Ω; Zs = |0.47040 + j0.01156| = 0.47054 Ω; Ia = 50 × 7.5 = 375 A, Zmax = 230/375 = 0.61333 Ω; c0003 rounds down to 4 s.f.: Zs 0.4705 Ω, Zmax 0.6133 Ω, Ia 375 A; If = 230/0.4705 = 488.8 A; Zs = Zmax at 78.2 m → 78 m; Table 8.2 (10 mm², 50 A, C) 0.40 Ω: Rloop 0.4704 Ω > limit; 0.40/0.00784 = 51.0 → 51 m; Table B1 (10 mm², 50 A, C) 62 m: L 60 m ≤ limit (validation case c0003-10-4mm2-pvc-60m-50a-c-fail)

Example 2 — Same circuit rescued by a 10 mm² supplementary earth

Paralleling a 10 mm² supplementary earth with the 4 mm² earth brings the loop resistance back under the Table 8.2 limit.

Given: 10 mm² PVC active with 4 mm² earth plus a 10 mm² supplementary earth in parallel over the same route, route length 60 m, Uo = 230 V, 50 A type C MCB (trip multiple 7.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 10 mm² table: 2.23 + j0.0906 Ω/km → Z1 = (2.23 + j0.0906) × 60/1000 = 0.1338 + j0.0054 Ω
Earth conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z2 = (5.61 + j0.102) × 60/1000 = 0.3366 + j0.0061 Ω
Supplementary earthPVC 10 mm² table: 2.23 + j0.0906 Ω/km → Z3 = 0.1338 + j0.0054 Ω; in parallel: Ze = Z2·Z3 / (Z2 + Z3) = (0.3366 + j0.0061)(0.1338 + j0.0054) / (0.4704 + j0.0116) = 0.0958 + j0.0033 Ω
Cable loopZcable = Z1 + Ze = (0.1338 + j0.0054) + (0.0958 + j0.0033) = 0.2296 + j0.0087 Ω; loop resistance R = 0.2296 Ω
Loop impedanceZs = |Zt + Zcable| = |0.2296 + j0.0087| = √(0.2296² + 0.0087²) = 0.2297 Ω; rounded down to 4 s.f. → 0.2297 Ω
Trip currentIa = In × k = 50 × 7.5 = 375 A; Zmax = Uo / Ia = 230 / 375 = 0.6133 Ω; rounded down to 4 s.f. → Zmax 0.6133 Ω, Ia 375 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 37.5 % of Zmax → 0.2297 vs limit 0.6133 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.2297 = 1,001.3 A ≥ Ia → 1,001.3 vs limit 375.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (10 mm², 50 A, type C) maximum loop resistance 0.40 Ω vs R = 0.2296 Ω → 0.2296 vs limit 0.4000 Ω PASS
Table B1AS/NZS 3000 Table B1 row (10 mm², 50 A, type C) maximum length 62 m vs route 60 m → 60 vs limit 62 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.00383 + j0.00015)| = 0.6133 Ω → L = 160 m (≈ 0.6133 / 0.00383 Ω/m); Table 8.2: 0.40 / 0.00383 Ω/m = 104.6 → 104 m; Table B1: 62 m. Governing: 62 m (AS/NZS 3000 Table B1 length)
Result4/4 checks pass → PASS; Zs 0.2297 Ω vs Zmax 0.6133 Ω; max route 62 m (AS/NZS 3000 Table B1 length); governing: table b1 route length
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 10 mm² 2.23 + j0.0906 Ω/km → Z1 = 0.13380 + j0.00544 Ω; earth 4 mm² 5.61 + j0.102 Ω/km → Z2 = 0.33660 + j0.00612 Ω; supplementary 10 mm² Z3 = 0.13380 + j0.00544 Ω; Ze = Z2·Z3/(Z2+Z3) = 0.09575 + j0.00328 Ω; Zloop = 0.22955 + j0.00871 Ω; Zs = |0.22955 + j0.00871| = 0.22972 Ω; Ia = 50 × 7.5 = 375 A, Zmax = 230/375 = 0.61333 Ω; c0003 rounds down to 4 s.f.: Zs 0.2297 Ω, Zmax 0.6133 Ω, Ia 375 A; If = 230/0.2297 = 1001.3 A; Zs = Zmax at 160.2 m → 160 m; Table 8.2 (10 mm², 50 A, C) 0.40 Ω: Rloop 0.2296 Ω ≤ limit; 0.40/0.00383 = 104.6 → 104 m; Table B1 (10 mm², 50 A, C) 62 m: L 60 m ≤ limit (validation case c0003-10-4mm2-pvc-60m-50a-c-supp-10)

Example 3 — 120 mm² XLPE feeder, 200 m, 250 A type B at Uo = 400 V

A large feeder outside both tables: only the Zs and trip-current checks run, and the maximum route is where Zs reaches Zmax.

Given: 120 mm² XLPE active with 70 mm² earth, route length 200 m, Uo = 400 V, 250 A type B MCB (trip multiple 4); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorXLPE 120 mm² table: 0.197 + j0.0713 Ω/km → Z1 = (0.197 + j0.0713) × 200/1000 = 0.0394 + j0.0143 Ω
Earth conductorXLPE 70 mm² table: 0.342 + j0.0741 Ω/km → Z2 = (0.342 + j0.0741) × 200/1000 = 0.0684 + j0.0148 Ω
Cable loopZcable = Z1 + Ze = (0.0394 + j0.0143) + (0.0684 + j0.0148) = 0.1078 + j0.0291 Ω; loop resistance R = 0.1078 Ω
Loop impedanceZs = |Zt + Zcable| = |0.1078 + j0.0291| = √(0.1078² + 0.0291²) = 0.1117 Ω; rounded down to 4 s.f. → 0.1116 Ω
Trip currentIa = In × k = 250 × 4 = 1,000 A; Zmax = Uo / Ia = 400 / 1,000 = 0.4000 Ω; rounded down to 4 s.f. → Zmax 0.4 Ω, Ia 1,000 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 27.9 % of Zmax → 0.1116 vs limit 0.4000 Ω PASS
Fault currentIf = Uo / Zs = 400 / 0.1116 = 3,584.2 A ≥ Ia → 3,584.2 vs limit 1,000.0 A PASS
Table 8.2No AS/NZS 3000 Table 8.2 row for 120 mm², 250 A, type B — resistance table not checked
Table B1No AS/NZS 3000 Table B1 row for 120 mm², 250 A, type B — length table not checked
Max route lengthZs = Zmax when |Zt + L × (0.00054 + j0.00015)| = 0.4000 Ω → L = 716 m (≈ 0.4000 / 0.00056 Ω/m). Governing: 716 m (Zs = Zmax)
Result2/2 checks pass → PASS; Zs 0.1116 Ω vs Zmax 0.4000 Ω; max route 716 m (Zs = Zmax); governing: earth fault loop impedance
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); XLPE 120 mm² 0.197 + j0.0713 Ω/km → Z1 = 0.03940 + j0.01426 Ω; earth 70 mm² 0.342 + j0.0741 Ω/km → Z2 = 0.06840 + j0.01482 Ω; Zloop = 0.10780 + j0.02908 Ω; Zs = |0.10780 + j0.02908| = 0.11165 Ω; Ia = 250 × 4 = 1000 A, Zmax = 400/1000 = 0.40000 Ω; c0003 rounds down to 4 s.f.: Zs 0.1116 Ω, Zmax 0.4 Ω, Ia 1000 A; If = 400/0.1116 = 3584.2 A; Zs = Zmax at 716.5 m → 716 m; Table 8.2 has no row for 120 mm² / 250 A; Table B1 has no row for 120 mm² / 250 A (validation case c0003-120-70mm2-xlpe-200m-250a-b-400v)

Example 4 — 2.5 mm² PVC, 40 m, 16 A type D (c0003)

Type D on 2.5 mm²: the loop resistance sits at 97 % of the Table 8.2 limit, which becomes the governing check although all pass.

Given: 2.5 mm² PVC active with 2.5 mm² earth, route length 40 m, Uo = 230 V, 16 A type D MCB (trip multiple 12.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 2.5 mm² table: 9.01 + j0.102 Ω/km → Z1 = (9.01 + j0.102) × 40/1000 = 0.3604 + j0.0041 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.3604 + j0.0041 Ω
Cable loopZcable = Z1 + Ze = (0.3604 + j0.0041) + (0.3604 + j0.0041) = 0.7208 + j0.0082 Ω; loop resistance R = 0.7208 Ω
Loop impedanceZs = |Zt + Zcable| = |0.7208 + j0.0082| = √(0.7208² + 0.0082²) = 0.7208 Ω; rounded down to 4 s.f. → 0.7208 Ω
Trip currentIa = In × k = 16 × 12.5 = 200 A; Zmax = Uo / Ia = 230 / 200 = 1.1500 Ω; rounded down to 4 s.f. → Zmax 1.15 Ω, Ia 200 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 62.7 % of Zmax → 0.7208 vs limit 1.1500 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.7208 = 319.1 A ≥ Ia → 319.1 vs limit 200.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (2.5 mm², 16 A, type D) maximum loop resistance 0.74 Ω vs R = 0.7208 Ω → 0.7208 vs limit 0.7400 Ω PASS
Table B1AS/NZS 3000 Table B1 row (2.5 mm², 16 A, type D) maximum length 51 m vs route 40 m → 40 vs limit 51 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.01802 + j0.00020)| = 1.1500 Ω → L = 63 m (≈ 1.1500 / 0.01802 Ω/m); Table 8.2: 0.74 / 0.01802 Ω/m = 41.1 → 41 m; Table B1: 51 m. Governing: 41 m (AS/NZS 3000 Table 8.2 resistance)
Result4/4 checks pass → PASS; Zs 0.7208 Ω vs Zmax 1.1500 Ω; max route 41 m (AS/NZS 3000 Table 8.2 resistance); governing: table 8 2 loop resistance
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 2.5 mm² 9.01 + j0.102 Ω/km → Z1 = 0.36040 + j0.00408 Ω; earth 2.5 mm² same → Z2 = Z1; Zloop = 0.72080 + j0.00816 Ω; Zs = |0.72080 + j0.00816| = 0.72085 Ω; Ia = 16 × 12.5 = 200 A, Zmax = 230/200 = 1.15000 Ω; c0003 rounds down to 4 s.f.: Zs 0.7208 Ω, Zmax 1.15 Ω, Ia 200 A; If = 230/0.7208 = 319.1 A; Zs = Zmax at 63.8 m → 63 m; Table 8.2 (2.5 mm², 16 A, D) 0.74 Ω: Rloop 0.7208 Ω ≤ limit; 0.74/0.01802 = 41.1 → 41 m; Table B1 (2.5 mm², 16 A, D) 51 m: L 40 m ≤ limit (validation case c0003-2mm5-pvc-40m-16a-d)

Example 5 — 4 mm² with 2.5 mm² earth, 50 m, 32 A type C (c0003)

The same reduced-earth circuit run through the c0003 engine, which rounds Zs and Zmax down to four significant figures; it fails Table 8.2 the same way.

Given: 4 mm² PVC active with 2.5 mm² earth, route length 50 m, Uo = 230 V, 32 A type C MCB (trip multiple 7.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z1 = (5.61 + j0.102) × 50/1000 = 0.2805 + j0.0051 Ω
Earth conductorPVC 2.5 mm² table: 9.01 + j0.102 Ω/km → Z2 = (9.01 + j0.102) × 50/1000 = 0.4505 + j0.0051 Ω
Cable loopZcable = Z1 + Ze = (0.2805 + j0.0051) + (0.4505 + j0.0051) = 0.7310 + j0.0102 Ω; loop resistance R = 0.7310 Ω
Loop impedanceZs = |Zt + Zcable| = |0.7310 + j0.0102| = √(0.7310² + 0.0102²) = 0.7311 Ω; rounded down to 4 s.f. → 0.731 Ω
Trip currentIa = In × k = 32 × 7.5 = 240 A; Zmax = Uo / Ia = 230 / 240 = 0.9583 Ω; rounded down to 4 s.f. → Zmax 0.9583 Ω, Ia 240 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 76.3 % of Zmax → 0.7310 vs limit 0.9583 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.7310 = 314.6 A ≥ Ia → 314.6 vs limit 240.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (4 mm², 32 A, type C) maximum loop resistance 0.62 Ω vs R = 0.7310 Ω → 0.7310 vs limit 0.6200 Ω FAIL
Table B1AS/NZS 3000 Table B1 row (4 mm², 32 A, type C) maximum length 52 m vs route 50 m → 50 vs limit 52 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.01462 + j0.00020)| = 0.9583 Ω → L = 65 m (≈ 0.9583 / 0.01462 Ω/m); Table 8.2: 0.62 / 0.01462 Ω/m = 42.4 → 42 m; Table B1: 52 m. Governing: 42 m (AS/NZS 3000 Table 8.2 resistance)
Result3/4 checks pass → FAIL; Zs 0.7310 Ω vs Zmax 0.9583 Ω; max route 42 m (AS/NZS 3000 Table 8.2 resistance); governing: table 8 2 loop resistance. Fails: table_8_2_loop_resistance. Options: shorten the route below 42 m, increase the active/earth size, use a lower-multiple curve, or provide additional protection such as an RCD (not assessed by this engine).
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 4 mm² 5.61 + j0.102 Ω/km → Z1 = 0.28050 + j0.00510 Ω; earth 2.5 mm² 9.01 + j0.102 Ω/km → Z2 = 0.45050 + j0.00510 Ω; Zloop = 0.73100 + j0.01020 Ω; Zs = |0.73100 + j0.01020| = 0.73107 Ω; Ia = 32 × 7.5 = 240 A, Zmax = 230/240 = 0.95833 Ω; c0003 rounds down to 4 s.f.: Zs 0.731 Ω, Zmax 0.9583 Ω, Ia 240 A; If = 230/0.7310 = 314.6 A; Zs = Zmax at 65.5 m → 65 m; Table 8.2 (4 mm², 32 A, C) 0.62 Ω: Rloop 0.7310 Ω > limit; 0.62/0.01462 = 42.4 → 42 m; Table B1 (4 mm², 32 A, C) 52 m: L 50 m ≤ limit (validation case c0003-4-2mm5-pvc-50m-32a-c)

Example 6 — 4 mm² PVC, 25 m, 32 A type C (help-page example 1)

A short domestic power circuit: both tables apply and every check passes with wide margin.

Given: 4 mm² PVC active with 4 mm² earth, route length 25 m, Uo = 230 V, 32 A type C MCB (trip multiple 7.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z1 = (5.61 + j0.102) × 25/1000 = 0.1403 + j0.0026 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.1403 + j0.0026 Ω
Cable loopZcable = Z1 + Ze = (0.1403 + j0.0026) + (0.1403 + j0.0026) = 0.2805 + j0.0051 Ω; loop resistance R = 0.2805 Ω
Loop impedanceZs = |Zt + Zcable| = |0.2805 + j0.0051| = √(0.2805² + 0.0051²) = 0.2805 Ω; rounded down to 4 s.f. → 0.2805 Ω
Trip currentIa = In × k = 32 × 7.5 = 240 A; Zmax = Uo / Ia = 230 / 240 = 0.9583 Ω; rounded down to 4 s.f. → Zmax 0.9583 Ω, Ia 240 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 29.3 % of Zmax → 0.2805 vs limit 0.9583 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.2805 = 820.0 A ≥ Ia → 820.0 vs limit 240.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (4 mm², 32 A, type C) maximum loop resistance 0.62 Ω vs R = 0.2805 Ω → 0.2805 vs limit 0.6200 Ω PASS
Table B1AS/NZS 3000 Table B1 row (4 mm², 32 A, type C) maximum length 52 m vs route 25 m → 25 vs limit 52 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.01122 + j0.00020)| = 0.9583 Ω → L = 85 m (≈ 0.9583 / 0.01122 Ω/m); Table 8.2: 0.62 / 0.01122 Ω/m = 55.3 → 55 m; Table B1: 52 m. Governing: 52 m (AS/NZS 3000 Table B1 length)
Result4/4 checks pass → PASS; Zs 0.2805 Ω vs Zmax 0.9583 Ω; max route 52 m (AS/NZS 3000 Table B1 length); governing: table b1 route length
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 4 mm² 5.61 + j0.102 Ω/km → Z1 = 0.14025 + j0.00255 Ω; earth 4 mm² same → Z2 = Z1; Zloop = 0.28050 + j0.00510 Ω; Zs = |0.28050 + j0.00510| = 0.28055 Ω; Ia = 32 × 7.5 = 240 A, Zmax = 230/240 = 0.95833 Ω; c0003 rounds down to 4 s.f.: Zs 0.2805 Ω, Zmax 0.9583 Ω, Ia 240 A; If = 230/0.2805 = 820.0 A; Zs = Zmax at 85.4 m → 85 m; Table 8.2 (4 mm², 32 A, C) 0.62 Ω: Rloop 0.2805 Ω ≤ limit; 0.62/0.01122 = 55.3 → 55 m; Table B1 (4 mm², 32 A, C) 52 m: L 25 m ≤ limit (validation case c0003-4mm2-pvc-25m-32a-c)

Example 7 — 25 m circuit with a 1 MVA 6 % source transformer (help-page example 2, c0003)

Adding the transformer impedance raises Zs from 0.2805 Ω to 0.2818 Ω; the table checks are unaffected because they use the cable loop only.

Given: 4 mm² PVC active with 4 mm² earth, route length 25 m, Uo = 230 V, 32 A type C MCB (trip multiple 7.5); 1 MVA, 6 % source transformer (X/R 10). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceVbase = 230 × √3 = 398.4 V; |Zt| = 6/100 × 398.4² / (1 × 10⁶) = 0.00952 Ω; with X/R = 10: Rt = 0.00952 / √(1 + 10²) = 0.00095 Ω, Xt = 10 × Rt = 0.00947 Ω
Active conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z1 = (5.61 + j0.102) × 25/1000 = 0.1403 + j0.0026 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.1403 + j0.0026 Ω
Cable loopZcable = Z1 + Ze = (0.1403 + j0.0026) + (0.1403 + j0.0026) = 0.2805 + j0.0051 Ω; loop resistance R = 0.2805 Ω
Loop impedanceZs = |Zt + Zcable| = |0.2814 + j0.0146| = √(0.2814² + 0.0146²) = 0.2818 Ω; rounded down to 4 s.f. → 0.2818 Ω
Trip currentIa = In × k = 32 × 7.5 = 240 A; Zmax = Uo / Ia = 230 / 240 = 0.9583 Ω; rounded down to 4 s.f. → Zmax 0.9583 Ω, Ia 240 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 29.4 % of Zmax → 0.2818 vs limit 0.9583 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.2818 = 816.2 A ≥ Ia → 816.2 vs limit 240.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (4 mm², 32 A, type C) maximum loop resistance 0.62 Ω vs R = 0.2805 Ω → 0.2805 vs limit 0.6200 Ω PASS
Table B1AS/NZS 3000 Table B1 row (4 mm², 32 A, type C) maximum length 52 m vs route 25 m → 25 vs limit 52 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.01122 + j0.00020)| = 0.9583 Ω → L = 85 m; Table 8.2: 0.62 / 0.01122 Ω/m = 55.3 → 55 m; Table B1: 52 m. Governing: 52 m (AS/NZS 3000 Table B1 length)
Result4/4 checks pass → PASS; Zs 0.2818 Ω vs Zmax 0.9583 Ω; max route 52 m (AS/NZS 3000 Table B1 length); governing: table b1 route length
ReferenceHand calculation (help-page formulas and tables): Vbase = 230 × √3 = 398.4 V, |Zt| = 6/100 × 398.4² / 1,000,000 = 0.00952 Ω, Rt = 0.00952/√101 = 0.00095 Ω, Xt = 0.00947 Ω; PVC 4 mm² 5.61 + j0.102 Ω/km → Z1 = 0.14025 + j0.00255 Ω; earth 4 mm² same → Z2 = Z1; Zloop = 0.28050 + j0.00510 Ω; Zs = |0.28145 + j0.01457| = 0.28182 Ω; Ia = 32 × 7.5 = 240 A, Zmax = 230/240 = 0.95833 Ω; c0003 rounds down to 4 s.f.: Zs 0.2818 Ω, Zmax 0.9583 Ω, Ia 240 A; If = 230/0.2818 = 816.2 A; Zs = Zmax at 85.3 m → 85 m; Table 8.2 (4 mm², 32 A, C) 0.62 Ω: Rloop 0.2805 Ω ≤ limit; 0.62/0.01122 = 55.3 → 55 m; Table B1 (4 mm², 32 A, C) 52 m: L 25 m ≤ limit (validation case c0003-4mm2-pvc-25m-32a-c-1mva)

Example 8 — 4 mm² PVC, 30 m, 25 A type D (c0003)

Type D on 4 mm² at 25 A: Table 8.2 has a row but Table B1 does not, so the resistance table is the only table check appended and it governs the maximum route.

Given: 4 mm² PVC active with 4 mm² earth, route length 30 m, Uo = 230 V, 25 A type D MCB (trip multiple 12.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 4 mm² table: 5.61 + j0.102 Ω/km → Z1 = (5.61 + j0.102) × 30/1000 = 0.1683 + j0.0031 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.1683 + j0.0031 Ω
Cable loopZcable = Z1 + Ze = (0.1683 + j0.0031) + (0.1683 + j0.0031) = 0.3366 + j0.0061 Ω; loop resistance R = 0.3366 Ω
Loop impedanceZs = |Zt + Zcable| = |0.3366 + j0.0061| = √(0.3366² + 0.0061²) = 0.3367 Ω; rounded down to 4 s.f. → 0.3366 Ω
Trip currentIa = In × k = 25 × 12.5 = 312.5 A; Zmax = Uo / Ia = 230 / 312.5 = 0.7360 Ω; rounded down to 4 s.f. → Zmax 0.736 Ω, Ia 312.5 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 45.7 % of Zmax → 0.3366 vs limit 0.7360 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.3366 = 683.3 A ≥ Ia → 683.3 vs limit 312.5 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (4 mm², 25 A, type D) maximum loop resistance 0.48 Ω vs R = 0.3366 Ω → 0.3366 vs limit 0.4800 Ω PASS
Table B1No AS/NZS 3000 Table B1 row for 4 mm², 25 A, type D — length table not checked
Max route lengthZs = Zmax when |Zt + L × (0.01122 + j0.00020)| = 0.7360 Ω → L = 65 m (≈ 0.7360 / 0.01122 Ω/m); Table 8.2: 0.48 / 0.01122 Ω/m = 42.8 → 42 m. Governing: 42 m (AS/NZS 3000 Table 8.2 resistance)
Result3/3 checks pass → PASS; Zs 0.3366 Ω vs Zmax 0.7360 Ω; max route 42 m (AS/NZS 3000 Table 8.2 resistance); governing: table 8 2 loop resistance
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 4 mm² 5.61 + j0.102 Ω/km → Z1 = 0.16830 + j0.00306 Ω; earth 4 mm² same → Z2 = Z1; Zloop = 0.33660 + j0.00612 Ω; Zs = |0.33660 + j0.00612| = 0.33666 Ω; Ia = 25 × 12.5 = 312.5 A, Zmax = 230/312.5 = 0.73600 Ω; c0003 rounds down to 4 s.f.: Zs 0.3366 Ω, Zmax 0.736 Ω, Ia 312.5 A; If = 230/0.3366 = 683.3 A; Zs = Zmax at 65.6 m → 65 m; Table 8.2 (4 mm², 25 A, D) 0.48 Ω: Rloop 0.3366 Ω ≤ limit; 0.48/0.01122 = 42.8 → 42 m; Table B1 has no row for 4 mm² / 25 A (validation case c0003-4mm2-pvc-30m-25a-d)

Example 9 — 6 mm² PVC, 150 m, 63 A type C — too long

A long 6 mm² run on a 63 A breaker: Zs is more than double Zmax and the fault current cannot reach the instantaneous trip level.

Given: 6 mm² PVC active with 6 mm² earth, route length 150 m, Uo = 230 V, 63 A type C MCB (trip multiple 7.5); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorPVC 6 mm² table: 3.75 + j0.0967 Ω/km → Z1 = (3.75 + j0.0967) × 150/1000 = 0.5625 + j0.0145 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.5625 + j0.0145 Ω
Cable loopZcable = Z1 + Ze = (0.5625 + j0.0145) + (0.5625 + j0.0145) = 1.1250 + j0.0290 Ω; loop resistance R = 1.1250 Ω
Loop impedanceZs = |Zt + Zcable| = |1.1250 + j0.0290| = √(1.1250² + 0.0290²) = 1.1254 Ω; rounded down to 4 s.f. → 1.125 Ω
Trip currentIa = In × k = 63 × 7.5 = 472.5 A; Zmax = Uo / Ia = 230 / 472.5 = 0.4868 Ω; rounded down to 4 s.f. → Zmax 0.4867 Ω, Ia 472.5 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 231.1 % of Zmax → 1.1250 vs limit 0.4867 Ω FAIL
Fault currentIf = Uo / Zs = 230 / 1.1250 = 204.4 A ≥ Ia → 204.4 vs limit 472.5 A FAIL
Table 8.2No AS/NZS 3000 Table 8.2 row for 6 mm², 63 A, type C — resistance table not checked
Table B1No AS/NZS 3000 Table B1 row for 6 mm², 63 A, type C — length table not checked
Max route lengthZs = Zmax when |Zt + L × (0.00750 + j0.00019)| = 0.4867 Ω → L = 64 m (≈ 0.4867 / 0.00750 Ω/m). Governing: 64 m (Zs = Zmax)
Result0/2 checks pass → FAIL; Zs 1.1250 Ω vs Zmax 0.4867 Ω; max route 64 m (Zs = Zmax); governing: earth fault loop impedance. Fails: earth_fault_loop_impedance, disconnection_instantaneous_trip. Options: shorten the route below 64 m, increase the active/earth size, use a lower-multiple curve, or provide additional protection such as an RCD (not assessed by this engine).
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); PVC 6 mm² 3.75 + j0.0967 Ω/km → Z1 = 0.56250 + j0.01450 Ω; earth 6 mm² same → Z2 = Z1; Zloop = 1.12500 + j0.02901 Ω; Zs = |1.12500 + j0.02901| = 1.12537 Ω; Ia = 63 × 7.5 = 472.5 A, Zmax = 230/472.5 = 0.48677 Ω; c0003 rounds down to 4 s.f.: Zs 1.125 Ω, Zmax 0.4867 Ω, Ia 472.5 A; If = 230/1.1250 = 204.4 A; Zs = Zmax at 64.9 m → 64 m; Table 8.2 has no row for 6 mm² / 63 A; Table B1 has no row for 6 mm² / 63 A (validation case c0003-6mm2-pvc-150m-63a-c-fail)

Example 10 — 6 mm² XLPE, 60 m, 40 A type B (c0003)

Type B on XLPE: Zs is a third of Zmax, so the Table B1 length (90 m) rather than Zs sets the maximum route.

Given: 6 mm² XLPE active with 6 mm² earth, route length 60 m, Uo = 230 V, 40 A type B MCB (trip multiple 4); no source impedance (circuit cable only). Engine c0003 (Zs, Zmax and Ia rounded down to 4 s.f.).

Source impedanceNo source transformer given: Zt = 0 — Zs is the circuit cable's own contribution only
Active conductorXLPE 6 mm² table: 3.93 + j0.0887 Ω/km → Z1 = (3.93 + j0.0887) × 60/1000 = 0.2358 + j0.0053 Ω
Earth conductorSame size as the active: Z2 = Z1 = 0.2358 + j0.0053 Ω
Cable loopZcable = Z1 + Ze = (0.2358 + j0.0053) + (0.2358 + j0.0053) = 0.4716 + j0.0106 Ω; loop resistance R = 0.4716 Ω
Loop impedanceZs = |Zt + Zcable| = |0.4716 + j0.0106| = √(0.4716² + 0.0106²) = 0.4717 Ω; rounded down to 4 s.f. → 0.4717 Ω
Trip currentIa = In × k = 40 × 4 = 160 A; Zmax = Uo / Ia = 230 / 160 = 1.4375 Ω; rounded down to 4 s.f. → Zmax 1.437 Ω, Ia 160 A
Zs ≤ ZmaxAS/NZS 3000 Clause 8.3.9 basis, Zs at 32.8 % of Zmax → 0.4717 vs limit 1.4370 Ω PASS
Fault currentIf = Uo / Zs = 230 / 0.4717 = 487.6 A ≥ Ia → 487.6 vs limit 160.0 A PASS
Table 8.2AS/NZS 3000 Table 8.2 row (6 mm², 40 A, type B) maximum loop resistance 0.93 Ω vs R = 0.4716 Ω → 0.4716 vs limit 0.9300 Ω PASS
Table B1AS/NZS 3000 Table B1 row (6 mm², 40 A, type B) maximum length 90 m vs route 60 m → 60 vs limit 90 m PASS
Max route lengthZs = Zmax when |Zt + L × (0.00786 + j0.00018)| = 1.4370 Ω → L = 182 m (≈ 1.4370 / 0.00786 Ω/m); Table 8.2: 0.93 / 0.00786 Ω/m = 118.3 → 118 m; Table B1: 90 m. Governing: 90 m (AS/NZS 3000 Table B1 length)
Result4/4 checks pass → PASS; Zs 0.4717 Ω vs Zmax 1.4370 Ω; max route 90 m (AS/NZS 3000 Table B1 length); governing: table b1 route length
ReferenceHand calculation (help-page formulas and tables): no source impedance (Zt = 0); XLPE 6 mm² 3.93 + j0.0887 Ω/km → Z1 = 0.23580 + j0.00532 Ω; earth 6 mm² same → Z2 = Z1; Zloop = 0.47160 + j0.01064 Ω; Zs = |0.47160 + j0.01064| = 0.47172 Ω; Ia = 40 × 4 = 160 A, Zmax = 230/160 = 1.43750 Ω; c0003 rounds down to 4 s.f.: Zs 0.4717 Ω, Zmax 1.437 Ω, Ia 160 A; If = 230/0.4717 = 487.6 A; Zs = Zmax at 182.8 m → 182 m; Table 8.2 (6 mm², 40 A, B) 0.93 Ω: Rloop 0.4716 Ω ≤ limit; 0.93/0.00786 = 118.3 → 118 m; Table B1 (6 mm², 40 A, B) 90 m: L 60 m ≤ limit (validation case c0003-6mm2-xlpe-60m-40a-b)

Standards

Standard Title Relevant Clauses
IEC 60364 Low-voltage electrical installations Part 4-41: Protection against electric shock
BS 7671 Requirements for Electrical Installations (IET Wiring Regulations) Clause 411.4.4 — Automatic disconnection in TN systems; Chapter 41
AS/NZS 3000 Wiring Rules Table 8.2 (maximum loop impedance); Table B1 (maximum cable lengths)

Tips & Limitations

Tips
  • Always ensure the earth CSA is adequate — undersized earth conductors increase \( Z_s \) and can cause non-compliance.
  • Supplementary earthing significantly reduces \( Z_s \) by providing a parallel return path.
  • Type B breakers require the lowest fault current (easiest to comply with); Type D breakers need the highest (watch for compliance on long cable runs).
  • Cable temperature affects resistance — the lookup values in the tables are at rated conductor operating temperature.
Limitations
  • This calculator does not account for external earth fault loop impedance (\( Z_e \)) from the supply authority. The calculated \( Z_s \) represents only the installation-side impedance.
  • For TT systems, RCD protection calculations should be used instead of earth fault loop impedance verification.
  • The data tables assume copper conductors at 50 Hz. Aluminium conductors or other frequencies require different lookup values.

Architecture

File Layout

components/c0003_earth_fault_loop/component.py Calculator class, parameter schema, registration, equation builder
components/c0003_earth_fault_loop/calculations.py Advanced calculation logic with complex impedance math
components/c0003_earth_fault_loop/equations.py Equation builder for formatted calculation reports
core/electrical_utils.py ComplexNumber class used for R+jX arithmetic

Calculator Class

EarthFaultLoopCalculator extends ElectricalCalculator (which extends BaseCalculator). It auto-registers with the component registry on app startup via register_component().

Two Calculation Implementations

component.py contains a simplified resistance-only model suitable for quick checks. calculations.py provides the full complex impedance model with R+jX using the ComplexNumber class. The advanced version is more accurate for detailed engineering analysis.

Data Tables

Four Python dicts are defined at module level in calculations.py: RESISTANCE_DATA, REACTANCE_DATA, TABLE_8_2_DATA, and TABLE_B1_DATA. These drive all lookups and compliance checks.

Code Paths

Key Functions in calculations.py

Function Purpose
calculate_conductor_impedance(csa, length, insulation_type) Lookup R and X from tables, scale by cable length, return ComplexNumber
calculate_earth_fault_loop_impedance(data) Main orchestrator — computes all impedances, trip current, and compliance
check_table_8_2(active_csa, breaker_rating, trip_multiplier, cable_resistance) Verify cable resistance against Table 8.2 maximum limits
check_table_b1(active_csa, breaker_rating, trip_multiplier, cable_length) Verify cable length against Table B1 maximum length limits

Key Functions in electrical_utils.py

Function Purpose
calculate_transformer_impedance(mva, z_percent, voltage) Compute transformer impedance \( Z_t \) with X/R=10 assumption, return ComplexNumber
calculate_parallel_impedance(z1, z2) Parallel combination of two complex impedances

Extending the Calculator

  • New insulation types: Add entries to RESISTANCE_DATA and REACTANCE_DATA in calculations.py, and extend the insulation_type enum in the parameter schema.
  • New breaker types: Extend the trip_curve enum in the schema and add corresponding entries to TABLE_8_2_DATA and TABLE_B1_DATA.

Testing

Running Tests

pytest calcs/test_c0003_earth_fault_loop.py -v

The worked examples on this page are generated from the MCP validation corpus (mcp_public/validation/cases/fe_calc_efli/, engine c0003) by python manage.py generate_help_examples --tool fe_calc_efli; calcs/test_help_examples.py fails when the committed fragment is stale.

Test Coverage

Tests should cover the full calculation path: transformer impedance, cable impedance lookups, parallel earth combination, total loop impedance, trip current, and compliance checks against both Table 8.2 and Table B1.

Adding Tests

Follow the existing test patterns in the calcs/ test suite. Key scenarios to cover when extending:

  • With and without transformer
  • With and without supplementary earthing
  • PVC vs XLPE insulation types
  • All three breaker trip curves (B, C, D)
  • Boundary cases where \( Z_s \approx Z_{max} \)
  • Compliance pass and fail scenarios