help-octave
[Top][All Lists]
Advanced

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

Re: impulse() giving error


From: Lukas Reichlin
Subject: Re: impulse() giving error
Date: Sat, 3 Apr 2010 05:46:57 +0200

Hi

The problem is that your transfer function is proper, but not strictly proper. 
You can do a polynomial division as below:

H(s) = (2s + 1) / (4s + 3) * 1
where 1 denotes the Laplace transform of the Dirac function d(t).

H(s) = 0.5 + (-0.5) / (4s + 3) = 0.5 - 0.125 / (s + 0.75)
Now it's obvious that this response has a non-zero feedthrough: 0.5
The inverse Laplace transformation is a piece of cake:

h(t) = 0.5*d(t) - 0.125*exp(-0.75*t)

Matlab's impulse response lacks the first term, i.e. it doesn't show the Dirac. 
Check 
H = tf (1)
impulse (H)
if you don't believe that Matlab is wrong :-) To make it short, the reason is 
that Matlab doesn't build the inverse Laplace transform but calculates the 
response in discrete-time state-space.

hope this helps
Lukas

PS: I wrote a new control package which copies the behaviour of Matlab. Have a 
look at
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control.tar.gz?view=tar
if you're interested. You can install the package in the usual way.

Warning: Because of a bug in Octave 3.2.x, system sys changes sampling time 
after the first call of a time response function (lsim, step, impulse, 
initial). This bug is fixed in current development sources (>= 3.3.51) for 
Octave 3.4.

> Hi,
> 
> I have a question on impulse(). When I do this in Matlab, I get a good 
> response. In Octave-3.2.3 (Mac) I get this:
> 
> octave-3.2.3:1> H=tf([2 1],[4 3]);
> octave-3.2.3:2> impulse(H)
> warning: meaning may have changed due to change in precedence for && and 
> || operators
> error: impulse: D matrix is nonzero, impulse response infinite.
> error: called from:
> error:   /Users/huub/octave/control-1.0.10/__stepimp__.m at line 203, 
> column 7
> error:   /Users/huub/octave/control-1.0.10/impulse.m at line 69, column 9
> octave-3.2.3:2>
> 
> Is this an Matlab-incompatibility or a bug?
> 
> Thanks
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave




reply via email to

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