- Posts: 2
JSON file export for multi iteration
- Mahdi Alsaffar
- Topic Author
Less
More
24 Dec 2025 03:19 - 05 Jan 2026 10:51 #14428
by Mahdi Alsaffar
JSON file export for multi iteration was created by Mahdi Alsaffar
Dear SAM team
I am currently using PySAM to perform parametric analyses, mainly because it provides a much more convenient way to export both hourly (8760) outputs and scalar results to Excel compared to the SAM GUI.However, I am encountering an issue related to design-point consistency during multi-iteration runs.My current workflow is:
I am currently using PySAM to perform parametric analyses, mainly because it provides a much more convenient way to export both hourly (8760) outputs and scalar results to Excel compared to the SAM GUI.However, I am encountering an issue related to design-point consistency during multi-iteration runs.My current workflow is:
- Start from a single SAM-exported JSON file.
- Perform multiple runs by iteratively modifying solar multiple and thermal energy storage hours.
- Each iteration represents a separate case (e.g., a 10-case sweep results in 10 runs).
- thermal storage volume / thermal capacity,
- total aperture reflective area,
- number of loops ('nloops'),
do not appear to be recalculated and instead remain fixed at the base-case design.
- What is the recommended best practice in PySAM to ensure that all design-point and sizing parameters are fully recalculated when performing parametric sweeps of solar multiple and thermal storage?
- Is there a robust workflow to generate and save a full set of case-specific JSON files (similar to SAM GUI case exports), and then run all cases through PySAM while preserving SAM-consistent design behavior?
Last edit: 05 Jan 2026 10:51 by Paul Gilman.
Please Log in or Create an account to join the conversation.
- Taylor Brown
Less
More
- Posts: 2
06 Jan 2026 13:35 #14444
by Taylor Brown
Replied by Taylor Brown on topic JSON file export for multi iteration
Hi, I'm on the SAM team and am happy to help with this issue.
Can you attach your python script, SAM json file, and which version of SAM you are using?
Thank you!
Can you attach your python script, SAM json file, and which version of SAM you are using?
Thank you!
Please Log in or Create an account to join the conversation.
- Steve Mitchell
Less
More
- Posts: 1
03 Feb 2026 01:59 - 06 Feb 2026 11:35 #14475
by Steve Mitchell
Replied by Steve Mitchell on topic JSON file export for multi iteration
Hi Mahdi,
When using PySAM for parametric runs involving design-point changes like solar multiple and TES hours, it’s crucial to ensure the model fully recalculates the design sizing each iteration. Even if your auto-design flags are set, PySAM sometimes doesn’t trigger a full redesign just by updating inputs . To get consistent design behavior like the SAM GUI, you should explicitly call the sizing functions or re-run the design module before simulation in each iteration. Generating separate JSON files for each case beforehand is good practice, but make sure each JSON triggers a fresh design calculation on load.In essence, the key is to force PySAM to re-execute the design logic after updating inputs. Without this, dependent parameters like thermal storage volume or number of loops will stay fixed from the initial run. If your workflow currently just modifies inputs and runs simulate(), try adding a design step or re-initializing the model between iterations. This approach aligns with how the SAM GUI handles parametric sweeps internally.
Hope this helps clear things up!
When using PySAM for parametric runs involving design-point changes like solar multiple and TES hours, it’s crucial to ensure the model fully recalculates the design sizing each iteration. Even if your auto-design flags are set, PySAM sometimes doesn’t trigger a full redesign just by updating inputs . To get consistent design behavior like the SAM GUI, you should explicitly call the sizing functions or re-run the design module before simulation in each iteration. Generating separate JSON files for each case beforehand is good practice, but make sure each JSON triggers a fresh design calculation on load.In essence, the key is to force PySAM to re-execute the design logic after updating inputs. Without this, dependent parameters like thermal storage volume or number of loops will stay fixed from the initial run. If your workflow currently just modifies inputs and runs simulate(), try adding a design step or re-initializing the model between iterations. This approach aligns with how the SAM GUI handles parametric sweeps internally.
Hope this helps clear things up!
Last edit: 06 Feb 2026 11:35 by Paul Gilman.
Please Log in or Create an account to join the conversation.
Moderators: Paul Gilman




