Fault Loop Calculator =link= -

# Create calculator instance calc = FaultLoopCalculator(supply_voltage=230, frequency=50)

# Quick lookup table print("\n📋 QUICK REFERENCE - MAX CABLE LENGTHS (Copper, 230V, 20A MCB Type C)") print("-" * 70) print(f"{'Cable Size (mm²)':<20} {'Max Length (m)':<15} {'Zs (Ω)':<10}") print("-" * 70) fault loop calculator

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' } 20} {'Max Length (m)':&lt

# 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""" 15} {'Zs (Ω)':&lt

for key, value in result.items(): print(f"{key.replace('_', ' ').title()}: {value}")

# Compare cold and hot cable conditions cable = CableData(length=50, cross_section_phase=4, cross_section_earth=4, material='copper')