|
|
|
|
@ -18,18 +18,23 @@ def calculate_eaf(
|
|
|
|
|
Returns:
|
|
|
|
|
Dictionary with EAF result and breakdown
|
|
|
|
|
"""
|
|
|
|
|
# Calculate lost production
|
|
|
|
|
lost_production = ideal_production - actual_production
|
|
|
|
|
|
|
|
|
|
estimated_max_capacity = ideal_production / period_hours if period_hours > 0 else 0
|
|
|
|
|
try:
|
|
|
|
|
# Calculate lost production
|
|
|
|
|
lost_production = ideal_production - actual_production
|
|
|
|
|
print(ideal_production, actual_production, lost_production)
|
|
|
|
|
|
|
|
|
|
# Calculate total equivalent derate hours
|
|
|
|
|
total_equivalent_derate_hours = lost_production / estimated_max_capacity
|
|
|
|
|
estimated_max_capacity = ideal_production / period_hours if period_hours > 0 else 0
|
|
|
|
|
|
|
|
|
|
# Calculate EAF
|
|
|
|
|
effective_available_hours = available_hours - total_equivalent_derate_hours
|
|
|
|
|
return (effective_available_hours / period_hours) * 100, total_equivalent_derate_hours
|
|
|
|
|
# Calculate total equivalent derate hours
|
|
|
|
|
total_equivalent_derate_hours = lost_production / estimated_max_capacity if estimated_max_capacity > 0 else 0
|
|
|
|
|
|
|
|
|
|
# Calculate EAF
|
|
|
|
|
effective_available_hours = available_hours - total_equivalent_derate_hours
|
|
|
|
|
return (effective_available_hours / period_hours) * 100 if period_hours > 0 else 0, total_equivalent_derate_hours
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print("Error calculating EAF:", str(e))
|
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
# def calculate_efor(
|
|
|
|
|
# forced_outage_hours: float,
|
|
|
|
|
|