Cycle through TMY3 for PV profiles

5 posts / 0 new
Last post
gorman_will
Cycle through TMY3 for PV profiles

I would like to run through all of the US TMY3 locations provided within SAM to generate solar PV profiles for each site. Running through the 1400 sites individually seemed a little too time consuming and I was wondering whether there is a script already out there which cycles through the simulator using some default characteristics to generate a CSV file with the 8760 PV profile.

If not, what is the best way to write such a script with SAM?

Thanks,
Will

Paul Gilman

Dear Will,

Have a look at Sample LK script #7 on the samples page:

https://sam.nrel.gov/samples

Best regards,
Paul.

Y

gorman_will

Worked great, thank you Paul! Within this script, is there an easy way to adjust the tilt of the PV panel to equal to the latitude of the weather location?

Paul Gilman

Dear Will,

Yes, you can do that.

For the Detailed PV model, you can just check the Tilt=latitude check box on the System Design page.

For PVWatts, you have to be a little careful because before you run a simulation, the lat might store the value that you see on the Location and Resource page, not the value from the weather file. To make sure you are getting the value from the weather file and not from the user interface, you should run a simulation before reading the tilt value like this:


// be sure to set the weather file before this code snippet

output('Latitude before simulation: ' + lat); // might be value from user interface instead of weather file

simulate(); // this will set lat to the value from the weather file
output('Latitude after simulation: ' + lat); // should be value from weather file

latitude = get('lat');
set('tilt',latitude);

outln('tilt = ' + tilt);
outln('latitude = ' + lat);

simulate(); // this should generate results with tilt=latitude

Best regards,
Paul.

Paul Gilman

Dear Will,

Yes, you can do that.

For the Detailed PV model, you can just check the Tilt=latitude check box on the System Design page.

For PVWatts, you have to be a little careful because before you run a simulation, the lat might store the value that you see on the Location and Resource page, not the value from the weather file. To make sure you are getting the value from the weather file and not from the user interface, you should run a simulation before reading the tilt value like this, assuming you set the weather file before this code snippet:

output('Latitude before simulation: ' + lat);

simulate();
output('Latitude after simulation: ' + lat);

latitude = get('lat');
set('tilt',latitude);

outln('tilt = ' + tilt);
outln('latitude = ' + lat);

simulate();

Best regards,
Paul.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer