pv_input File erstellt
This commit is contained in:
67
pv_input.py
Normal file
67
pv_input.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import pvlib
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
# Standortbedingungen (z.B. München, Deutschland)
|
||||||
|
latitude = 48.1351
|
||||||
|
longitude = 11.5820
|
||||||
|
tz = 'Europe/Berlin'
|
||||||
|
|
||||||
|
# Abrufen der Wetter- und Strahlungsdaten für den Standort von PVGIS
|
||||||
|
weather_data, meta = pvlib.iotools.get_pvgis_tmy(latitude, longitude)
|
||||||
|
|
||||||
|
# Zeitstempel setzen und Zeitzonenkonvertierung
|
||||||
|
weather_data.index = weather_data.index.tz_localize(tz)
|
||||||
|
|
||||||
|
# PV Modulbedingungen
|
||||||
|
module_parameters = {
|
||||||
|
'pdc0': 240,
|
||||||
|
'gamma_pdc': -0.004
|
||||||
|
}
|
||||||
|
|
||||||
|
# Wechselrichterbedingungen
|
||||||
|
inverter_parameters = {
|
||||||
|
'pdc0': 240,
|
||||||
|
'eta_inv_nom': 0.96
|
||||||
|
}
|
||||||
|
|
||||||
|
# Erstellung des Standort-Objekts
|
||||||
|
site = pvlib.location.Location(latitude, longitude, tz=tz)
|
||||||
|
|
||||||
|
# Solarpositions-Array
|
||||||
|
solar_position = site.get_solarposition(weather_data.index)
|
||||||
|
|
||||||
|
# Erstellen eines PV-Systems
|
||||||
|
system = pvlib.pvsystem.PVSystem(
|
||||||
|
surface_tilt=30,
|
||||||
|
surface_azimuth=180,
|
||||||
|
module_parameters=module_parameters,
|
||||||
|
inverter_parameters=inverter_parameters
|
||||||
|
)
|
||||||
|
|
||||||
|
# Berechnen der Einfallswinkelmodifikatoren (AOI)
|
||||||
|
mc = system.get_aoi(solar_position['apparent_zenith'], solar_position['azimuth'])
|
||||||
|
|
||||||
|
# Berechnen der Strahlungswerte auf der Moduloberfläche
|
||||||
|
poa_irrad = system.get_irradiance(weather_data['Gb(n)'], weather_data['G(h)'], weather_data['Gd(h)'], mc)
|
||||||
|
|
||||||
|
# Modellierung der Zelltemperatur
|
||||||
|
tcell = pvlib.temperature.sapm_cell(poa_irrad['poa_global'], weather_data['T2m'], weather_data['WS10m'])
|
||||||
|
|
||||||
|
# Modellierung der DC-Leistung
|
||||||
|
dc_power = system.pvwatts_dc(poa_irrad['poa_global'], tcell)
|
||||||
|
|
||||||
|
# Modellierung der AC-Leistung
|
||||||
|
ac_power = system.pvwatts_ac(dc_power)
|
||||||
|
|
||||||
|
# Jahresertrag berechnen
|
||||||
|
annual_energy = ac_power.sum() / 1000 # kWh
|
||||||
|
|
||||||
|
print(f"Jährlicher Output: {annual_energy:.2f} kWh")
|
||||||
|
|
||||||
|
# Plot der Ergebnisse
|
||||||
|
ac_power.plot()
|
||||||
|
plt.ylabel('AC Leistung (W)')
|
||||||
|
plt.xlabel('Datum')
|
||||||
|
plt.title('Täglicher Ertrag einer PV-Anlage in kWh')
|
||||||
|
plt.show()
|
||||||
Reference in New Issue
Block a user