- Posts: 2
Parallel Simulations
- sarahahmed
- Topic Author
Less
More
06 Mar 2023 10:18 #11979
by sarahahmed
Parallel Simulations was created by sarahahmed
Hi,
I tried following the "solar-resource-simulate-multiple-files.lk" script example to get annual energy results for multiple weather files by running parallel simulations. However, after the simulations were completed there was no output and I couldn't access the results. I was wondering if there is a way to write the code so that it outputs a csv of all the annual energy results for each weather file (as well as the lat/long of of the file or at least the file name). My coding experience is very limited so I would appreciate any help with this!
I tried following the "solar-resource-simulate-multiple-files.lk" script example to get annual energy results for multiple weather files by running parallel simulations. However, after the simulations were completed there was no output and I couldn't access the results. I was wondering if there is a way to write the code so that it outputs a csv of all the annual energy results for each weather file (as well as the lat/long of of the file or at least the file name). My coding experience is very limited so I would appreciate any help with this!
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
06 Mar 2023 18:11 #11982
by pgilman
Replied by pgilman on topic Parallel Simulations
Hi Sarah,
The script should display the file name total annual output in kWh for each weather file in the folder you select in the script editor window.
The variable names for latitude and longitude are 'lat' and 'lon', respectively.
You can use the csvwrite() function to write data to a text file with comma-separated values.
The LK scripting reference is available from the top of the Help window, and you can click Functions at the top of the script editing window to see a list of LK functions, and Variables to see a list of available variables.
Best regards,
Paul.
The script should display the file name total annual output in kWh for each weather file in the folder you select in the script editor window.
The variable names for latitude and longitude are 'lat' and 'lon', respectively.
You can use the csvwrite() function to write data to a text file with comma-separated values.
The LK scripting reference is available from the top of the Help window, and you can click Functions at the top of the script editing window to see a list of LK functions, and Variables to see a list of available variables.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- pcarroll
Less
More
- Posts: 1
08 Feb 2024 12:50 #12880
by pcarroll
Replied by pcarroll on topic Parallel Simulations
Hi Paul,
Our team has been running the solar-resource-simulate-multiple-files.lk script on versions SAM 2022.11.21 r3 and earlier without issue. However, when running the same script on the latest update (SAM 2023.12.17) SAM crashes, and we have not been able to figure out what causes it. We're running a SAM simulation using multiple year weather data downloaded directly from the SAM 'Download Weather Files'. At first, I thought it was crashing at line 45, but after video recording the program crashing, I noticed that it seems to make it to line #65 before it crashes.
I attempted to go through the list of changes to figure it out, but at the end of the day, I'm not a software programmer and haven't been able to figure out the issue.
Would you be able to help out? It'd be very much appreciated and if you need anything feel free to reach out.
Thanks,
Patrick
Our team has been running the solar-resource-simulate-multiple-files.lk script on versions SAM 2022.11.21 r3 and earlier without issue. However, when running the same script on the latest update (SAM 2023.12.17) SAM crashes, and we have not been able to figure out what causes it. We're running a SAM simulation using multiple year weather data downloaded directly from the SAM 'Download Weather Files'. At first, I thought it was crashing at line 45, but after video recording the program crashing, I noticed that it seems to make it to line #65 before it crashes.
I attempted to go through the list of changes to figure it out, but at the end of the day, I'm not a software programmer and haven't been able to figure out the issue.
Would you be able to help out? It'd be very much appreciated and if you need anything feel free to reach out.
Thanks,
Patrick
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
09 Feb 2024 15:20 - 09 Feb 2024 15:42 #12884
by pgilman
Replied by pgilman on topic Parallel Simulations
Hi Patrick,
This is a bug that affects the LK function 'parsim()'. We will fix this in a future upate to SAM 2023.12.17.
In the meantime, you can avoid the issue by using Option 1 in the solar-resource-simulate-multiple-files.lk script. The script demonstrates two options: Option 1 runs a simulation for each weather file using the 'simulate()' function, and Option 2 runs a simulation for each weather file using the 'parsim()' function. (When you run the script as it is, it loops through the weather files twice, once using 'simulate()' and once using 'parsim()'.)
In theory, the 'parsim()' function should be faster than the 'simulate()' function, but we've found that isn't always the case. I would recommend using Option 1.
You can modify the script by deleting or commenting out Option 2 from Line 49 through Line 102 or by deleting those lines. To comment a block of code in LK, use '/*' and '*/'.
Thank you for bringing this to our attention.
Best regards,
Paul.
This is a bug that affects the LK function 'parsim()'. We will fix this in a future upate to SAM 2023.12.17.
In the meantime, you can avoid the issue by using Option 1 in the solar-resource-simulate-multiple-files.lk script. The script demonstrates two options: Option 1 runs a simulation for each weather file using the 'simulate()' function, and Option 2 runs a simulation for each weather file using the 'parsim()' function. (When you run the script as it is, it loops through the weather files twice, once using 'simulate()' and once using 'parsim()'.)
In theory, the 'parsim()' function should be faster than the 'simulate()' function, but we've found that isn't always the case. I would recommend using Option 1.
You can modify the script by deleting or commenting out Option 2 from Line 49 through Line 102 or by deleting those lines. To comment a block of code in LK, use '/*' and '*/'.
Thank you for bringing this to our attention.
Best regards,
Paul.
Last edit: 09 Feb 2024 15:42 by pgilman.
Please Log in or Create an account to join the conversation.
- zchieco
Less
More
- Posts: 2
20 Feb 2024 12:56 #12924
by zchieco
Replied by zchieco on topic Parallel Simulations
Hi Paul,
I'm curious if you have an approximate timeline for this fix. We do have some additional code related to parallel simulations that uses the parsim function.
Thanks,
Zach
I'm curious if you have an approximate timeline for this fix. We do have some additional code related to parallel simulations that uses the parsim function.
Thanks,
Zach
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
20 Feb 2024 19:59 #12925
by pgilman
Replied by pgilman on topic Parallel Simulations
Hi Zach,
This probably won't make it in the first update to SAM 2023.12.17, but hopefully will be in the second update, so not for a few more weeks.
Best regards,
Paul.
This probably won't make it in the first update to SAM 2023.12.17, but hopefully will be in the second update, so not for a few more weeks.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman