SamUL scripting language using inputs of tilt, azimuth, DC Nameplate kW, for a batch of locations

  • Mary Knipe
  • Topic Author
More
24 Sep 2012 15:54 #878 by Mary Knipe
I am using SamUL scripting language with inputs of tilt, azimuth, DC Nameplate kW, for a batch of locations.

setinput( "climate.location", weatherfile )
setinput( "pvwatts.dcrate", size )
setinput( "pv.cost.per_module", module_cost )
setinput( "ur.flat.buy_rate", rate/100.0 )
setinput( "pvwatts.tilt", tilt)
setinput( "pvwatts.azimuth", azimuth)
setinput( "pvwatts.derate", derate)
outln("Simulating location: " + address)

I am able to do this but is there a way to use TMY3 data rather than the perez tdy weather data?
Please let me know how to proceed.

Please Log in or Create an account to join the conversation.

  • pgilman
More
25 Sep 2012 10:19 #879 by pgilman
Hi Mary,

You should be able to use any valid weather file format (TMY2, TMY3, EPW, etc.).

In your script, if you have a valid TMY3 file named my_tmy3_file.csv in the c:\Weather Data folder, then you should be able to use the file by assigning weatherfile variable's value to the path + filename:

weatherfile = "c:/Weather Data/my_tmy3_file.csv"

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • Mary Knipe
  • Topic Author
More
26 Sep 2012 19:08 #880 by Mary Knipe
Hi,

How would I be able to match weather TMY3 stations with PV site locations such as an address or lat,long coordinates? If I did what you suggested it would only reference one file.
weatherfile = "c:/Weather Data/my_tmy3_file.csv"
How would I be able to take a batch of sites, not all in the same area, and have the closest TMY3 file referenced for each site?

Thank you for your help.
Mary

Please Log in or Create an account to join the conversation.

  • pgilman
More
01 Oct 2012 13:15 #881 by pgilman
Hi Mary,

To use SamUL to match a TMY3 file with a location, you would need to do the following:

1. Download all of the TMY3 files to your computer so that you can search them.

2. Design an algorithm to match a location to the latitude and longitude stored in a TMY3 file. It would have to convert street addresses to latitude and longitude, and then find the TMY3 file with coordinates nearest to a desired location.

3. Implement and test the algorithm in SamUL.

The Google Geocoding API is a useful resource for converting street addresses to latitude/longitude values. You could make calls to the API from SamUL. (I assume you've seen the example of how to do that in the sample SamUL script that comes with SAM.)

So, it is possible to do what you describe, but it would require a substantial programming effort.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • Mary Knipe
  • Topic Author
More
09 Oct 2012 22:18 #882 by Mary Knipe
Hi Paul,

Thank you for your help with SamUL. I am still having trouble getting the script to read the weather file. I decided to try using just one file for sites located near a weather station. I keep getting simulation errors that say I have a Bad weather file. Is there a special format needed for the weather file?
I have attached the file I am using and zsam file. Can you tell me what I am doing wrong? Please take a look and let me know where I have gone wrong.

Best regards,
Mary

Please Log in or Create an account to join the conversation.

  • pgilman
More
10 Oct 2012 13:00 #883 by pgilman
Hi Mary,

Attached is a SAM file with two SamUL scripts that run with a PVWatts case. One runs a simulation using your weather file my_tmy3_file.csv, and the other runs simulations using weather files from the NREL Mercator website using the Google geocoding API, and sets the array tilt angle to the location's latitude. Both display some basic results.

Hopefully you can use those examples to troubleshoot your script.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum