How does lsim work?

44 ビュー (過去 30 日間)
shahzer rahman
shahzer rahman 2020 年 3 月 10 日
コメント済み: shahzer rahman 2020 年 3 月 10 日
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

採用された回答

Robert U
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
  1 件のコメント
shahzer rahman
shahzer rahman 2020 年 3 月 10 日
Thanks alot Robert. Appreciate the effort.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by