lsim function not work for polynomial model
16 次查看(过去 30 天)
显示 更早的评论
a= lsim(sys_MIMO(1, 1),X_filt(:,1),t_new) %based on transfer function model works
b= lsim(sys_MIMO1(1, 1),X_filt(:,1),t_new) %based on polynomial model error popup
%Error using DynamicSystem/lsim (line 84)
%For models with unspecified sample time, time is counted in samples and the time increment must be 1 (one %sample).
0 个评论
采纳的回答
Paul
2021-11-3
I'm not sure what a "polynomial model" is. But that error message means that lsim is being called on a discrete time system that has an unspcifiied sample time, but the time vector input to lsim is not [0 1 2 3 4 5 ....] (actually, the first point doesn't have to be 0 I don't believe).
For example define a discrete time system with sample time = 0.1 and simuate it for 1 second
sys = tf(1,[1 .5],0.1);
t = 0:.1:1;
y = lsim(sys,sin(t),t); % works
Now define a discrete time system with undefined sample time an simulate it for 11 samples
sys = tf(1,[1 .5],-1)
n = 0:10;
y = lsim(sys,sin(n),n); % works
But an error results with
y = lsim(sys,sin(t),t)
So sys_MIMO1 either needs to have a sample time defined, or you'll have to lsim() it with a sequence of integers as the time input.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time and Frequency Domain Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!