99Routines in this module:
1010
1111StateSpace.__init__
12+ StateSpace._remove_useless_states
13+ StateSpace.copy
1214StateSpace.__str__
1315StateSpace.__neg__
1416StateSpace.__add__
2628StateSpace.feedback
2729StateSpace.returnScipySignalLti
2830convertToStateSpace
29- rss_generate
31+ _rss_generate
3032
31- Copyright (c) 2010 by California Institute of Technology
33+ """
34+
35+ """Copyright (c) 2010 by California Institute of Technology
3236All rights reserved.
3337
3438Redistribution and use in source and binary forms, with or without
7478from numpy .linalg import inv , det , solve
7579from numpy .linalg .linalg import LinAlgError
7680from scipy .signal import lti
81+ from copy import deepcopy
7782from slycot import td04ad
7883from lti import Lti
7984import xferfcn
@@ -162,6 +167,11 @@ def _remove_useless_states(self):
162167 self .B = delete (self .B , useless , 0 )
163168 self .C = delete (self .C , useless , 1 )
164169
170+ def copy (self ):
171+ """Return a deep copy of the instance."""
172+
173+ return deepcopy (self )
174+
165175 def __str__ (self ):
166176 """String representation of the state space."""
167177
@@ -207,9 +217,9 @@ def __add__(self, other):
207217
208218 return StateSpace (A , B , C , D )
209219
210- # Reverse addition - just switch the arguments
220+ # Right addition - just switch the arguments
211221 def __radd__ (self , other ):
212- """Reverse add two LTI systems (parallel connection)."""
222+ """Right add two LTI systems (parallel connection)."""
213223
214224 return self + other
215225
@@ -220,7 +230,7 @@ def __sub__(self, other):
220230 return self + (- other )
221231
222232 def __rsub__ (self , other ):
223- """Reverse subtract two LTI systems."""
233+ """Right subtract two LTI systems."""
224234
225235 return other + (- self )
226236
@@ -253,10 +263,10 @@ def __mul__(self, other):
253263
254264 return StateSpace (A , B , C , D )
255265
256- # Reverse multiplication of two transfer functions (series interconnection)
266+ # Right multiplication of two transfer functions (series interconnection)
257267 # Just need to convert LH argument to a state space object
258268 def __rmul__ (self , other ):
259- """Reverse multiply two LTI objects (serial connection)."""
269+ """Right multiply two LTI objects (serial connection)."""
260270
261271 # Check for a couple of special cases
262272 if isinstance (other , (int , long , float , complex )):
@@ -276,7 +286,7 @@ def __div__(self, other):
276286 raise NotImplementedError ("StateSpace.__div__ is not implemented yet." )
277287
278288 def __rdiv__ (self , other ):
279- """Reverse divide two LTI systems."""
289+ """Right divide two LTI systems."""
280290
281291 raise NotImplementedError ("StateSpace.__rdiv__ is not implemented yet." )
282292
@@ -465,7 +475,7 @@ def convertToStateSpace(sys, **kw):
465475 else :
466476 raise TypeError ("Can't convert given type to StateSpace system." )
467477
468- def rss_generate (states , inputs , outputs , type ):
478+ def _rss_generate (states , inputs , outputs , type ):
469479 """Generate a random state space.
470480
471481 This does the actual random state space generation expected from rss and
0 commit comments