Fixed step discrete time is not really fixed in Simulink
조회 수: 7 (최근 30일)
이전 댓글 표시
Dear all,
I am experiencing some problems using a Simulink model with a fixed step discrete time solver (for example 0.01 seconds). The model simply consists of 2 blocks: one "From Workspace" block ("interpolate data" option not enabled), and one "To Workspace" block ("Save format" option set to "Structure with time"). If I run the simulation and I look to the time field of the data saved to workspace, I can see that the time step is not always fixed. It is sometimes lower or greater than 0.01 (sometimes 0.0099999999999, other times 0.010000000001). If I don't want to use the "interpolate data" option, this means that I get an output that it is different from input (i.e. I get some input samples repeated on output, and others that are skipped). The "funny" thing is that this behavior depends on the number of samples of the input variable.
Why am I getting this jitter on the time step? Shouldn't it be supposed to be fixed? Is there any option to force it to exactly what I set on the solver options tab?
Thank you for any help.
Kind regards,
Alberto
댓글 수: 0
채택된 답변
Ryan G
2012년 7월 16일
Essentially the way the time vector is created in Simulink for the discrete solver may be different from the way your input data has created input time and there is a small error between the two.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Event Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!