help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsim vs. filter for simulation in Octave 2.1.50


From: E. Joshua Rigler
Subject: Re: lsim vs. filter for simulation in Octave 2.1.50
Date: Fri, 17 Oct 2003 10:05:00 -0600

I'm responding to my original post.  I looked more closely at the code
for lsim, and I'm still a little confused.  When a system is passed to
the lsim function, it is transformed into state-space form (i.e.

   x(t+1) = Ax(t) + Bu(t)
     y(t) = Cx(t) + Du(t)

...) then, assuming a discrete system, the appropriate matrices are used
for the simulation according to (paraphrased):

  x = x0;
  for ii=1:n
    x = A*x + B*u(ii);
  endfor
  y = C*x + D*u;

So, in other words, the feed-through (represented by D*u) is never
actually incorporated into the state.  Is this as it is supposed to be? 
If so, how does one get output analogous to the filter function from
lsim?  (The reason I want to do this, since it's probably much faster to
use Octave's filter function, is I want to have the ability to easily
implement MIMO linear predictors that may not be "strictly proper".  If
you know a better way, please let me know.)

-EJR


On Thu, 2003-10-16 at 11:30, E. Joshua Rigler wrote:
> Please, don't hesitate to tell me *why* this is a dumb question...
> 
> If I have numerator and denominator filter coefficients:
> 
>  A = [1.0  .33]
>  B = [0.2  .10]
>  lag = [0 1] ;; not necessary for anything
> 
> 
> ...or if I have a system derived from a state-space description with:
> 
> 
>  A = -.33
>  B = .10
>  C = 1
>  D = 0.2
>  sys = ss2sys (A,B,C,D,1,0,1)
> 
> 
> ...shouldn't I get the same output from:
> 
> 
>  1) filter (B,A,[1;zeros(9,1)])
> ...and...
>  2) lsim (sys,[1;zeros(9,1)],[1:10])
> 
> 
> It seems that the feedthrough term in the system structure (D*u) is not
> incorporated into the updated state properly by lsim, but maybe my
> concept of what is "proper" is flawed.
> 
> -EJR
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
-- 

To announce that there must be no criticism of the president, 
or that we are to stand by the president, right or wrong, 
is not only unpatriotic and servile, but is morally treasonable 
to the American public. -- Theodore Roosevelt, 1918.



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]