lsim function not work for polynomial model
조회 수: 17 (최근 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!