Browse Source

Done with a simulation giving the most relevant answers

master
Maximilian Stiefel 6 months ago
parent
commit
5bd6414969
  1. 18
      example_1.json
  2. 21
      heatpump.py

18
example_1.json

@ -3,10 +3,12 @@
"technologies": [ "technologies": [
{ {
"label": "Air water heat pump", "label": "Air water heat pump",
"installation_price": 120000, "installation_price": 112568.75,
"reinstallation_price": 120000, "reinstallation_price": 120000,
"kwh_expenditure": 11000, "kwh_expenditure": 5453.4,
"kwh_price": 2, "kwh_price": 2.1,
"maintenance_price": 2000,
"maintenance_interval": 2,
"percent_inflation": 2, "percent_inflation": 2,
"years_lifespan": 15 "years_lifespan": 15
}, },
@ -14,8 +16,10 @@
"label": "Geothermal heat pump", "label": "Geothermal heat pump",
"installation_price": 222788, "installation_price": 222788,
"reinstallation_price": 160000, "reinstallation_price": 160000,
"kwh_expenditure": 5000, "kwh_expenditure": 4519.1,
"kwh_price": 2, "kwh_price": 1.94,
"maintenance_price": 2000,
"maintenance_interval": 2,
"percent_inflation": 2, "percent_inflation": 2,
"years_lifespan": 20 "years_lifespan": 20
}, },
@ -23,8 +27,10 @@
"label": "District heating", "label": "District heating",
"installation_price": 95133, "installation_price": 95133,
"reinstallation_price": 30000, "reinstallation_price": 30000,
"kwh_expenditure": 25000, "kwh_expenditure": 18768,
"kwh_price": 0.95, "kwh_price": 0.95,
"maintenance_price": 2000,
"maintenance_interval": 2,
"percent_inflation": 8, "percent_inflation": 8,
"years_lifespan": 50 "years_lifespan": 50
} }

21
heatpump.py

@ -21,6 +21,8 @@ class JsonSettingsExtractor:
self._reinstallation_price = [technology["reinstallation_price"] for technology in _technologies] self._reinstallation_price = [technology["reinstallation_price"] for technology in _technologies]
self._kwh_expenditure = [technology["kwh_expenditure"] for technology in _technologies] self._kwh_expenditure = [technology["kwh_expenditure"] for technology in _technologies]
self._kwh_price = [technology["kwh_price"] for technology in _technologies] self._kwh_price = [technology["kwh_price"] for technology in _technologies]
self._maintenance_price = [technology["maintenance_price"] for technology in _technologies]
self._maintenance_interval = [technology["maintenance_interval"] for technology in _technologies]
self._percent_inflation = [technology["percent_inflation"] for technology in _technologies] self._percent_inflation = [technology["percent_inflation"] for technology in _technologies]
self._years_lifespan = [technology["years_lifespan"] for technology in _technologies] self._years_lifespan = [technology["years_lifespan"] for technology in _technologies]
self._amount_of_technologies = len(self.label) self._amount_of_technologies = len(self.label)
@ -44,7 +46,15 @@ class JsonSettingsExtractor:
@property @property
def kwh_expenditure(self): def kwh_expenditure(self):
return np.array(self._kwh_expenditure) return np.array(self._kwh_expenditure)
@property
def maintenance_price(self):
return self._maintenance_price
@property
def maintenance_interval(self):
return self._maintenance_interval
@property @property
def percent_inflation(self): def percent_inflation(self):
return np.array(self._percent_inflation) return np.array(self._percent_inflation)
@ -83,7 +93,7 @@ def main():
increase_expenditure = np.zeros(input_data.amount_of_technologies) increase_expenditure = np.zeros(input_data.amount_of_technologies)
# Handle possible replacement of heating system # Handle possible replacement of heating system
for j in range(len(input_data.years_lifespan)): for j in range(input_data.amount_of_technologies):
if (year % input_data.years_lifespan[j]) == 0 and year == 0: if (year % input_data.years_lifespan[j]) == 0 and year == 0:
increase_installation[j] = input_data.installation_price[j] increase_installation[j] = input_data.installation_price[j]
elif (year % input_data.years_lifespan[j]) == 0 and year > 0: elif (year % input_data.years_lifespan[j]) == 0 and year > 0:
@ -91,9 +101,14 @@ def main():
else: else:
increase_installation[j] = 0 # just to be clear increase_installation[j] = 0 # just to be clear
# Handle possible maintenance
for j in range(input_data.amount_of_technologies):
if (year % input_data.maintenance_interval[j]) == 0 and year != 0:
increase_expenditure[j] += input_data.maintenance_price[j]
# Calculate increase # Calculate increase
inflation_factor = np.array([1.0 + (x * year) / 100.0 for x in input_data.percent_inflation]) inflation_factor = np.array([1.0 + (x * year) / 100.0 for x in input_data.percent_inflation])
increase_expenditure = input_data.kwh_expenditure * inflation_factor increase_expenditure = input_data.kwh_expenditure * input_data._kwh_price * inflation_factor
increase_total = increase_installation + increase_expenditure increase_total = increase_installation + increase_expenditure
# Safe the yearly costs for plotting # Safe the yearly costs for plotting

Loading…
Cancel
Save