@@ -310,7 +310,7 @@ def CalculateFinancialPerformance(plantlifetime: int,
310310 TotalCummRevenue : list ,
311311 CAPEX : float ,
312312 OPEX : float ,
313- cashflow_series_start_year : float = 0. ):
313+ discount_initial_year_cashflow : bool = False ):
314314 """
315315 CalculateFinancialPerformance calculates the financial performance of the project. It is used to calculate the
316316 financial performance of the project. It is used to calculate the revenue stream for the project.
@@ -326,8 +326,8 @@ def CalculateFinancialPerformance(plantlifetime: int,
326326 :type CAPEX: float
327327 :param OPEX: The total annual operating cost of the project in MUSD
328328 :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
331331
332332 :return: NPV: The net present value of the project in MUSD
333333 :rtype: float
@@ -343,12 +343,7 @@ def CalculateFinancialPerformance(plantlifetime: int,
343343
344344 cashflow_series = TotalRevenue .copy ()
345345
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 :
352347 cashflow_series = [0 , * cashflow_series ]
353348
354349 NPV = npf .npv (FixedInternalRate / 100 , cashflow_series )
@@ -875,16 +870,22 @@ def __init__(self, model: Model):
875870 "will be automatically set to the same value."
876871 )
877872
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 ,
883877 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.'
888889 )
889890
890891 self .FIB = self .ParameterDict [self .FIB .Name ] = floatParameter (
@@ -2916,7 +2917,7 @@ def Calculate(self, model: Model) -> None:
29162917 self .TotalCummRevenue .value ,
29172918 self .CCap .value ,
29182919 self .Coam .value ,
2919- self .cashflow_series_start_year .value
2920+ self .discount_initial_year_cashflow .value
29202921 )
29212922
29222923 # Calculate the project payback period
0 commit comments