Testing Simulation Digital Twins
Test simulation digital twins by deploying them on the workbench and then running local, standalone simulations with specified start times, end times, and intervals.
See also
For more information on using simulation for your models, please refer to Using Digital Twins for Simulation
Workflows
There are two ways to test digital twin simulations with the workbench. Developers can step through each simulation time slice or run the simulation until either the end time is reached, a digital twin instance stops the simulation, or there is no more remaining work.
Step-by-Step
- Deploy a simulation digital twin.
Using your language of choice, add the definition of the real-time digital twin, the message type(s), the message processor, and simulation processor implementations to the workbench using a unique model name.
- Add digital twin instances to the work bench.
Instantiate digital twin instances and add them to the workbench.
- Initialize the simulation.
Specify the start time, end time, and interval between simulation cycles.
- Step into a simulation time slice.
Using the workbench’s “Step” function, complete the next simulation cycle. During this simulation cycle, every digital twin that is slotted to run at that simulation cycle will be passed to the model’s simulation processor.
- Introspect on the state of the simulation and real-time digital twins.
Once the simulation cycle is completed, review the state of the simulation and the stored simulation and real-time digital twins.
- Repeat steps 4 and 5.
Continue the simulation, repeating steps 4 and 5 until the simulation completes.
Run Simulation
- Deploy a simulation digital twin.
Using your language of choice, add the definition of the real-time digital twin, the message type(s), the message processor, and simulation processor implementations to the workbench using a unique model name.
- Add digital twin instances to the work bench.
Instantiate digital twin instances and add them to the workbench.
- Run the simulation.
Specify the start time, end time, interval between simulation cycles, and optionally speedup to run the simulation faster than real-time.
- Introspect on the state of the simulation and real-time digital twins.
Once the simulation is completed, verify the state of the simulation ended as expected.
Review the state of the simulation and the stored simulation and real-time digital twins.