- Posts: 5
Cycle through TMY3 for PV profiles
- gorman_will
- Topic Author
Less
More
14 Nov 2017 12:25 #5878
by gorman_will
Cycle through TMY3 for PV profiles was created by gorman_will
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
If not, what is the best way to write such a script with SAM?
Thanks,
Will
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
14 Nov 2017 17:41 #5879
by pgilman
Replied by pgilman on topic Cycle through TMY3 for PV profiles
Dear Will,
Have a look at Sample LK script #7 on the samples page:
sam.nrel.gov/samples
Best regards,
Paul.
Y
Have a look at Sample LK script #7 on the samples page:
sam.nrel.gov/samples
Best regards,
Paul.
Y
Please Log in or Create an account to join the conversation.
- gorman_will
- Topic Author
Less
More
- Posts: 5
16 Nov 2017 11:56 #5880
by gorman_will
Replied by gorman_will on topic Cycle through TMY3 for PV profiles
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?
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
16 Nov 2017 16:49 #5882
by pgilman
Replied by pgilman on topic Cycle through TMY3 for PV profiles
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
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:
Best regards,
Paul.
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
Code:
lat
Code:
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.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
16 Nov 2017 16:49 #5881
by pgilman
Replied by pgilman on topic Cycle through TMY3 for PV profiles
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
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:
Best regards,
Paul.
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
Code:
lat
Code:
// 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.
Please Log in or Create an account to join the conversation.
Moderators: pgilman