How to decide time step of a Simulink model contains different sub-models with different time step
5 次查看(过去 30 天)
显示 更早的评论
If i have different sub-models with different time steps, the global simulation time of the overall model should be defined by the largest or the smallest time step of the used sub-blocks ? why ?
0 个评论
回答(1 个)
Sriram Narayanan
2015-5-4
I understand that you would like to decide the time step of a Simulink model that references multiple models running at different rates.
It is not clear when you mentioned "global simulation time". Please note that if multiple models are referenced by the same base model, each of these models must run at the same rate as the base model or an integer multiple of the base sample rate.
You can take a look at an example model obtained by entering the following command in MATLAB and observe how three referenced models inherit different sample times from the 3 pulse generator blocks. (0.1, 0.5 and 1 sec) The 3 sample rates of the 3 sub-models are integer multiple of the base sample time 0.1 seconds which is defined in configuration parameters.
>> sldemo_mdlref_basic
Please note that the referenced models should be at the same or integer multiple value because Simulink solver computes the output of each block in a simulink model at the end of each major time step (defined by the sample time). The base model should have access to the output computed by the referenced model before the base model computes its output, therefore, the referenced model should run at the same rate as the base model or an integer multiple.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!