Fault Loop Calculator [verified] May 2026
# Temperature correction factors TEMP_FACTOR_OPERATING = 1.25 # for cables at operating temperature TEMP_FACTOR_FAULT = 1.50 # for fault condition class FaultLoopCalculator: """Calculates earth fault loop impedance and prospective fault current"""
# Verify protection print("\n🔒 PROTECTION VERIFICATION") print("-" * 40)
I'll produce a feature for electrical engineering applications. This calculates prospective fault current and earth fault loop impedance for electrical installations. Fault Loop Calculator import math from dataclasses import dataclass from typing import Optional, Tuple @dataclass class CableData: """Cable parameters for fault loop calculation""" length: float # meters cross_section_phase: float # mm² cross_section_earth: float # mm² material: str # 'copper' or 'aluminum' fault loop calculator
multi_cables = [ CableData(length=30, cross_section_phase=16, cross_section_earth=16, material='copper'), CableData(length=20, cross_section_phase=6, cross_section_earth=6, material='copper'), CableData(length=15, cross_section_phase=2.5, cross_section_earth=2.5, material='copper') ]
def verify_disconnection_time(self, fault_current: float, protection_type: str, protection_rating: float) -> dict: """ Verify disconnection time meets safety requirements Args: fault_current: Prospective fault current (A) protection_type: 'MCB', 'RCD', or 'fuse' protection_rating: Rated current of protection device (A) Returns: Verification result """ # Standard disconnection time requirements (IEC 60364) max_disconnection_time = { 'TN_230': 0.4, # seconds for 230V TN system 'TT_230': 0.2, # seconds for 230V TT system 'final_circuit': 0.4 } # Simple MCB tripping curve estimation (Type C) if protection_type == 'MCB': if fault_current >= 10 * protection_rating: # Instantaneous trip disconnection_time = 0.02 # 20ms elif fault_current >= 5 * protection_rating: disconnection_time = 0.1 else: disconnection_time = 5.0 # Thermal trip, may not clear quickly elif protection_type == 'RCD': disconnection_time = 0.04 # 40ms for RCD else: # fuse disconnection_time = 0.4 # Approximate meets_requirement = disconnection_time <= max_disconnection_time['TN_230'] return { 'disconnection_time': disconnection_time, 'max_allowed_time': max_disconnection_time['TN_230'], 'meets_requirement': meets_requirement, 'recommendation': 'Compliant' if meets_requirement else 'Non-compliant - Increase conductor size or reduce length' } # Temperature correction factors TEMP_FACTOR_OPERATING = 1
# Define cable segments cables = [ CableData( length=25, # meters cross_section_phase=2.5, # mm² cross_section_earth=2.5, # mm² material='copper' ) ]
for key, value in verification.items(): print(f"{key.replace('_', ' ').title()}: {value}") material='copper') ] def verify_disconnection_time(self
# Calculate fault loop parameters print("\n📊 FAULT LOOP CALCULATION") print("-" * 40)