Skip to content

Commit 2f90b03

Browse files
committed
Improve documentation for LTI system classes
1 parent a5bfafc commit 2f90b03

5 files changed

Lines changed: 27 additions & 37 deletions

File tree

control/frdata.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,14 @@
8181
from .lti import LTI
8282

8383
class FRD(LTI):
84-
"""The FRD class represents (measured?) frequency response
85-
TF instances and functions.
84+
"""A class for models defined by Frequency Response Data (FRD)
8685
87-
The FRD class is derived from the LTI parent class. It is used
88-
throughout the python-control library to represent systems in frequency
89-
response data form.
86+
The FRD class is used to represent systems in frequency response data form.
9087
91-
The main data members are 'omega' and 'fresp'. omega is a 1D
92-
array with the frequency points of the response. fresp is a 3D array,
93-
with the first dimension corresponding to the outputs of the FRD,
94-
the second dimension corresponding to the inputs, and the 3rd dimension
88+
The main data members are 'omega' and 'fresp', where `omega` is a 1D
89+
array with the frequency points of the response, and `fresp` is a 3D array,
90+
with the first dimension corresponding to the output index of the FRD,
91+
the second dimension corresponding to the input index, and the 3rd dimension
9592
corresponding to the frequency points in omega.
9693
For example,
9794
@@ -107,7 +104,7 @@ class FRD(LTI):
107104
epsw = 1e-8
108105

109106
def __init__(self, *args, **kwargs):
110-
"""Construct a transfer function.
107+
"""Construct an FRD object
111108
112109
The default constructor is FRD(d, w), where w is an iterable of
113110
frequency points, and d is the matching frequency data.
@@ -121,8 +118,6 @@ def __init__(self, *args, **kwargs):
121118
To construct frequency response data for an existing LTI
122119
object, other than an FRD, call FRD(sys, omega)
123120
124-
125-
126121
"""
127122
smooth = kwargs.get('smooth', False)
128123

control/matlab.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def tf(*args):
522522
523523
Returns
524524
-------
525-
out: TransferFunction
525+
out: :class:`TransferFunction`
526526
The new linear system
527527
528528
Raises
@@ -541,19 +541,11 @@ def tf(*args):
541541
Notes
542542
--------
543543
544-
.. todo::
545-
546-
The next paragraph contradicts the comment in the example!
547-
Also "input" should come before "output" in the sentence:
548-
549-
"from the (j+1)st output to the (i+1)st input"
550-
551544
``num[i][j]`` contains the polynomial coefficients of the numerator
552-
for the transfer function from the (j+1)st output to the (i+1)st input.
545+
for the transfer function from the (j+1)st input to the (i+1)st output.
553546
``den[i][j]`` works the same way.
554547
555-
The coefficients ``[2, 3, 4]`` denote the polynomial
556-
:math:`2 \cdot s^2 + 3 \cdot s + 4`.
548+
The list ``[2, 3, 4]`` denotes the polynomial :math:`2s^2 + 3s + 4`.
557549
558550
Examples
559551
--------

control/statesp.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,27 @@
9090
from .xferfcn import _convertToTransferFunction
9191

9292
class StateSpace(LTI):
93-
"""The StateSpace class represents state space instances and functions.
93+
"""A class for representing state-space models
9494
95-
The StateSpace class is used throughout the python-control library to
96-
represent systems in state space form. This class is derived from the LTI
97-
base class.
95+
The StateSpace class is used to represent state-space realizations of linear
96+
time-invariant (LTI) systems:
97+
98+
dx/dt = A x + B u
99+
y = C x + D u
100+
101+
where u is the input, y is the output, and x is the state.
98102
99103
The main data members are the A, B, C, and D matrices. The class also
100104
keeps track of the number of states (i.e., the size of A).
101105
102-
Discrete time state space system are implemented by using the 'dt' class
106+
Discrete-time state space system are implemented by using the 'dt' instance
103107
variable and setting it to the sampling period. If 'dt' is not None,
104108
then it must match whenever two state space systems are combined.
105109
Setting dt = 0 specifies a continuous system, while leaving dt = None
106110
means the system timebase is not specified. If 'dt' is set to True, the
107111
system will be treated as a discrete time system with unspecified
108112
sampling time.
113+
109114
"""
110115

111116
def __init__(self, *args):

control/xferfcn.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@
9595

9696
class TransferFunction(LTI):
9797

98-
"""The TransferFunction class represents TF instances and functions.
98+
"""A class for representing transfer functions
9999
100-
The TransferFunction class is derived from the LTI parent class. It
101-
is used throught the python-control library to represent systems in
102-
transfer function form.
100+
The TransferFunction class is used to represent systems in transfer function
101+
form.
103102
104103
The main data members are 'num' and 'den', which are 2-D lists of arrays
105104
containing MIMO numerator and denominator coefficients. For example,
@@ -109,11 +108,12 @@ class TransferFunction(LTI):
109108
means that the numerator of the transfer function from the 6th input to the
110109
3rd output is set to s^2 + 4s + 8.
111110
112-
Discrete time transfer functions are implemented by using the 'dt' class
111+
Discrete-time transfer functions are implemented by using the 'dt' instance
113112
variable and setting it to something other than 'None'. If 'dt' has a
114113
non-zero value, then it must match whenever two transfer functions are
115114
combined. If 'dt' is set to True, the system will be treated as a
116115
discrete time system with unspecified sampling time.
116+
117117
"""
118118

119119
def __init__(self, *args):

doc/classes.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ these directly.
1111
.. autosummary::
1212
:toctree: generated/
1313

14-
~lti.LTI
15-
FRD
16-
StateSpace
1714
TransferFunction
18-
15+
StateSpace
16+
FRD

0 commit comments

Comments
 (0)