[SciPy-user] signal.lti

Stefan van der Walt stefan at sun.ac.za
Fri Sep 8 06:22:27 EDT 2006


Hi Ryan

On Thu, Sep 07, 2006 at 09:55:29PM -0500, Ryan Krauss wrote:
> I am having a rough time trying to use the lti portion of
> scipy.signal.  For starters, I just wanted to generate a step response
> for an integrator (1/s).  I tried creating this system two ways, and
> neither seems to work correctly.  I think this system has a numerator
> of 1 and a denominator of [1,0].

<snip>

> In [46]: A=array([[0,1],[0,0]])
> 
> In [47]: B=array([[0],[1]])
> 
> In [48]: C=array([[1,0]])
> 
> In [49]: D=array([[0]])
> 
> but for some reason I can't create a system with these matrices:
> 
> In [50]: mysys=scipy.signal.lti(A,B,C,D)

<snip>

> TypeError: array cannot be safely cast to required type

Are you running a 64-bit platform?  Maybe try

import numpy as N
import scipy.signal

A=N.array([[0,1],[0,0]],dtype=N.int32)
B=N.array([[0],[1]],dtype=N.int32)
C=N.array([[1,0]],dtype=N.int32)
D=N.array([[0]],dtype=N.int32)
mysys=scipy.signal.lti(A,B,C,D)

Regards
Stéfan



More information about the SciPy-User mailing list