How does lsim work?
43 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
shahzer rahman
am 10 Mär. 2020
Kommentiert: shahzer rahman
am 10 Mär. 2020
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 Kommentare
Akzeptierte Antwort
Robert U
am 10 Mär. 2020
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Digital Filter 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!