- Posts: 5423
Multiple Locations simulation
- pgilman
Less
More
12 Apr 2022 16:27 #10834
by pgilman
Replied by pgilman on topic Multiple Locations simulation
Hi Adam,
I don't think the file path name is the problem if you used the choose_dir() function to get its value.
If you are seeing simulation error message, that may indicate that there is a problem with inputs in your .sam file or with data in the weather files.
Please try running the "Solar Resource File Checker" macro on the files you downloaded to make sure they are valid weather files. (Click Macros under the Simulate button to show a list of macros.) The National Solar Radiation Database (NSRDB) may not recognize latitude and longitude value with too many decimal places, so you might try editing the values to use three decimal places like 41.948,-72.475.
Please attach a copy of the .sam file and .lk script you are using if you would like me to help troubleshoot.
Best regards,
Paul.
I don't think the file path name is the problem if you used the choose_dir() function to get its value.
If you are seeing simulation error message, that may indicate that there is a problem with inputs in your .sam file or with data in the weather files.
Please try running the "Solar Resource File Checker" macro on the files you downloaded to make sure they are valid weather files. (Click Macros under the Simulate button to show a list of macros.) The National Solar Radiation Database (NSRDB) may not recognize latitude and longitude value with too many decimal places, so you might try editing the values to use three decimal places like 41.948,-72.475.
Please attach a copy of the .sam file and .lk script you are using if you would like me to help troubleshoot.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- Kayaalp
Less
More
- Posts: 7
13 Apr 2022 01:23 #10835
by Kayaalp
Replied by Kayaalp on topic Multiple Locations simulation
Hi Adam,
I've tried these processes before and was successful. I am attaching my notes for the steps I have taken. I hope it will be useful for you.
Best,
Umut Ece Kayaalp
I've tried these processes before and was successful. I am attaching my notes for the steps I have taken. I hope it will be useful for you.
Best,
Umut Ece Kayaalp
Attachments:
Please Log in or Create an account to join the conversation.
- galla1ab
Less
More
- Posts: 19
13 Apr 2022 07:31 #10836
by galla1ab
Replied by galla1ab on topic Multiple Locations simulation
Hello Paul,
Thank you for the suggestions to check the weather files before running the simulations. When preforming the checks they all came back successful with no errors, however the simulation still did not work. So I took your other suggestion and reduce the number of decimal places to three and redownloaded the weather files and the simulation ran as it should and gave me an output. There must be something with the number of decimal places in the lat long file that was causing an error. I will use a three digit decimal place lat long value from now on.
Thank you for your help.
Adam
Thank you for the suggestions to check the weather files before running the simulations. When preforming the checks they all came back successful with no errors, however the simulation still did not work. So I took your other suggestion and reduce the number of decimal places to three and redownloaded the weather files and the simulation ran as it should and gave me an output. There must be something with the number of decimal places in the lat long file that was causing an error. I will use a three digit decimal place lat long value from now on.
Thank you for your help.
Adam
Please Log in or Create an account to join the conversation.
- galla1ab
Less
More
- Posts: 19
18 Apr 2022 07:28 #10843
by galla1ab
Replied by galla1ab on topic Multiple Locations simulation
Hello Umut,
Thank you for sharing the notes. This is helpful. Reducing the number of digits in the lat and long values also helped, it looks like you have the same in your example as well.
All the best,
Adam
Thank you for sharing the notes. This is helpful. Reducing the number of digits in the lat and long values also helped, it looks like you have the same in your example as well.
All the best,
Adam
Please Log in or Create an account to join the conversation.
- galla1ab
Less
More
- Posts: 19
22 Apr 2022 07:52 #10864
by galla1ab
Replied by galla1ab on topic Multiple Locations simulation
Hello,
Thank you for all the help with downloading multiple weather files for simulation. One thing I noticed is that when I am simulating for each weather file SAM is running on all the default values. I am very new to using SAM and .lk scripts. Using the existing weather file script, is there a way to dynamically change some of the SAM parameters by integrating other values from a csv file? For example, I have a csv file with the same lat and long, the acers of the parcel at that location, and the total kW DC nameplate capacity if we assume the entire area of the parcel is used for a ground mounted solar system.
How can I read in a csv, extract data from a specific column in the csv and use that to update the system nameplate capacity for each iteration of the PVWatts model for each lat and long location?
Thank you,
Adam
Thank you for all the help with downloading multiple weather files for simulation. One thing I noticed is that when I am simulating for each weather file SAM is running on all the default values. I am very new to using SAM and .lk scripts. Using the existing weather file script, is there a way to dynamically change some of the SAM parameters by integrating other values from a csv file? For example, I have a csv file with the same lat and long, the acers of the parcel at that location, and the total kW DC nameplate capacity if we assume the entire area of the parcel is used for a ground mounted solar system.
How can I read in a csv, extract data from a specific column in the csv and use that to update the system nameplate capacity for each iteration of the PVWatts model for each lat and long location?
Thank you,
Adam
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
22 Apr 2022 17:51 #10867
by pgilman
Replied by pgilman on topic Multiple Locations simulation
Hi Adam,
You can use the LK get() and set() functions to read and write values of SAM inputs (also use get() to read an output variable's value).
Click Variables at the top of the script editor window to see a list of input and output variable names.
Click Help to display the Help topic for the script editor, and then click Scripting reference at the top of the Help window to download a PDF reference for the LK language.
For example, the input variable for the nameplate capacity of the PVWatts model is 'system_nameplate', so you could use the following line of code to set its value to 100 kW:
set('system_capacity', 100)
You can use the csvread() function to read data from a CSV file. The csv-functions.lk sample script should help with learning how to do that: github.com/NREL/SAM/tree/patch/samples/LK%20Scripts%20for%20SAM
Best regards,
Paul.
You can use the LK get() and set() functions to read and write values of SAM inputs (also use get() to read an output variable's value).
Click Variables at the top of the script editor window to see a list of input and output variable names.
Click Help to display the Help topic for the script editor, and then click Scripting reference at the top of the Help window to download a PDF reference for the LK language.
For example, the input variable for the nameplate capacity of the PVWatts model is 'system_nameplate', so you could use the following line of code to set its value to 100 kW:
set('system_capacity', 100)
You can use the csvread() function to read data from a CSV file. The csv-functions.lk sample script should help with learning how to do that: github.com/NREL/SAM/tree/patch/samples/LK%20Scripts%20for%20SAM
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman