-
Notifications
You must be signed in to change notification settings - Fork 13
Simulation Clock Advancement Modes
Anya Petersen edited this page Jun 15, 2023
·
10 revisions
When interacting with simulation, there are two clocks to consider: real-world and simulated. All modeled output values available via Alfalfa reflect the state of the simulation at the current simulation time, which advances with a fixed timestep of one minute. For many applications, the relationship between real and simulated time is crucial. An example is hardware-in-the-loop experimentation: hardware is bound to real-world time and therefor the simulated aspects of the experiment must also remain synced to real time.
On starting a run, Alfalfa has 3 settings available that impact the rate at which the simulation clock advances: timescale, externalClock, and realtime. These modes are described below.
- In this scenario, the model will only advance when explicitly told to advance by an external call. It has no regard for real time passing but sits in an idle state until told to advance. The simulation starts at the specified start time.
- Upon call to advance, Alfalfa will look for any points written from external sources, write these into the simulation, and advance the simulation one time step (1-minute in model time).
- It then waits to advance until the next call is made.
- It will stop if the model has advanced enough times such that the end datetime has passed or if it is specifically told to stop.
- In this scenario, the timescale parameter is used to control the rate at which the internal clock advances through the simulation. It represents the integer ratio of model_time:real_time. For example, a value of 5 means that the simulation will advance at 5x the rate of real time. In other words, one minute of simulation time will occur every 12 seconds of real time.
- Regardless of the start time specified for the run, the simulation will begin running.
- Upon reaching the time to advance, Alfalfa will look for any points from external sources, write these into the simulation, and advance the simulation one time step (1-minute in model time).
- It then waits X time in real time before advancing through the next time step.
- It will proceed until it has reached the specified end datetime or if it is specifically told to stop.
- If the simulation falls more than 2 timesteps behind it will throw an error and kill the simulation.
- This scenario is similar to the timescale with the following caveats.
- The timescale parameter is always one (i.e. the model advances one minute in model time for every one minute that passes in real time).
- If the specified model start time has already passed in real time, the start time will be overwritten to the current time and the simulation will begin. However, if the specified model start time has not already passed in real time, the simulation will not begin until that time in real time is reached.
- It will then proceed until it has reached the specified end datetime or if it is specifically told to stop.
- All external calls to advance the simulation are ignored.
- Getting Started with Model Measures Part 1: Creating Inputs and Outputs
- Getting Started with Model Measures Part 2: Creating Actuators
- Getting Started with EnergyPlus Measures Part 1: Creating Inputs and Outputs
- Getting Started with EnergyPlus Measures Part 2: Creating Actuators
- How to Configure an OpenStudio Model
- How to Configure Measures for Use with Alfalfa Ruby Gem
- How to Create Inputs and Outputs With Measures
- How to Run URBANopt Output Models in Alfalfa
- How to Migrate EnergyPlus Python Plugins
- How to Integrate Python based Electric Vehicle Models with OpenStudio Workflows
- How to Locally Test OpenStudio Models
- Required Structure of OpenStudio Workflow
- List of Automatically Generated Energyplus Points
- Alfalfa EnergyPlus Mixin Methods
- Getting Started with Uploading and Running a Model Using Python
- Getting Started with Uploading and Running a Model Using the UI
- How to Install Alfalfa Client
- How to Preprocess and Upload a Model
- How to Step Through a Simulation
- How to View Historical Data in Grafana
- How to Configure an Alias
- How to Troubleshoot Models