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. 19
      heatpump.py

18
example_1.json

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

19
heatpump.py

@ -21,6 +21,8 @@ class JsonSettingsExtractor:
self._reinstallation_price = [technology["reinstallation_price"] 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._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._years_lifespan = [technology["years_lifespan"] for technology in _technologies]
self._amount_of_technologies = len(self.label)
@ -45,6 +47,14 @@ class JsonSettingsExtractor:
def kwh_expenditure(self):
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
def percent_inflation(self):
return np.array(self._percent_inflation)
@ -83,7 +93,7 @@ def main():
increase_expenditure = np.zeros(input_data.amount_of_technologies)
# 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:
increase_installation[j] = input_data.installation_price[j]
elif (year % input_data.years_lifespan[j]) == 0 and year > 0:
@ -91,9 +101,14 @@ def main():
else:
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
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
# Safe the yearly costs for plotting

Loading…
Cancel
Save