- Posts: 9
Understanding simulation time variables in PySAM PTC model
- Aryan
- Topic Author
Less
More
05 Dec 2025 02:41 #14404
by Aryan
Understanding simulation time variables in PySAM PTC model was created by Aryan
Hello Paul,
I want to understand these variables with an example. Please don't give liner to each question.
I want to understand these variables with an example. Please don't give liner to each question.
Attachments:
Please Log in or Create an account to join the conversation.
- Paul Gilman
Less
More
- Posts: 5688
08 Dec 2025 11:46 #14407
by Paul Gilman
Replied by Paul Gilman on topic Understanding simulation time variables in PySAM PTC model
Hi Aryan,
Attached is an example of how to use these variables to run a simulation for the physical trough model (TroughPhysical) for a single time step.
The example is based on the implementation in the Hybrid Optimization and Performance Platform (HOPP) model.
Here is an outline of the overall steps to run a simulation for a single time step (in this case for Hour 1 and Hour 2):
1. Run a simulation for Hour 1.
2. Save values of variables for the plant state.
3. Set variables for the plant state in Hour 2.
4. Run simulation for Hour 2.
Here are links to sections of the HOPP code that get and set the plant state:
Function that gets plant state: github.com/NREL/HOPP/blob/0b3aee3737198575e905c45f6ef56756173d2d0d/hopp/simulation/technologies/csp/trough_plant.py#L114
Function that sets plant state: github.com/NREL/HOPP/blob/0b3aee3737198575e905c45f6ef56756173d2d0d/hopp/simulation/technologies/csp/csp_plant.py#L430
The attached 'physical-trough-time-step.py' script shows the most basic steps.
The function of the variables you asked about:
sim_type: 1 = run a time series simulation, 2 = run only design-point calculations. SAM's user interface uses sim_type = 2 to calculate values design values.
time_start, time_stop: Start and stop time in seconds for partial time series simulation. The plant state must be initialized for this to work.
time_steps_per_hour: Number of time steps per hour. Set to 1 for hourly simulations.
vacuum_arrays: For time series simulations over less than one year, set vacuum_arrays to resize arrays from 8760 hours to simulation length.
Best regards,
Paul.
Attached is an example of how to use these variables to run a simulation for the physical trough model (TroughPhysical) for a single time step.
The example is based on the implementation in the Hybrid Optimization and Performance Platform (HOPP) model.
Here is an outline of the overall steps to run a simulation for a single time step (in this case for Hour 1 and Hour 2):
1. Run a simulation for Hour 1.
2. Save values of variables for the plant state.
3. Set variables for the plant state in Hour 2.
4. Run simulation for Hour 2.
Here are links to sections of the HOPP code that get and set the plant state:
Function that gets plant state: github.com/NREL/HOPP/blob/0b3aee3737198575e905c45f6ef56756173d2d0d/hopp/simulation/technologies/csp/trough_plant.py#L114
Function that sets plant state: github.com/NREL/HOPP/blob/0b3aee3737198575e905c45f6ef56756173d2d0d/hopp/simulation/technologies/csp/csp_plant.py#L430
The attached 'physical-trough-time-step.py' script shows the most basic steps.
The function of the variables you asked about:
sim_type: 1 = run a time series simulation, 2 = run only design-point calculations. SAM's user interface uses sim_type = 2 to calculate values design values.
time_start, time_stop: Start and stop time in seconds for partial time series simulation. The plant state must be initialized for this to work.
time_steps_per_hour: Number of time steps per hour. Set to 1 for hourly simulations.
vacuum_arrays: For time series simulations over less than one year, set vacuum_arrays to resize arrays from 8760 hours to simulation length.
Best regards,
Paul.
Attachments:
Please Log in or Create an account to join the conversation.
Moderators: Paul Gilman




