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 # Gesamterzeugung, Gesamtverbrauch und Nettoverbrauch plotten
def plot_consumption(self): def plot_consumption(self):
total_consumption = -1*(self.consumer.final_consumption + self.producer.final_consumption) 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 = self.producer.final_production
total_production_mean = total_production.rolling(168).mean()
net_value = total_consumption + total_production 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-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 = pd.date_range(start='2018-12-31', end ='2019-12-31', freq='1h')
x = x[:-1] x = x[:-1]
# Plot dimensionieren # Plot dimensionieren
plt.figure(figsize=(10, 6)) plt.figure(figsize=(15, 9))
# y-Werte den x-Werten zuordnen
plt.bar(x, total_consumption) # Barplot anlegen
plt.bar(x, total_production)
plt.bar(x, net_value) #plt.bar(x, total_consumption)
#plt.plot(x, net_value, '-') #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 # Titel und Achsenbeschriftungen anlegen
plt.xlabel('Stunde') plt.xlabel('Kalendertag')
plt.ylabel('Strom (kWh)') plt.ylabel('Leistung (W)')
plt.title('Produktion/Verbrauch Nachbarschaft') #plt.title('Nettoleistung Nachbarschaft Standardfalll')
plt.title('Rollendes Mittel (7 Tage) Netto-Leistung Nachbarschaft Standardfall')
# X-Ticks nur monatlich plotten # X-Ticks nur monatlich plotten
monthly_ticks = pd.date_range(start='2018-12-31', end ='2019-12-31', freq='1MS') monthly_ticks = pd.date_range(start='2018-12-31', end ='2019-12-31', freq='1MS')
plt.xticks(monthly_ticks) plt.xticks(monthly_ticks)
# Legende anlegen # 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 # X-Labels rotieren
plt.xticks(rotation=45) plt.xticks(rotation=45)
# Grid anlegen # Grid anlegen
plt.grid(color='black', axis='y', linestyle='--', linewidth=0.5) plt.grid(color='black', axis='y', linestyle='--', linewidth=0.5)
plt.show() plt.show()

View File

@@ -20,8 +20,6 @@ from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
latitude = 47.2675 latitude = 47.2675
longitude = 11.3910 longitude = 11.3910
tz = 'Europe/Vienna' tz = 'Europe/Vienna'
surface_tilt = 0
surface_azimuth = 180
year = 2019 year = 2019
# Daten für Datenbank -> Module + WR # Daten für Datenbank -> Module + WR
@@ -33,8 +31,8 @@ inverter = database_inverter['ABB__PVI_4_2_OUTD_US__208V_']
# PV-Anlage definieren # PV-Anlage definieren
modules_per_string = 10 modules_per_string = 10
strings_per_inverter = 2 strings_per_inverter = 2
surface_tilt = 0 surface_tilt = 20
surface_azimuth = 180 surface_azimuth = 150
# Temperaturparameter definieren # Temperaturparameter definieren
temperature_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass'] temperature_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
@@ -62,7 +60,7 @@ def create_production_profile():
# Hier ist Süden Azimuth = 0°, bei PVLib ist es 180° # Hier ist Süden Azimuth = 0°, bei PVLib ist es 180°
poa_data, meta, inputs = pvlib.iotools.get_pvgis_hourly(latitude=latitude, longitude=longitude, start=year, end=year, raddatabase='PVGIS-SARAH3', components=True, surface_tilt=surface_tilt, poa_data, meta, inputs = pvlib.iotools.get_pvgis_hourly(latitude=latitude, longitude=longitude, start=year, end=year, raddatabase='PVGIS-SARAH3', components=True, surface_tilt=surface_tilt,
surface_azimuth=surface_azimuth-180, outputformat='json', usehorizon=True, userhorizon=None, pvcalculation=False, peakpower=None, surface_azimuth=surface_azimuth-150, outputformat='json', usehorizon=True, userhorizon=None, pvcalculation=False, peakpower=None,
pvtechchoice='crystSi', mountingplace='free', loss=0, trackingtype=0, optimal_surface_tilt=False, optimalangles=False, pvtechchoice='crystSi', mountingplace='free', loss=0, trackingtype=0, optimal_surface_tilt=False, optimalangles=False,
url='https://re.jrc.ec.europa.eu/api/', map_variables=True, timeout=30) url='https://re.jrc.ec.europa.eu/api/', map_variables=True, timeout=30)