Simulink Unit Delay - Unexpected Behavior
조회 수: 7 (최근 30일)
이전 댓글 표시
While I am well experienced in Mathcad, SPICE, SIMPLIS, I am fairly new to Matlab and Simulink. I created a small Simulink model to explore the behavior of the unit delay and zero order hold (ZOH) blocks. While the ZOH works as I would expect, the unit delay does not.
The souce is a pulse block with a period of 1 us, 50% duty cycle, and an amplitude of 1. I apply this to the input of a unit delay block with a sampling period of 400 ns.
I expect the output of the unit delay to be 0 for 40 ns, change to 1 at 800 ns, 0 at 1.2 us, change to 0 at 1.6 us...
What I get is 0 from 0 to 400 ns, 1 from 200 ns to 1.2 us, 0 from 1.2 us to 1.6 us, 1 from 1.6 us to 2 us....
I have searched here, searched the product help, and even looked in a couple of Matlab/Simulink books lloking for the why Simulink gives this answer.
Any suggestions or guidance would be appreciated.
Thanks in advance.
댓글 수: 0
답변 (1개)
Fangjun Jiang
2011년 7월 17일
A few things to note.
1. The Pulse Generator block outputs 1 for the first 500ns, then 0 for the second 500ns. It's not 0 first and then 1.
2. Sounds like you want to run your simulation at every 400ns, but the fact that your pulse generator is at period of 1000ns and 50% duty cycle. You have to run it at time step=100ns to hit 400ns, 500ns, 800ns ... Use fixed step discrete solver.
Could you try this? It should not be any problem or data discrepancy.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!