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!