Difference between consecutive outputs of Simulink clock block is not the fixed simulation step

4 次查看(过去 30 天)
I have a Simulink model that's run by the following instruction:
SO = sim('schema','StartTime','current_tmin','StopTime', 'current_tmax','SaveState','on','SaveOutput','on', 'OutputSaveName','yout','SrcWorkspace', 'current', 'FixedStep','h_step');
where all the passed parameters have been defined before this instrutcion. Inside the Simulink model there is a block that takes the clock block as input. By printing this block's value when using h_step = 0.001, for example, I get an output that starts as follows:
clock =
0
clock =
5.0000e-04
clock =
7.5000e-04
clock =
1.0000e-03
clock =
0.0015
My question is: why are the time instants not separated by a quantity equal to h_step?
Thank you,
LT.
  1 个评论
Renato SL
Renato SL 2019-9-19
I think the documentation (here) presents a good explanation.
[tl;dr] : "If the model specifies one or more periodic sample times, Simulink chooses a step size equal to the greatest common divisor of the specified sample times. This step size, known as the fundamental sample time of the model, ensures that the solver will take a step at every sample time defined by the model."

请先登录,再进行评论。

回答(1 个)

Chaitanya Mallela
Chaitanya Mallela 2020-12-30

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by