- Posts: 3
Combining different cases into one for ease of use
- j.baylay
- Topic Author
Less
More
02 Oct 2023 09:10 #12523
by j.baylay
Combining different cases into one for ease of use was created by j.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.
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.
- pgilman
Less
More
- Posts: 5423
02 Oct 2023 17:47 #12526
by pgilman
Replied by pgilman 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.
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.
- j.baylay
- Topic Author
Less
More
- Posts: 3
06 Oct 2023 02:59 #12533
by j.baylay
Replied by j.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.
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.
- pgilman
Less
More
- Posts: 5423
10 Oct 2023 12:14 #12538
by pgilman
Replied by pgilman 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.
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: pgilman