@@ -310,7 +310,7 @@ def CalculateFinancialPerformance(plantlifetime: int,
310
310
TotalCummRevenue : list ,
311
311
CAPEX : float ,
312
312
OPEX : float ,
313
- cashflow_series_start_year : float = 0. ):
313
+ discount_initial_year_cashflow : bool = False ):
314
314
"""
315
315
CalculateFinancialPerformance calculates the financial performance of the project. It is used to calculate the
316
316
financial performance of the project. It is used to calculate the revenue stream for the project.
@@ -326,8 +326,8 @@ def CalculateFinancialPerformance(plantlifetime: int,
326
326
:type CAPEX: float
327
327
:param OPEX: The total annual operating cost of the project in MUSD
328
328
:type OPEX: float
329
- :param cashflow_series_start_year: The starting year of the cashflow series used to calculate NPV
330
- :type cashflow_series_start_year: float
329
+ :param discount_initial_year_cashflow: Whether to discount the initial year of cashflow used to calculate NPV
330
+ :type discount_initial_year_cashflow: bool
331
331
332
332
:return: NPV: The net present value of the project in MUSD
333
333
:rtype: float
@@ -343,12 +343,7 @@ def CalculateFinancialPerformance(plantlifetime: int,
343
343
344
344
cashflow_series = TotalRevenue .copy ()
345
345
346
- if cashflow_series_start_year not in [0. , 1. ]:
347
- param_name = 'Cashflow Series Start Year' # TODO reference name defined in parameter dict
348
- raise NotImplementedError (f'Unsupported value for { param_name } : { cashflow_series_start_year } ' )
349
-
350
-
351
- if cashflow_series_start_year == 1. :
346
+ if discount_initial_year_cashflow :
352
347
cashflow_series = [0 , * cashflow_series ]
353
348
354
349
NPV = npf .npv (FixedInternalRate / 100 , cashflow_series )
@@ -875,16 +870,22 @@ def __init__(self, model: Model):
875
870
"will be automatically set to the same value."
876
871
)
877
872
878
- # TODO add support for float values
879
- self .cashflow_series_start_year = self .ParameterDict [self .cashflow_series_start_year .Name ] = intParameter (
880
- "Cashflow Series Start Year" ,
881
- DefaultValue = 0 ,
882
- AllowableRange = [0 , 1 ],
873
+
874
+ self .discount_initial_year_cashflow = self .ParameterDict [self .discount_initial_year_cashflow .Name ] = boolParameter (
875
+ 'Discount Initial Year Cashflow' ,
876
+ DefaultValue = False ,
883
877
UnitType = Units .NONE ,
884
- ErrMessage = f'assume default Cashflow Series Start Year ({ 0 } )' ,
885
- ToolTipText = "Cashflow Series Start Year used to calculate NPV"
886
- # "in the Standard Levelized Cost Model." # (?)
887
- # TODO documentation re: values/conventions
878
+ ToolTipText = 'Whether to discount cashflow in the initial project year when calculating NPV. '
879
+ 'The default value of False conforms to NREL\' s standard convention for NPV calculation '
880
+ '(Short W et al, 1995. https://www.nrel.gov/docs/legosti/old/5173.pdf). '
881
+ 'A value of True will, by contrast, cause NPV calculation to follow the convention used by '
882
+ 'Excel, Google Sheets, and other common spreadsheet software. '
883
+ 'Although NREL\' s NPV convention may typically be considered more technically correct '
884
+ 'from a financial mathematics perspective, '
885
+ 'Excel-style NPV calculation may be preferred by some for familiarity, '
886
+ 'compliance with de-facto organizational standards, or comparison of '
887
+ 'GEOPHIRES with independent financial calculations. '
888
+ 'See https://github.com/NREL/GEOPHIRES-X/discussions/344 for discussion and further details.'
888
889
)
889
890
890
891
self .FIB = self .ParameterDict [self .FIB .Name ] = floatParameter (
@@ -2916,7 +2917,7 @@ def Calculate(self, model: Model) -> None:
2916
2917
self .TotalCummRevenue .value ,
2917
2918
self .CCap .value ,
2918
2919
self .Coam .value ,
2919
- self .cashflow_series_start_year .value
2920
+ self .discount_initial_year_cashflow .value
2920
2921
)
2921
2922
2922
2923
# Calculate the project payback period
0 commit comments