![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1824618/image.png)
Problems associated with derivative blocks in simulink
조회 수: 5 (최근 30일)
이전 댓글 표시
I encountered a problem with simulink derivative block when I was doing a simulation where third order derivatives of the input is required! However, I could not use three consecutive derivative blocks in simulink since I would get a huge number at t=0 resulted from numerical differentiation. This can be shown as follows
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152105/image.png)
Instead of getting a smooth -cos(x) single I get
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152107/image.png)
Is there a way to get rid of this problem?
댓글 수: 0
답변 (1개)
Rajanya
2025년 1월 30일 6:26
The flat line observed in the scope is mostly because of the Y-axis scale used. Because of the abrupt spike at t=0, which is natural because of numerical differentiation, the Y values reach in the order of 10^6, while the other values (at t>0) vary between 1 and -1, causing the line to appear flat on such a large scale margin.
Scaling the Y- axis properly makes the smooth -cos(x) curve visible (except the spike around t=0), as shown.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1824618/image.png)
For information on how to scale the axes, you can refer the following documentation - https://www.mathworks.com/help/dsp/ug/configure-time-scope.html#mw_83f3e357-7391-43ed-8601-48070614d75b:~:text=Style%20Properties.-,Axes%20Scaling%20Properties,-The%20Axes%20Scaling
Also, to reduce the initial spike, the maximum step size used for simulation can be reduced from Configuration Settings > Solver > Solver details (for variable-step solvers) > Max step size.
Thanks.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!