@@ -1338,3 +1338,45 @@ def lsim(sys, U=0., T=None, X0=0., **keywords):
13381338 T , yout , xout = timeresp .forced_response (sys , T , U , X0 ,
13391339 transpose = True , ** keywords )
13401340 return yout , T , xout
1341+
1342+ # Return state space data as a tuple
1343+ def ssdata (sys ):
1344+ '''
1345+ Return state space data objects for a system
1346+
1347+ Parameters
1348+ ----------
1349+ sys: Lti (StateSpace, or TransferFunction)
1350+ LTI system whose data will be returned
1351+
1352+ Returns
1353+ -------
1354+ (A, B, C, D): list of matrices
1355+ State space data for the system
1356+ '''
1357+ ss = _convertToStateSpace (sys )
1358+ return (ss .A , ss .B , ss .C , ss .D )
1359+
1360+ # Return transfer function data as a tuple
1361+ def tfdata (sys , ** kw ):
1362+ '''
1363+ Return transfer function data objects for a system
1364+
1365+ Parameters
1366+ ----------
1367+ sys: Lti (StateSpace, or TransferFunction)
1368+ LTI system whose data will be returned
1369+
1370+ Keywords
1371+ --------
1372+ inputs = int; outputs = int
1373+ For MIMO transfer function, return num, den for given inputs, outputs
1374+
1375+ Returns
1376+ -------
1377+ (num, den): numerator and denominator arrays
1378+ Transfer function coefficients (SISO only)
1379+ '''
1380+ tf = _convertToTransferFunction (sys , ** kw )
1381+
1382+ return (tf .num , tf .den )
0 commit comments