SSC Module PVWattsv5_1ts vs pvsamv1 and shading

6 posts / 0 new
Last post
Stephen Peters
SSC Module PVWattsv5_1ts vs pvsamv1 and shading


I am fairly new to using SAM and the SDK so please bare with me. (and if there is some documentation I have missed please point me that way)

I am using the python SSC API and would like to incorporate shading into the time series predictions I am making. I understand that SAM has the ability to incorporate shading via the pvsamv1 module.

If I switch to using this module I get an error saying "precheck input: variable 'solar_resource_file' required but not assigned time -1".

I have not assigned 'solar_resource_file' as I am feeding in the resource data and using the SSC to make a prediction one timestamp at a time, as seen below.

Is it possible to use pvsamv1 in a similar way I am using PVwattsV5_1ts? If not is there a way to incorporate self-shading losses into the PVwatts calculations based on the parameters I have such as fixed or tracker, GCR, tilt?

Any help would be great!! Thanks in advance!

#### example code ####

for idx, row in solarData.iterrows():
year = row['datatime'].year
month = row['datatime'].month
day = row['datatime'].day
hour = row['datatime'].hour
dni = row['dni']
diffuse = row['diffuse']
temp = row['temp']
wndspd = row['windspeed']

poaIn, tcellIn, dcIn, acIn = self._samSDK(year, month, day, hour, self.min_past_hour,, self.lon,, dni, diffuse, temp, wndspd, self.track, poaPrev)

Paul Gilman

Dear Stephen,

For documentation of both SAM's detailed photovoltaic model and PVWatts, please see the Performance Model documentation page:

The latest version of SAM (2016.3.14 r4) has a code generator that generates code in each of the languages supported by the SAM SDK, including Python. That might be a useful way for you to avoid errors caused by incorrectly assigning values to inputs. To use the code generator, start SAM and create a case for a system like the one you would like to model in the SDK. Then, on the Case menu (click the carrot symbol next to the case's name on the Case tab at the top of the SAM window), click Generate code, and choose a language.

In pvsamv1, you can use solar_resource_data instead of solar_resource_file to use an array of weather data in place of a weather file. However, it is not possible to run pvsamv1 for a single time step as it is with pvwattsv5_1ts, so you have to provide pvsamv1 with a full year's worth of weather data.

In PVWatts V5, when you choose 1 Axis Tracking (array_type = 2) or 1 Axis Backtracking (array_type = 3) for the Array type, the model automatically calculates self-shading losses. In pvsamv1, it is possible to use one-axis tracking with no self shading, but not in PVWatts.

Best regards,

Stephen Peters

Hi Paul,

That is very helpful. Thank you very much. I will investigate the code generator function.

Just one follow up questions.

For PVWatts V5, will self-shading be automatically calculated for fixed tilt (array_type =0)?


Paul Gilman

Dear Stephen,

No. PVWatts V5 only calculates self-shading for the one-axis tracking options.

Best regards,

Stephen Peters

Cheers Paul.


Thank you Paul.

Tags: SAM and SDK

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer