Parallel Simulations

  • Sarah Ahmed
  • Topic Author
More
06 Mar 2023 17:18 #11979 by Sarah Ahmed
Parallel Simulations was created by Sarah Ahmed
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!

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

  • Paul Gilman
More
07 Mar 2023 01:11 #11982 by Paul Gilman
Replied by Paul Gilman 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.
 

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

  • Patrick Carroll
More
08 Feb 2024 19:50 #12880 by Patrick Carroll
Replied by Patrick Carroll 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

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

  • Paul Gilman
More
09 Feb 2024 22:20 - 09 Feb 2024 22:42 #12884 by Paul Gilman
Replied by Paul Gilman 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.
Last edit: 09 Feb 2024 22:42 by Paul Gilman.

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

  • Zachary Chieco
More
20 Feb 2024 19:56 #12924 by Zachary Chieco
Replied by Zachary Chieco 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

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

  • Paul Gilman
More
21 Feb 2024 02:59 #12925 by Paul Gilman
Replied by Paul Gilman 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.

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

Moderators: Paul Gilman
Powered by Kunena Forum