[SciPy-user] probable bug in signal.lsim with repeated poles
Tue Feb 26 17:22:27 CST 2008
This may already be fixed or may be windows specific. The computer
having the problem is running the latest exe files:
In : scipy.__version__
In : numpy.__version__
I just tried running the file on an Ubuntu box running 0.7.0 from svn
a few weeks ago, and lsim and lsim2 give the same results.
Is an update to the windows exe's scheduled for anytime soon?
On 2/26/08, Ryan Krauss <email@example.com> wrote:
> I think I have discovered a bug in lsim for systems with repeated
> roots in the charactersitic equation. The attached python file
> attempts to find the step response of a second order system that is
> critially damped:
> TF(s) = wn**2
> s**2 + 2*z*wn*s + wn**2
> where z = 1.
> The step response of this system based on inverse Laplace transform
> (see attached wxMaxima file) should be
> y(t) = -t*exp(-t)-exp(-t)+1
> when wn = 1.0
> signal.lsim2 comes up with the correct numeric answer (see good.png).
> Using signal.lsim, no error is thrown, but the answer is quite strange
> (see bad.png).
> I assume this has something to do with a repeated eigenvalue in the A matrix:
> In : sys.A
> array([[-2., -1.],
> [ 1., 0.]])
> In : eig(sys.A)
> (array([-1., -1.]),
> array([[-0.70710678, -0.70710678],
> [ 0.70710678, 0.70710678]]))
> It would be fine with me if lsim threw an error after checking for
> repeated eigenvalues. My code catches any errors thrown by lsim and
> tries to run lsim2 in an except clause. But giving a bad answer with
> no errors messed me up.
> Any thoughts?
More information about the SciPy-user