|
|
|
|
@ -431,6 +431,7 @@ def main():
|
|
|
|
|
cf_history = []
|
|
|
|
|
sfc_history = []
|
|
|
|
|
auxiliary_history = []
|
|
|
|
|
seq_non_actual = 1
|
|
|
|
|
|
|
|
|
|
# Prefetch master data CF dan EAF sekali saja di luar loop
|
|
|
|
|
cur.execute("""
|
|
|
|
|
@ -502,13 +503,17 @@ def main():
|
|
|
|
|
# avg_last_3_auxiliary = sum(last_3_auxiliary) / len(last_3_auxiliary) if len(last_3_auxiliary) > 0 else 0
|
|
|
|
|
# auxiliary = avg_last_3_auxiliary
|
|
|
|
|
# auxiliary_history.append(avg_last_3_auxiliary)
|
|
|
|
|
sfc_rate = npf.rate(len(sfc_history) - 1, 0, sfc_history[-1], -sfc_history[1]) if len(
|
|
|
|
|
sfc_history) > 2 else 0
|
|
|
|
|
sfc = sfc_history[-1] / (1 + sfc_rate) ** seq_non_actual
|
|
|
|
|
|
|
|
|
|
sfc = linear_forecast_from_history(sfc_history)
|
|
|
|
|
sfc_history.append(sfc)
|
|
|
|
|
auxiliary = linear_forecast_from_history(auxiliary_history)
|
|
|
|
|
auxiliary_history.append(auxiliary)
|
|
|
|
|
aux_rate = npf.rate(len(auxiliary_history) - 1, 0, auxiliary_history[-1], -auxiliary_history[1]) if len(
|
|
|
|
|
auxiliary_history) > 2 else 0
|
|
|
|
|
auxiliary = auxiliary_history[-1] / (1 + aux_rate) ** seq_non_actual
|
|
|
|
|
seq_non_actual += 1
|
|
|
|
|
|
|
|
|
|
production_netto = net_capacity_factor * 8760 * daya_mampu_netto / 100
|
|
|
|
|
print(production_netto)
|
|
|
|
|
production_bruto = production_netto / (100 - (auxiliary + susut_trafo)) * 100
|
|
|
|
|
energy_sales = production_netto
|
|
|
|
|
fuel_consumption = production_bruto * sfc
|
|
|
|
|
|