Why the response of my transfer function is very erratic when using a sine wave input data using a "From Workspace" block?

3 次查看(过去 30 天)
I have a transfer function that I simulate in Simulink.
When I use the Sine Wave block as an input to the transfer function, I receive a corresponding Sine Wave back.
But, when I use the To WorkSpace block to input an array of data that represents a similar sine wave, I receive a very erratic response.
Why?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2019-6-24
1) One possible reason you see the erratic result is because the data you feed in has high frequency content (could be due to the discrete nature of the data you have).
You can avoid the erratic response by adding a low pass filter before the transfer function block. The low pass filter will remove some of the high frequency content of your signal and gives a smoother response similar to the sine wave case.
2) Another reason you are seeing the issue is because the data you feed into the system has sample rate that is too low. To resolve this issue, you need to increase the sample time (for example dt = 0.00001) and set the solver to fixed-step ode1.
You may have high frequency dynamics in your model. To simulate the high frequency dynamics correctly, the data you feed in has to be sampled at high frequency as well. The reason being that Simulink simulates the system using both major time steps and minor time steps. The major time step is what you see/specify in the Configuration Parameters. The minor time steps are steps taken in between the major steps to more accurately calculate the final value at each major step. If your data's sampling frequency is not high enough, at minor step, Simulink will do a linear interpolation between the two data points. This linear interpolation causes the result to be less accurate, and the inaccuracy amplifies more as you take more derivatives. ode1 is a fixed step solver that does not use minor time step. Therefore, the solution is to increase the sampling time and use ode1.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

尚未输入任何标签。

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by