differentiating twice in simulink

17 visualizaciones (últimos 30 días)
Min Khant
Min Khant el 3 de Nov. de 2023
Comentada: Angelo Yeo el 8 de Nov. de 2023
I tried to use derivative block twice where the input is a sine wave and it does not give the output I expected. Why is that and how can I make an system that differentiate the input signal twice? I would like to create a feedforward controller that differentiate twice the input signal by using a differentiator block. Can I get some suggestions on how to do that ? In the second picture I attached, the input signal is supposed to be desired theta but since double derivative block does not work in simulink, I had to find double derivative of the input analytically first and then integrate twice to get the input again.
  1 comentario
Sam Chak
Sam Chak el 3 de Nov. de 2023
I seldom use the derivative block. If you already know the theta function (sine wave) beforehand, then you can definitely obtain the analytical 2nd-order derivative of the sine wave. Is this true?

Iniciar sesión para comentar.

Respuesta aceptada

Angelo Yeo
Angelo Yeo el 6 de Nov. de 2023
Editada: Angelo Yeo el 6 de Nov. de 2023
I need your model for further investigation because the issue is not reproducible in my end. However, I believe the fact that the initial output value for the Derivative block is always 0 should have something to do with your issue (see here)
If you closely look at the output of first derivative, the initial output is set to be 0. This is a designed behavior. This will lead to sharp slope of the first derivative at its initial point, which leads to a spike in the second derivative.
  6 comentarios
Min Khant
Min Khant el 8 de Nov. de 2023
thank you very much.
let me add only one more question .
here as you can see in my picture, the signal I got from two consecutive derivate block and the signal I found analytically is different in a way that the signal from derivative block has initial value of 0. How can I add some initial value to get the same result as the signal I analytically calculated?
Angelo Yeo
Angelo Yeo el 8 de Nov. de 2023
Well, you can use the IC block in order to set the initial condition no matter what the original initial condition is. However setting the initial condition does not guarantee the exact result as analytic solution. Be aware that Simulink runs based on numerical calculations.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Prepare Model Inputs and Outputs en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by