Combining different cases into one for ease of use

  • Joseph Baylay
  • Topic Author
More
02 Oct 2023 15:10 #12523 by Joseph Baylay
Hello,
I'm working on a project for a solar system that requires me to make multiple cases in SAM as there are multiple modules that have different specifications (tilt, azimuth etc.). I currently have the total system modelled with 16 cases and it is a bit tedious going through each case and simulating and recording the results of each one. Is there a way I can combine the cases so that the process is much quicker i.e., I only have to simulate the system once (be that in the SAM software or using PySAM and the SDK)?

Many thanks.

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

  • Paul Gilman
More
02 Oct 2023 23:47 #12526 by Paul Gilman
Replied by Paul Gilman on topic Combining different cases into one for ease of use
Hi Joseph,

The Shift-F11 shortcut key runs a simulation for all cases in the file, which at least saves some time switching between cases. For a complete list of keyboard shortcuts, see the "Keyboard Shortcuts" topic in Help: samrepo.nrelcloud.org/help/index.html.

You could write an LK script in SAM to run the simulations and record the results. For more on LK script, see sam.nrel.gov/lk-script.html.

If you are familiar with Python, you could use the PySAM package to model your project. That would still require breaking up your system into separate cases because of the limitation on the number of subarrays (up to four). PySAM takes some time to learn and effort to set up, so I would only recommend that option if you have experience coding in Python. For more on PySAM: nrel-pysam.readthedocs.io/.

Best regards,
Paul.

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

  • Joseph Baylay
  • Topic Author
More
06 Oct 2023 08:59 #12533 by Joseph Baylay
Replied by Joseph Baylay on topic Combining different cases into one for ease of use
Hi Paul, 

Thank you for the response, I'm looking into both now. My end goal is to be able to recreate the simulation in Python by reading a weather data file and then producing the results, as opposed to having to run a SAM simulation first (almost like writing the simulation from scratch). Would this be possible using the LK Script editor or the PySAM package?

Many thanks,
Joe.

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

  • Paul Gilman
More
10 Oct 2023 18:14 #12538 by Paul Gilman
Replied by Paul Gilman on topic Combining different cases into one for ease of use
Hi Joe,

Yes. You can use SAM's code generator to export SAM inputs to a JSON file, and use your Python code to read data from that file to populate inputs for the appropriate PySAM modules. That process is described in the PySAM documentation here: nrel-pysam.readthedocs.io/en/main/inputs-from-sam.html

Best regards,
Paul.

 

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

Moderators: Paul Gilman
Powered by Kunena Forum