Simulink derivative block giving zero when implemented

I have a simulink model with a sine wave input which then gets differentiated. When I test just the sine wave and derivative block, it seems to work fine, but then when I add in the rest of the model after that, it gives an output of zero as shown. I can't work out why the blocks after is are affecting the derivative.
Thanks for any help you can offer.
<<
>>

2 Comments

Can you share the model(export to R2017a)?
Hi,
Ive attached 2 files, the model itself, and the parameters used in the model.
Thanks :)

Sign in to comment.

 Accepted Answer

Well, the problem with your model is that you use variable step solver, which adjusts the step size according to the characteristics of the model. But what I noticed is that, when the simulation starts, the simulation goes really slow. The solver minimizes step size so much that the derivative of your signal becomes too high. Therefore, it looks like that the derivative is zero but if you look at the order of the magnitude of the signal, it is really big. When you zoom in, you will see that the signal is not zero. Please check the attached figures.
Also, when I limited the min step size from Configuration Parameters(to 1e-4), the simulation gave an error. This means that your model is too sensitive to be solved numerically. You might need some modifications. Please see this for yourself.
Hope this helps.

1 Comment

Thanks for that. I'll look into adjusting the step size and modifying the model appropriately.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Simulink in Help Center and File Exchange

Asked:

on 14 Nov 2017

Commented:

on 14 Nov 2017

Community Treasure Hunt

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

Start Hunting!