|
|
|
@ -26,7 +26,8 @@ def calculate_eaf(
|
|
|
|
period_hours: float,
|
|
|
|
period_hours: float,
|
|
|
|
forced_outage_hours:float,
|
|
|
|
forced_outage_hours:float,
|
|
|
|
seasonal_outage_hours: float,
|
|
|
|
seasonal_outage_hours: float,
|
|
|
|
plot_data = None
|
|
|
|
plot_data = None,
|
|
|
|
|
|
|
|
manual_deratings: list = None
|
|
|
|
):
|
|
|
|
):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Calculate EAF using the time-based method from PLN document
|
|
|
|
Calculate EAF using the time-based method from PLN document
|
|
|
|
@ -45,9 +46,20 @@ def calculate_eaf(
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# Calculate lost production
|
|
|
|
# Calculate lost production
|
|
|
|
max_capacity = 550
|
|
|
|
max_capacity = 630
|
|
|
|
# Calculate total equivalent derate and outage hours
|
|
|
|
# Calculate total equivalent derate and outage hours
|
|
|
|
edh = calculate_equivalent_derate_hours(plot_data, max_flow_rate=max_capacity)
|
|
|
|
edh = calculate_equivalent_derate_hours(plot_data, max_flow_rate=max_capacity)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add manual deratings
|
|
|
|
|
|
|
|
if manual_deratings:
|
|
|
|
|
|
|
|
for d in manual_deratings:
|
|
|
|
|
|
|
|
# expected structure: { hours: float, capacity: float }
|
|
|
|
|
|
|
|
hours = float(d.get('hours', 0))
|
|
|
|
|
|
|
|
capacity = float(d.get('capacity', 0))
|
|
|
|
|
|
|
|
derating = max_capacity - capacity
|
|
|
|
|
|
|
|
if derating > 0:
|
|
|
|
|
|
|
|
edh += (hours * derating / max_capacity)
|
|
|
|
|
|
|
|
|
|
|
|
# Calculate EAF
|
|
|
|
# Calculate EAF
|
|
|
|
eaf = ((available_hours - edh) / period_hours) * 100
|
|
|
|
eaf = ((available_hours - edh) / period_hours) * 100
|
|
|
|
efor = ((forced_outage_hours + edh)/period_hours) * 100
|
|
|
|
efor = ((forced_outage_hours + edh)/period_hours) * 100
|
|
|
|
|