mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-08-25 15:01:14 +00:00
Heatpump
This commit is contained in:
@@ -68,7 +68,7 @@ class EnergieManagementSystem:
|
||||
self.akku.energie_laden(geladene_energie)
|
||||
netzeinspeisung_wh_pro_stunde.append(überschuss - geladene_energie)
|
||||
eigenverbrauch_wh_pro_stunde.append(verbrauch)
|
||||
stündliche_einnahmen_euro = (überschuss - geladene_energie) * self.einspeiseverguetung_cent_pro_wh[stunde] / 100
|
||||
stündliche_einnahmen_euro = (überschuss - geladene_energie) * self.einspeiseverguetung_cent_pro_wh[stunde]
|
||||
netzbezug_wh_pro_stunde.append(0.0)
|
||||
else:
|
||||
netzeinspeisung_wh_pro_stunde.append(0.0)
|
||||
@@ -77,7 +77,7 @@ class EnergieManagementSystem:
|
||||
stündlicher_netzbezug_wh = benötigte_energie - aus_akku
|
||||
netzbezug_wh_pro_stunde.append(stündlicher_netzbezug_wh)
|
||||
eigenverbrauch_wh_pro_stunde.append(erzeugung)
|
||||
stündliche_kosten_euro = stündlicher_netzbezug_wh * strompreis / 100
|
||||
stündliche_kosten_euro = stündlicher_netzbezug_wh * strompreis
|
||||
akku_soc_pro_stunde.append(self.akku.ladezustand_in_prozent())
|
||||
kosten_euro_pro_stunde.append(stündliche_kosten_euro)
|
||||
einnahmen_euro_pro_stunde.append(stündliche_einnahmen_euro)
|
||||
|
55
modules/class_heatpump.py
Normal file
55
modules/class_heatpump.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import json
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import numpy as np
|
||||
from pprint import pprint
|
||||
|
||||
# Lade die .npz-Datei beim Start der Anwendung
|
||||
class Waermepumpe:
|
||||
def __init__(self, max_heizleistung):
|
||||
self.max_heizleistung = max_heizleistung
|
||||
|
||||
def cop_berechnen(self, aussentemperatur):
|
||||
cop = 3.0 + (aussentemperatur-0) * 0.1
|
||||
return max(cop, 1)
|
||||
|
||||
|
||||
def heizleistung_berechnen(self, aussentemperatur):
|
||||
#235.092 kWh + Temperatur * -11.645
|
||||
heizleistung = (((235.0) + aussentemperatur*(-11.645))*1000)/24.0
|
||||
heizleistung = min(self.max_heizleistung,heizleistung)
|
||||
return heizleistung
|
||||
|
||||
def elektrische_leistung_berechnen(self, aussentemperatur):
|
||||
heizleistung = self.heizleistung_berechnen(aussentemperatur)
|
||||
cop = self.cop_berechnen(aussentemperatur)
|
||||
return heizleistung / cop
|
||||
|
||||
def simulate_24h(self, temperaturen):
|
||||
leistungsdaten = []
|
||||
for temp in temperaturen:
|
||||
elektrische_leistung = self.elektrische_leistung_berechnen(temp)
|
||||
leistungsdaten.append(elektrische_leistung)
|
||||
return leistungsdaten
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Beispiel für die Verwendung der Klasse
|
||||
if __name__ == '__main__':
|
||||
max_heizleistung = 5000 # 5 kW Heizleistung
|
||||
start_innentemperatur = 15
|
||||
isolationseffizienz = 0.8
|
||||
gewuenschte_innentemperatur = 20
|
||||
wp = Waermepumpe(max_heizleistung)
|
||||
|
||||
print(wp.cop_berechnen(-10)," ",wp.cop_berechnen(0), " ", wp.cop_berechnen(10))
|
||||
# 24 Stunden Außentemperaturen (Beispielwerte)
|
||||
temperaturen = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -5, -2, 5]
|
||||
|
||||
# Berechnung der 24-Stunden-Leistungsdaten
|
||||
leistungsdaten = wp.simulate_24h(temperaturen)
|
||||
|
||||
print(leistungsdaten)
|
@@ -63,7 +63,15 @@ class PVForecast:
|
||||
daily_forecast.append(d.get_ac_power())
|
||||
|
||||
return np.array(daily_forecast)
|
||||
|
||||
|
||||
def get_temperature_forecast_for_date(self, input_date_str):
|
||||
input_date = datetime.strptime(input_date_str, "%Y-%m-%d")
|
||||
daily_forecast_obj = [data for data in self.forecast_data if datetime.strptime(data.get_date_time(), "%Y-%m-%dT%H:%M:%S.%f%z").date() == input_date.date()]
|
||||
daily_forecast = []
|
||||
for d in daily_forecast_obj:
|
||||
daily_forecast.append(d.get_temperature())
|
||||
|
||||
return np.array(daily_forecast)
|
||||
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def visualisiere_ergebnisse(last, pv_forecast, strompreise, ergebnisse):
|
||||
def visualisiere_ergebnisse(last,leistung_haushalt,leistung_wp, pv_forecast, strompreise, ergebnisse):
|
||||
stunden = np.arange(1, 25) # 1 bis 24 Stunden
|
||||
|
||||
# Last und PV-Erzeugung
|
||||
@@ -10,6 +10,8 @@ def visualisiere_ergebnisse(last, pv_forecast, strompreise, ergebnisse):
|
||||
|
||||
plt.subplot(3, 1, 1)
|
||||
plt.plot(stunden, last, label='Last (Wh)', marker='o')
|
||||
plt.plot(stunden, leistung_haushalt, label='leistung_haushalt (Wh)', marker='o')
|
||||
plt.plot(stunden, leistung_wp, label='leistung_wp (Wh)', marker='o')
|
||||
plt.plot(stunden, pv_forecast, label='PV-Erzeugung (Wh)', marker='x')
|
||||
plt.title('Last und PV-Erzeugung')
|
||||
plt.xlabel('Stunde des Tages')
|
||||
@@ -19,10 +21,10 @@ def visualisiere_ergebnisse(last, pv_forecast, strompreise, ergebnisse):
|
||||
|
||||
# Strompreise
|
||||
plt.subplot(3, 1, 2)
|
||||
plt.plot(stunden, strompreise, label='Strompreis (Cent/Wh)', color='purple', marker='s')
|
||||
plt.plot(stunden, strompreise, label='Strompreis (€/Wh)', color='purple', marker='s')
|
||||
plt.title('Strompreise')
|
||||
plt.xlabel('Stunde des Tages')
|
||||
plt.ylabel('Preis (Cent/Wh)')
|
||||
plt.ylabel('Preis (€/Wh)')
|
||||
plt.legend()
|
||||
plt.grid(True)
|
||||
|
||||
|
Reference in New Issue
Block a user