|
1 | 1 | import math |
2 | | -import os |
3 | 2 | import sys |
4 | 3 | import numpy as np |
5 | 4 | import numpy_financial as npf |
6 | 5 | import geophires_x.Model as Model |
7 | 6 | from geophires_x import EconomicsSam |
8 | 7 | from geophires_x.EconomicsSam import calculate_sam_economics |
| 8 | +from geophires_x.EconomicsUtils import BuildPricingModel |
9 | 9 | from geophires_x.OptionList import Configuration, WellDrillingCostCorrelation, EconomicModel, EndUseOptions, PlantType, \ |
10 | 10 | _WellDrillingCostCorrelationCitation |
11 | 11 | from geophires_x.Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, boolParameter, \ |
@@ -165,37 +165,6 @@ def BuildPTCModel(plantlifetime: int, duration: int, ptc_price: float, |
165 | 165 | return Price |
166 | 166 |
|
167 | 167 |
|
168 | | -def BuildPricingModel(plantlifetime: int, StartPrice: float, EndPrice: float, |
169 | | - EscalationStartYear: int, EscalationRate: float, PTCAddition: list) -> list: |
170 | | - """ |
171 | | - BuildPricingModel builds the price model array for the project lifetime. It is used to calculate the revenue |
172 | | - stream for the project. |
173 | | - :param plantlifetime: The lifetime of the project in years |
174 | | - :type plantlifetime: int |
175 | | - :param StartPrice: The price in the first year of the project in $/kWh |
176 | | - :type StartPrice: float |
177 | | - :param EndPrice: The price in the last year of the project in $/kWh |
178 | | - :type EndPrice: float |
179 | | - :param EscalationStartYear: The year the price escalation starts in years (not including construction years) in years |
180 | | - :type EscalationStartYear: int |
181 | | - :param EscalationRate: The rate of price escalation in $/kWh/year |
182 | | - :type EscalationRate: float |
183 | | - :param PTCAddition: The PTC addition array for the project in $/kWh |
184 | | - :type PTCAddition: list |
185 | | - :return: Price: The price model array for the project in $/kWh |
186 | | - :rtype: list |
187 | | - """ |
188 | | - Price = [0.0] * plantlifetime |
189 | | - for i in range(0, plantlifetime, 1): |
190 | | - Price[i] = StartPrice |
191 | | - if i >= EscalationStartYear: |
192 | | - Price[i] = Price[i] + ((i - EscalationStartYear) * EscalationRate) |
193 | | - if Price[i] > EndPrice: |
194 | | - Price[i] = EndPrice |
195 | | - Price[i] = Price[i] + PTCAddition[i] |
196 | | - return Price |
197 | | - |
198 | | - |
199 | 168 | def CalculateTotalRevenue(plantlifetime: int, ConstructionYears: int, CAPEX: float, OPEX: float, AnnualRev): |
200 | 169 | """ |
201 | 170 | CalculateRevenue calculates the revenue stream for the project. It is used to calculate the revenue |
@@ -2761,13 +2730,13 @@ def Calculate(self, model: Model) -> None: |
2761 | 2730 | self.HeatEscalationStart.value, self.HeatEscalationRate.value, |
2762 | 2731 | self.PTCHeatPrice) |
2763 | 2732 | self.CoolingPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value, |
2764 | | - self.CoolingStartPrice.value, self.CoolingEndPrice.value, |
2765 | | - self.CoolingEscalationStart.value, self.CoolingEscalationRate.value, |
2766 | | - self.PTCCoolingPrice) |
| 2733 | + self.CoolingStartPrice.value, self.CoolingEndPrice.value, |
| 2734 | + self.CoolingEscalationStart.value, self.CoolingEscalationRate.value, |
| 2735 | + self.PTCCoolingPrice) |
2767 | 2736 | self.CarbonPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value, |
2768 | | - self.CarbonStartPrice.value, self.CarbonEndPrice.value, |
2769 | | - self.CarbonEscalationStart.value, self.CarbonEscalationRate.value, |
2770 | | - self.PTCCarbonPrice) |
| 2737 | + self.CarbonStartPrice.value, self.CarbonEndPrice.value, |
| 2738 | + self.CarbonEscalationStart.value, self.CarbonEscalationRate.value, |
| 2739 | + self.PTCCarbonPrice) |
2771 | 2740 |
|
2772 | 2741 | # do the additional economic calculations first, if needed, so the summaries below work. |
2773 | 2742 | if self.DoAddOnCalculations.value: |
|
0 commit comments