8000 fixup! Move ss, tf2ss, etc into statesp module · XiangPiCha/python-control@5cf3e02 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cf3e02

Browse files
committed
fixup! Move ss, tf2ss, etc into statesp module
1 parent 33ca2db commit 5cf3e02

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

control/matlab/__init__.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,26 +1204,6 @@ def lsim(sys, U=0., T=None, X0=0.):
12041204
T, yout, xout = timeresp.forced_response(sys, T, U, X0, transpose = True)
12051205
return yout, T, xout
12061206

1207-
# Return state space data as a tuple
1208-
def ssdata(sys):
1209-
'''
1210-
Return state space data objects for a system
1211-
1212-
Parameters
1213-
----------
1214-
sys: LTI (StateSpace, or TransferFunction)
1215-
LTI system whose data will be returned
1216-
1217-
Returns
1218-
-------
1219-
(A, B, C, D): list of matrices
1220-
State space data for the system
1221-
'''
1222-
from ..statesp import _convertToStateSpace
1223-
ss = _convertToStateSpace(sys)
1224-
return (ss.A, ss.B, ss.C, ss.D)
1225-
1226-
# Return transfer function data as a tuple
12271207
def tfdata(sys):
12281208
'''
12291209
Return transfer function data objects for a system

control/statesp.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
from .xferfcn import _convertToTransferFunction
6464
from copy import deepcopy
6565

66-
__all__ = ['StateSpace', 'ss', 'rss', 'drss', 'tf2ss']
66+
__all__ = ['StateSpace', 'ss', 'rss', 'drss', 'tf2ss', 'ssdata']
6767

6868
class StateSpace(LTI):
6969
"""A class for representing state-space models
@@ -1133,3 +1133,20 @@ def drss(states=1, outputs=1, inputs=1):
11331133
"""
11341134

11351135
return _rss_generate(states, inputs, outputs, 'd')
1136+
1137+
def ssdata(sys):
1138+
'''
1139+
Return state space data objects for a system
1140+
1141+
Parameters
1142+
----------
1143+
sys: LTI (StateSpace, or TransferFunction)
1144+
LTI system whose data will be returned
1145+
1146+
Returns
1147+
-------
1148+
(A, B, C, D): list of matrices
1149+
State space data for the system
1150+
'''
1151+
ss = _convertToStateSpace(sys)
1152+
return (ss.A, ss.B, ss.C, ss.D)

0 commit comments

Comments
 (0)
0