lsim function not work for polynomial model
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
zhenzhen Jiang
am 3 Nov. 2021
Kommentiert: zhenzhen Jiang
am 4 Nov. 2021
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 Kommentare
Akzeptierte Antwort
Paul
am 3 Nov. 2021
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Time and Frequency Domain Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!