Fault Loop Calculator ❲2024❳
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' }
def calculate_fault_loop_impedance(self, cables: list[CableData], available_fault_current: float = 10000) -> dict: """ Calculate total earth fault loop impedance (Zs) Args: cables: List of cable segments in the fault loop available_fault_current: Available fault current at origin (A) Returns: Dictionary with fault loop impedance details """ # Source impedance r_source, x_source = self.source_impedance(available_fault_current) total_r = r_source total_x = x_source # Add cable impedances for cable in cables: r_cable, x_cable = self.cable_impedance(cable) total_r += r_cable total_x += x_cable # Total impedance total_z = math.sqrt(total_r**2 + total_x**2) # Prospective fault current fault_current = self.supply_voltage / total_z return { 'total_resistance': round(total_r, 4), 'total_reactance': round(total_x, 4), 'total_impedance': round(total_z, 4), 'prospective_fault_current': round(fault_current, 2), 'source_impedance': round(math.sqrt(r_source**2 + x_source**2), 4), 'source_resistance': round(r_source, 4), 'source_reactance': round(x_source, 4) }
# 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
This calculator follows IEC 60364 standards and is suitable for domestic, commercial, and industrial electrical installations.
# 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""" protection_rating: float) ->
# Create calculator instance calc = FaultLoopCalculator(supply_voltage=230, frequency=50)
# Define cable segments cables = [ CableData( length=25, # meters cross_section_phase=2.5, # mm² cross_section_earth=2.5, # mm² material='copper' ) ] available_fault_current: float = 10000) ->
print(f"\nTotal loop impedance: {multi_result['total_impedance']} Ω") print(f"Prospective fault current: {multi_result['prospective_fault_current']} A")