simulation pacing
simulation pacing enables you to slow down a simulation to understand and observe the system's behavior. visualizing simulations at a slower rate makes it easier to understand underlying system design, identify design issues and demonstrate near real-time behavior. you can view the results and inspect your system while the simulation is in progress. slow down animations in scopes, to observe how and when the system changes state.
simulation pacing is useful in scenarios where one simulation-second is completed in a few wall clock time milliseconds. you can also manually interact with the model while it is running at a slower rate, which can help you to explore how your changes affect the simulation behavior. note that the simulation will run at an approximation of the specified pace.
to start, specify the rate of simulation. this rate is a ratio of elapsed simulation time to elapsed wall clock time.
use simulation pacing
this example shows how to use simulation pacing during a simulation.
open the
vdp
model.vdp
in the simulation tab, select run > simulation pacing
in the simulation pacing options dialog, select enable pacing to slow down simulation. on enabling, the specified pace gets automatically applied to the simulation.
select the pace at which the model should run by using the slider or entering the pace in the simulation time per wall clock second field. this field also accepts values outside of the range on the slider. the value entered in the field can only be a finite positive number.
on simulating the model, you can watch the simulation progress at the specified pace in the scope. you can also change the pace through the dialog box and enable/disable pacing while your simulation is running.
to enable pacing from the command line, use set_param(model,
'enablepacing', 'on')
command. to enter the value use
set_param(model, 'pacingrate', value)
where the value is a
finite positive number.
the run
button changes to , when a simulation is run with pacing enabled.
the status bar indicates if a simulation is running with pacing enabled. it also
indicates if the simulation can not run at the specified pace.
use simulation pacing with dashboard blocks
you can use dashboard blocks to view signals and tune variables and parameters in your model while slowing a simulation using simulation pacing. using dashboard blocks with simulation pacing allows you to build an intuitive understanding of your model and how it responds to changes as you tune parameters in your model.
the example model uses simulation pacing to slow the simulation pace to approximately equivalent to wall clock time, or one simulation second per one wall clock second. you can push the signal select button to select whether the sine wave or sawtooth input signal passes to the output, which is visualized using a dashboard scope block.
open the model and run a simulation. during the simulation, press and release the signal select button and observe the effect on the output signal.
for more information about creating the example model, see .
limitations
simulation pacing is not compatible with:
simulation stepper
profiler
see also
(aerospace blockset)