pv_input auskommentiert
This commit is contained in:
28
pv_input.py
28
pv_input.py
@@ -1,3 +1,13 @@
|
||||
# 3 Möglichkeiten für Ertragsberechnung: Clear Sky Modell, TMY oder POA-Data
|
||||
# Clear Sky: Strahlungsmodell, welches theoretische Strahlungsdaten an bestimmten Standpunkt enthält welche eine flache Oberfläche treffen - vewerndet g(i)-Strahlungsdaten
|
||||
# TMY = Typical Meteorolical Year - reale Strahlungsdaten welche eine flache Oberfläche treffen - vewerndet g(i)-Strahlungsdaten
|
||||
# POA = Plane of Array - was das PV-Modul (und dessen Ausrichtung) wirklich trifft - verwendet POA-Strahlungsdaten
|
||||
|
||||
# G(i), poa_global = Global irradiance on inclined plane (W/m^2)
|
||||
# Gb(i), poa_direct = Beam (direct) irradiance on inclined plane (W/m^2)
|
||||
# Gd(i), poa_sky_diffuse = Diffuse irradiance on inclined plane (W/m^2)
|
||||
# Gr(i), poa_ground_diffuse = Reflected irradiance on inclined plane (W/m^2)
|
||||
|
||||
import pvlib
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
@@ -29,7 +39,7 @@ surface_azimuth = 180
|
||||
# Temperaturparameter definieren
|
||||
temperature_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
|
||||
|
||||
# Location+PVSystem-Objekte anlegen und Modelchain damit füttern
|
||||
# Location + PVSystem-Objekte anlegen und Modelchain damit füttern
|
||||
location = Location(latitude, longitude, tz)
|
||||
system = PVSystem(surface_tilt=surface_tilt, surface_azimuth=surface_azimuth, module_parameters=module,
|
||||
inverter_parameters=inverter, temperature_model_parameters=temperature_parameters,
|
||||
@@ -39,7 +49,8 @@ modelchain = ModelChain(system, location)
|
||||
|
||||
# Ertragssimulation mit Clear-Sky Modell
|
||||
|
||||
# times = pd.date_range(start='2021-07-01', end ='2021-07-07', freq='1h', tz=location.tz)
|
||||
# Index-Spalte mit Zeiten für clear-sky Dataset anlegen
|
||||
# times = pd.date_range(start='2020-01-01', end ='2020-12-31', freq='1h', tz=location.tz)
|
||||
|
||||
# clear_sky = location.get_clearsky(times)
|
||||
# #clear_sky.plot(figsize=(16,9))
|
||||
@@ -48,21 +59,24 @@ modelchain = ModelChain(system, location)
|
||||
|
||||
# Ertragssimulation mit realen Strahlungsdaten aus Wetterjahr
|
||||
|
||||
# Hier ist Süden Azimuth = 0
|
||||
# POA = Plane Of Array
|
||||
# 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,
|
||||
surface_azimuth=surface_azimuth-180, outputformat='json', usehorizon=True, userhorizon=None, pvcalculation=False, peakpower=None,
|
||||
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)
|
||||
# Spaltennamen umschreiben, sodass Modelchain sie verwenden kann
|
||||
|
||||
# Notwendige Spalten ausrechnen und hinzufügen, sodass Modelchain sie verwenden kann
|
||||
poa_data['poa_diffuse'] = poa_data['poa_sky_diffuse'] + poa_data['poa_ground_diffuse']
|
||||
poa_data['poa_global'] = poa_data['poa_diffuse'] + poa_data['poa_direct']
|
||||
|
||||
# Daten in csv exportieren
|
||||
#poa_data.to_csv('poa_data.csv')
|
||||
#Index des Dataframe mit datetime-Index von Pandas überschreiben
|
||||
|
||||
# Index des Dataframe mit datetime-Index von Pandas überschreiben
|
||||
poa_data.index = pd.to_datetime((poa_data.index))
|
||||
# Diese Funktion benötigt POA-Daten anstatt g(i)-Daten -> DOKU
|
||||
modelchain.run_model_from_poa(poa_data)
|
||||
|
||||
# Ergebnis plotten
|
||||
modelchain.results.ac.plot(figsize=(16,9))
|
||||
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user