PV-Ausrichtung angepasst, Neighborhood formatiert

This commit is contained in:
2025-01-03 14:48:00 +01:00
parent eb130b6be2
commit 65a56bb5a2
2 changed files with 29 additions and 16 deletions

View File

@@ -63,30 +63,45 @@ class Neighborhood:
# Gesamterzeugung, Gesamtverbrauch und Nettoverbrauch plotten
def plot_consumption(self):
total_consumption = -1*(self.consumer.final_consumption + self.producer.final_consumption)
total_consumption_mean = total_consumption.rolling(168).mean()
total_production = self.producer.final_production
total_production_mean = total_production.rolling(168).mean()
net_value = total_consumption + total_production
net_value_mean = net_value.rolling(168).mean()
# X-Werte anlegen, einen Wert löschen da 8761 Werte vorhanden sind, aber nur 8760 benötigt werden
x = pd.date_range(start='2018-12-31', end ='2019-12-31', freq='1h')
x = x[:-1]
# Plot dimensionieren
plt.figure(figsize=(10, 6))
# y-Werte den x-Werten zuordnen
plt.bar(x, total_consumption)
plt.bar(x, total_production)
plt.bar(x, net_value)
#plt.plot(x, net_value, '-')
plt.figure(figsize=(15, 9))
# Barplot anlegen
#plt.bar(x, total_consumption)
#plt.bar(x, total_production,color='orange')
#plt.bar(x, net_value,color='forestgreen')
# Rollendes Mittel plotten
#plt.plot(x, net_value_mean,'-',color='forestgreen')
# Titel und Achsenbeschriftungen anlegen
plt.xlabel('Stunde')
plt.ylabel('Strom (kWh)')
plt.title('Produktion/Verbrauch Nachbarschaft')
plt.xlabel('Kalendertag')
plt.ylabel('Leistung (W)')
#plt.title('Nettoleistung Nachbarschaft Standardfalll')
plt.title('Rollendes Mittel (7 Tage) Netto-Leistung Nachbarschaft Standardfall')
# X-Ticks nur monatlich plotten
monthly_ticks = pd.date_range(start='2018-12-31', end ='2019-12-31', freq='1MS')
plt.xticks(monthly_ticks)
# Legende anlegen
plt.legend(['Verbrauch', 'Produktion', 'Netto-Wert'], loc='upper right')
#plt.legend(['Verbrauch', 'Erzeugung'], loc='upper right')
#plt.legend(['Verbrauch', 'Erzeugung', 'Netto-Wert'], loc='upper right')
# X-Labels rotieren
plt.xticks(rotation=45)
# Grid anlegen
plt.grid(color='black', axis='y', linestyle='--', linewidth=0.5)
plt.show()