How do I run models faster or slower than the main frame rate?
Question
How do I run models faster or slower than the main frame rate?
Answer
In this context, we use frame rate and fixed step (Simulink™ semantics) in the same sense.
Models included as part of a SimWB test are run by default - during the model sub-cycle- at the same rate as the main simulation. This means that the fixed step used for computations in the time domain - Integrator, etc. - is by default the same as the main simulation rate.
- Model Frequency Multiplier
- Remember that during the SimWB simulation loop the synchronous input I/O tasks are run before the model sub cycle and the synchronous I/O tasks are run after the model sub-cycle at the end of the simulation loop. If your model requires a step size that is too small to run the full SimWB simulation loop, we can use the concept of frequency multiplier when adding a model to a test.The multiplier defines how many time the model will be run by SimWB during a single model sub-cycle. By default, this number is 1.
- Using a frequency multiplier for a model is thus equivalent to reducing the fixed step size used by the model. So a model that needs a smaller step size than the main simulation loop can be run as part of a slower simulation loop. Obviously, running the model multiple times during a single SimWB model sub-cycle will increase the time required by the model to complete its computation. On the other hand, the results produced by the model may be totaly inaccurate when the fixed step is too large.
- Example
- In this example we created a test that runs 5 instances of the same model. Each model run with a different step size. The simulation loop for the test runs at a basic rate of 0.001 sec. This is a simple example of a bouncing ball dropped from a height of 10 m. The model includes a dampening factor on rebound.
|
|