print(f"Cold resistance: {r_cold:.4f} Ω") print(f"Hot resistance (fault condition): {r_hot:.4f} Ω") print(f"Resistance increase: {(r_hot/r_cold - 1) * 100:.1f}%")

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

# Cold condition (no temp correction) r_cold, x_cold = calc.cable_impedance(cable, use_temp_correction=False) # Hot condition (fault temperature) r_hot, x_hot = calc.cable_impedance(cable, use_temp_correction=True)

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

multi_result = calc.calculate_fault_loop_impedance(multi_cables, 8000)

def cable_impedance(self, cable: CableData, use_temp_correction: bool = True) -> Tuple[float, float]: """ Calculate cable resistance and reactance Returns: Tuple of (resistance ohms, reactance ohms) """ resistivity = cable.RESISTIVITY[cable.material] # Temperature correction factor temp_factor = cable.TEMP_FACTOR_FAULT if use_temp_correction else 1.0 # Phase conductor resistance r_phase = resistivity * temp_factor * cable.length / cable.cross_section_phase # Earth conductor resistance r_earth = resistivity * temp_factor * cable.length / cable.cross_section_earth # Total loop resistance (phase + earth) r_total = r_phase + r_earth # Reactance (typical for LV cables: ~0.08 ohm/km for 50Hz) reactance_per_km = 0.08 # ohms/km x_total = reactance_per_km * cable.length / 1000 return r_total, x_total

# Multiple cable segments example print("\n" + "=" * 60) print("MULTI-SEGMENT INSTALLATION EXAMPLE") print("=" * 60)