Hello everyone!
I am currently working on a model for a PV system
with east-west orientation and am trying to import data from PVGIS.
However, I am encountering a problem that I do not fully understand and
would appreciate your help.
The error occurs when I run modelchain.run_model in my code and is: TypeError: Input must be a tuple of length 2, got DataFrame.
Unfortunately,
I've reached a point where I don't know what to do and hope that
someone of you can shed some light on this. I would greatly appreciate
any assistance or advice on how to solve this problem.
Many thanks in advance and best regards,
Richard
PV Simulation
# Location
lat = row['Coord_lat']
lon = row['Coord_long']
alti = row['altitude']
location = Location(latitude=lat, longitude=lon, tz='Europe/Berlin', altitude=alti, name='EDID NR_Test')
arrays = [
Array(FixedMount(surface_tilt=(30), surface_azimuth=(270)),
name = "West Facing Arra",
module_parameters=module,
temperature_model_parameters=temperature_parameters,
modules_per_string=m_string,
strings=s_inverter),
Array(FixedMount(surface_tilt=(30), surface_azimuth=(90)),
name = "East Facing Arra",
module_parameters=module,
temperature_model_parameters=temperature_parameters,
modules_per_string=m_string,
strings=s_inverter)
]
system = PVSystem(arrays=arrays, inverter_parameters=inverter)
modelchain = ModelChain(system, location)
# PV-GIS of east-west system
# east orientation
poa_data_east, meta_east, inputs_east = pvlib.iotools.get_pvgis_hourly(
latitude=lat, longitude=lon,
start=start_, end=end_,
raddatabase="PVGIS-SARAH2", components=True,
surface_tilt=(30), # fixed tilt angle
surface_azimuth=90, # Fixed alignment for east orientation
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/v5_2/', map_variables=True, timeout=30)
# west orientation
poa_data_west, meta_west, inputs_west = pvlib.iotools.get_pvgis_hourly(
latitude=lat, longitude=lon,
start=start_, end=end_,
raddatabase="PVGIS-SARAH2", components=True,
surface_tilt=(30), # fixed tilt angle
surface_azimuth=-90, # Fixed alignment for west orientation
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/v5_2/', map_variables=True, timeout=30)
poa_data_2020 = poa_data_east.add(poa_data_west, fill_value=0)
poa_data_2020['poa_diffuse'] = poa_data_2020['poa_sky_diffuse'] + poa_data_2020['poa_ground_diffuse']
poa_data_2020['poa_global'] = poa_data_2020['poa_diffuse'] + poa_data_2020['poa_direct']
poa_data_2020.index = pd.to_datetime(poa_data_2020.index)
modelchain.run_model_from_poa(poa_data_2020)
total_production = modelchain.results.ac.sum()