I'm trying to model utility-scale PV plants using generation data from NREL's NRSDB dataset, but have not quite figured out how to do so in PVLib. I believe the correct approach should be to create a PVSystem object where I specify modules_per_string and strings_per_inverter (which I have estimated using SAM), then use ModelChain in conjunction with a Location object and weather data from NRSDB.
Using NREL's SAM, using the BP Solar BP3220N module and ABB Ultra 690V inverter, I need 23 modules per string and 9,897 strings in parallel to yield a 50 MW plant. I have tried to reproduce this configuration below.
Below is the code I have been using.
import os
import pandas as pd
import numpy as np
import pvlib
from pvlib.pvsystem import PVSystem
from pvlib.location import Location
from pvlib.modelchain import ModelChain
from pvlib.modelchain import basic_chain
def importPSMData():
df = pd.read_csv('C:\\Users\\mtcraig\\Documents\\NSRDBData\\dd\\622240_30.77_-99.3_tmy.csv',skiprows=[0,1])
#Rename paramters for input to PVlib
df.rename(columns={'DHI':'dhi','DNI':'dni','GHI':'ghi','Temperature':'temp_air',
'Wind Speed':'wind_speed'},inplace=True)
#Rename date parameters in order to run to_datetime
df.rename(columns={'Year':'year','Month':'month','Day':'day','Hour':'hour',
'Minute':'minute'},inplace=True)
df['dt'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']])
#Set index to DT for run_model call
df.set_index(df['dt'],inplace=True)
#Drop unnecessary columns
df = df.drop('Dew Point', 1)
df = df.drop('Pressure', 1)
df = df.drop('year', 1)
df = df.drop('month', 1)
df = df.drop('day', 1)
df = df.drop('hour', 1)
df = df.drop('minute', 1)
df = df.drop('dt',1)
return df
sandia_modules = pvlib.pvsystem.retrieve_sam('SandiaMod')
cec_inverters = pvlib.pvsystem.retrieve_sam('cecinverter')
module = sandia_modules['BP_Solar_BP3220N_Module___2010_'] #18% eff, c-Si
inv = cec_inverters['ABB__ULTRA_1100_TL_OUTD_3_US_690_x_y_z_690V__CEC_2013_']
system = PVSystem(module_parameters=module,inverter_parameters=inv,surface_azimuth=180,
modules_per_string=23,strings_per_inverter=9897)
loc = Location(latitude=30.77,longitude=-99.3,tz='Etc/GMT+7',altitude=500)
mc = ModelChain(system,loc,name='test',
orientation_strategy='south_at_latitude_tilt')
weatherData = importPSMData()
mc.run_model(times=weatherData.index,weather=weatherData)
print(mc.ac)
And here is the output for 1 day, but all output is the same:
print(mc.ac)
dt
2013-01-01 00:00:00 NaN
2013-01-01 01:00:00 NaN
2013-01-01 02:00:00 NaN
2013-01-01 03:00:00 NaN
2013-01-01 04:00:00 NaN
2013-01-01 05:00:00 NaN
2013-01-01 06:00:00 NaN
2013-01-01 07:00:00 NaN
2013-01-01 08:00:00 NaN
2013-01-01 09:00:00 NaN
2013-01-01 10:00:00 NaN
2013-01-01 11:00:00 NaN
2013-01-01 12:00:00 NaN
2013-01-01 13:00:00 NaN
2013-01-01 14:00:00 1170000.0
2013-01-01 15:00:00 1170000.0
2013-01-01 16:00:00 1170000.0
2013-01-01 17:00:00 1170000.0
2013-01-01 18:00:00 NaN
2013-01-01 19:00:00 NaN
2013-01-01 20:00:00 NaN
2013-01-01 21:00:00 NaN
2013-01-01 22:00:00 NaN
2013-01-01 23:00:00 NaN
My weather data for that day is as below:
dt dhi dni ghi temp_air wind_speed
1/1/2013 0:00 0 0 0 8.779901123 3
1/1/2013 1:00 0 0 0 8.503381348 3
1/1/2013 2:00 0 0 0 8.082849121 2
1/1/2013 3:00 0 0 0 7.553338623 3
1/1/2013 4:00 0 0 0 6.817102051 3
1/1/2013 5:00 0 0 0 6.063470459 3
1/1/2013 6:00 0 0 0 5.250634766 3
1/1/2013 7:00 0 0 0 4.292138672 3
1/1/2013 8:00 3 0 3 4.388421631 3
1/1/2013 9:00 49 0 49 4.977044678 3
1/1/2013 10:00 177 157 241 6.834771729 3
1/1/2013 11:00 239 131 307 8.402886963 2
1/1/2013 12:00 184 576 518 9.695245361 2
1/1/2013 13:00 90 939 643 10.30196533 2
1/1/2013 14:00 86 926 592 10.1447998 2
1/1/2013 15:00 91 729 420 9.404504395 2
1/1/2013 16:00 123 246 200 8.237115479 2
1/1/2013 17:00 29 0 29 6.443383789 2
1/1/2013 18:00 0 0 0 5.289483643 2
1/1/2013 19:00 0 0 0 4.527764893 2
1/1/2013 20:00 0 0 0 3.753839111 2
1/1/2013 21:00 0 0 0 2.97612915 2
1/1/2013 22:00 0 0 0 2.200036621 2
1/1/2013 23:00 0 0 0 1.460778809 2
Thank you for any help you can provide. -Michael