Difference using lsim and simulink model transfer function block with equal transfer functions
7 次查看(过去 30 天)
显示 更早的评论
Hi all, I am working on a model of an air fan. The input is a PWM signal between 0% and 100%, the output is fan speed in rpm. I have estimated transfer functions from measured data for two step responses: from 0%-15% and from 15%-20%. For the estimation I used data that starts at zero. So for 15%-20%, the input data range is actually from 0%-5%. For the simulation with lsim I use this data and tf and add the fan speed that it started with. This leads to very accurate results between measured values and simulated using lsim.
However I want to implement these transfer functions in a Simulink model. I use the same strategy as with lsim, but the results do not agree. 0-15 is the same but 15-20 is not. I use an S-function to alter the nominator and denominator of the transfer function block.
I understand it is difficult to answer this question without files, but the main question is: How can I get the same results as with lsim using a transfer function in Simulink?
Thanks in advance.
Best, Gijs
0 个评论
回答(3 个)
Alexis Nguyen
2012-2-15
Hi Gijs,
Have you solved your problem? Could you please let me know the answer. I'm also trying to solve this.
Thanks
0 个评论
Matheus WV
2020-9-14
I had a similar issue. In my case the problem was on the estimation. As data is discrete, MATLAB has to assume the values of the input variables between samples. As the property 'InterSample' was not specified, a First-order hold was assumed. Simulink, on the other side, uses a zero-order hold.
Changing the data from
id_data = iddata(i_is,V_is,Ts);
to
id_data = iddata(i_is,V_is,Ts,'InterSample','zoh');
solved the problem.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!