Skip to content

Commit d387e99

Browse files
Merge pull request #8 from pvstorageoptimization/dev
fixed bug in calculating lcoe
2 parents 7a1344b + afeca6b commit d387e99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

optibess_algorithm/financial_calculator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def get_lcoe(self, power_output=None, purchased_from_grid=None):
769769

770770
lcoe = sum([(costs[i] + power_costs[i]) / (1 + self._interest_rate) ** i for i in range(self._num_of_years)]) /\
771771
sum([power_output[i].sum() / (1 + self._interest_rate) ** i for i in range(self._num_of_years)])
772-
return lcoe
772+
return lcoe if np.isfinite(lcoe) else 0
773773

774774
def get_lcoe_no_power_costs(self, power_output=None):
775775
"""
@@ -794,7 +794,7 @@ def get_lcoe_no_power_costs(self, power_output=None):
794794

795795
lcoe = sum([costs[i] / (1 + self._interest_rate) ** i for i in range(self._num_of_years)]) / \
796796
sum([power_output[i].sum() / (1 + self._interest_rate) ** i for i in range(self._num_of_years)])
797-
return lcoe
797+
return lcoe if np.isfinite(lcoe) else 0
798798

799799
def get_lcos(self):
800800
"""

0 commit comments

Comments
 (0)