How does lsim work?
120 次查看(过去 30 天)
显示 更早的评论
Hye.
I've been trying to figure out how the lsim function works in MATLAB. Does it do a time domain solution or a frequency domain solution? I am basically trying to solve a transfer function using lsim. The solution works out perfectly fine, but I have been trying to understand the theory behind how it works. I am very new to MATLAB, so kindly explain the basics if you've got time. THanks
0 个评论
采纳的回答
Robert U
2020-3-10
Hi shahzer rahman,
your question is answered within Matlab documentation: lsim(), linking to ltitr() (which unfortunately does not have a documentation entry in the current version, built-in function, see below) and filter().
open ltitr
%LTITR Linear time-invariant time response kernel.
%
% X = LTITR(A,B,U) calculates the time response of the
% system:
% x[n+1] = Ax[n] + Bu[n]
%
% to input sequence U. The matrix U must have as many columns as
% there are inputs u. Each row of U corresponds to a new time
% point. LTITR returns a matrix X with as many columns as the
% number of states x, and with as many rows as in U.
%
% LTITR(A,B,U,X0) can be used if initial conditions exist.
% Here is what it implements, in high speed:
%
% for i=1:n
% x(:,i) = x0;
% x0 = a * x0 + b * u(i,:).';
% end
% x = x.';
% Copyright 1984-2007 The MathWorks, Inc.
% built-in function
Same question here: Matlab forum
Your core question answered short: lsim solves your system response in time domain.
Kind regards,
Robert
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!