From: <kk...@us...> - 2011-02-08 22:13:34
|
Revision: 45 http://python-control.svn.sourceforge.net/python-control/?rev=45&view=rev Author: kkchen Date: 2011-02-08 22:13:26 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Minor changes to statesp.py related to scipy.signal.lti overhaul. Kevin K. Chen <kk...@pr...> Modified Paths: -------------- branches/control-0.4a/src/statesp.py Modified: branches/control-0.4a/src/statesp.py =================================================================== --- branches/control-0.4a/src/statesp.py 2011-02-08 22:13:22 UTC (rev 44) +++ branches/control-0.4a/src/statesp.py 2011-02-08 22:13:26 UTC (rev 45) @@ -281,16 +281,17 @@ # def convertToStateSpace(sys, inputs=1, outputs=1): """Convert a system to state space form (if needed)""" - if (isinstance(sys, StateSpace) or - isinstance(sys, xferfcn.TransferFunction)): + if isinstance(sys, StateSpace): # Already a state space system; just return it return sys - + elif isinstance(sys, xferfcn.TransferFunction): + pass # TODO: convert SS to TF elif (isinstance(sys, (int, long, float, complex))): # Generate a simple state space system of the desired dimension # The following Doesn't work due to inconsistencies in ltisys: # return StateSpace([[]], [[]], [[]], sp.eye(outputs, inputs)) - return StateSpace(-1, 0, 0, sp.eye(outputs, inputs)) + return StateSpace(-1, zeros((1, inputs)), zeros((outputs, 1)), + sp.eye(outputs, inputs)) else: raise TypeError("can't convert given type to StateSpace system") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |