PV-Simulation funktioniert
This commit is contained in:
84
pv_input.py
84
pv_input.py
@@ -1,67 +1,39 @@
|
|||||||
import pandas as pd
|
|
||||||
import pvlib
|
import pvlib
|
||||||
|
import pandas as pd
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from pvlib.modelchain import ModelChain
|
||||||
|
from pvlib.location import Location
|
||||||
|
from pvlib.pvsystem import PVSystem
|
||||||
|
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
|
||||||
|
|
||||||
# Standortbedingungen (z.B. München, Deutschland)
|
latitude = 47.2675
|
||||||
latitude = 48.1351
|
longitude = 11.3910
|
||||||
longitude = 11.5820
|
tz = 'Europe/Vienna'
|
||||||
tz = 'Europe/Berlin'
|
surface_tilt = 0
|
||||||
|
surface_azimuth = 180
|
||||||
|
|
||||||
# Abrufen der Wetter- und Strahlungsdaten für den Standort von PVGIS
|
database_module = pvlib.pvsystem.retrieve_sam('SandiaMod')
|
||||||
weather_data, meta = pvlib.iotools.get_pvgis_tmy(latitude, longitude)
|
database_inverter = pvlib.pvsystem.retrieve_sam('CECInverter')
|
||||||
|
|
||||||
# Zeitstempel setzen und Zeitzonenkonvertierung
|
module = database_module['Canadian_Solar_CS5P_220M___2009_']
|
||||||
weather_data.index = weather_data.index.tz_localize(tz)
|
inverter = database_inverter['ABB__PVI_4_2_OUTD_US__208V_']
|
||||||
|
modules_per_string = 10
|
||||||
|
strings_per_inverter = 2
|
||||||
|
|
||||||
# PV Modulbedingungen
|
temperature_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
|
||||||
module_parameters = {
|
|
||||||
'pdc0': 240,
|
|
||||||
'gamma_pdc': -0.004
|
|
||||||
}
|
|
||||||
|
|
||||||
# Wechselrichterbedingungen
|
location = Location(latitude, longitude, tz)
|
||||||
inverter_parameters = {
|
system = PVSystem(surface_tilt=surface_tilt, surface_azimuth=surface_azimuth, module_parameters=module,
|
||||||
'pdc0': 240,
|
inverter_parameters=inverter, temperature_model_parameters=temperature_parameters,
|
||||||
'eta_inv_nom': 0.96
|
modules_per_string=modules_per_string, strings_per_inverter=strings_per_inverter)
|
||||||
}
|
|
||||||
|
|
||||||
# Erstellung des Standort-Objekts
|
modelchain = ModelChain(system, location)
|
||||||
site = pvlib.location.Location(latitude, longitude, tz=tz)
|
|
||||||
|
|
||||||
# Solarpositions-Array
|
times = pd.date_range(start='2021-07-01', end ='2021-07-07', freq='1min', tz=location.tz)
|
||||||
solar_position = site.get_solarposition(weather_data.index)
|
|
||||||
|
|
||||||
# Erstellen eines PV-Systems
|
clear_sky = location.get_clearsky(times)
|
||||||
system = pvlib.pvsystem.PVSystem(
|
#clear_sky.plot(figsize=(16,9))
|
||||||
surface_tilt=30,
|
|
||||||
surface_azimuth=180,
|
|
||||||
module_parameters=module_parameters,
|
|
||||||
inverter_parameters=inverter_parameters
|
|
||||||
)
|
|
||||||
|
|
||||||
# Berechnen der Einfallswinkelmodifikatoren (AOI)
|
modelchain.run_model(clear_sky)
|
||||||
mc = system.get_aoi(solar_position['apparent_zenith'], solar_position['azimuth'])
|
modelchain.results.ac.plot(figsize=(16,9))
|
||||||
|
plt.show()
|
||||||
# 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