Skip to content

Commit bde823b

Browse files
committed
DOC: add more info on class constructors
1 parent b19ca11 commit bde823b

2 files changed

Lines changed: 100 additions & 7 deletions

File tree

doc/control.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ System creation
2424
System interconnections
2525
=======================
2626
.. autosummary::
27-
:toctree: generated/
27+
:toctree: generated/
2828

29-
append
30-
connect
31-
feedback
32-
negate
33-
parallel
34-
series
29+
append
30+
connect
31+
feedback
32+
negate
33+
parallel
34+
series
3535

3636
Frequency domain plotting
3737
=========================
@@ -118,6 +118,8 @@ Model simplification tools
118118
era
119119
markov
120120

121+
.. _utility-and-conversions:
122+
121123
Utility functions and conversions
122124
=================================
123125
.. autosummary::

doc/conventions.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,97 @@ Library conventions
99
The python-control library uses a set of standard conventions for the way
1010
that different types of standard information used by the library.
1111

12+
LTI system representation
13+
=========================
14+
15+
Linear time invariant (LTI) systems are represented in python-control in
16+
state space, transfer function, or frequency response data (FRD) form. Most
17+
functions in the toolbox will operate on any of these data types and
18+
functions for convering between between compatible types is provided.
19+
20+
State space systems
21+
-------------------
22+
The :class:`StateSpace` class is used to represent state-space realizations
23+
of linear time-invariant (LTI) systems:
24+
25+
.. math::
26+
27+
\frac{dx}{dt} &= A x + B u \\
28+
y &= C x + D u
29+
30+
where u is the input, y is the output, and x is the state.
31+
32+
To create a state space system, use the :class:`StateSpace` constructor:
33+
34+
sys = StateSpace(A, B, C, D)
35+
36+
State space systems can be manipulated using standard arithmetic operations
37+
as well as the :func:`feedback`, :func:`parallel`, and :func:`series`
38+
function. A full list of functions can be found in :ref:`function-ref`.
39+
40+
Transfer functions
41+
------------------
42+
The :class:`TransferFunction` class is used to represent input/output
43+
transfer functions
44+
45+
.. math::
46+
47+
G(s) = \frac{\text{num}(s)}{\text{den(s)}}
48+
= \frac{a_0 s^n + a_1 s^{n-1} + \cdots + a_n}
49+
{b_0 s^m + b_1 s^{m-1} + \cdots + b_m},
50+
51+
where n is generally greater than m (for a proper transfer function).
52+
53+
To create a transfer function, use the :class:`TransferFunction`
54+
constructor:
55+
56+
sys = TransferFunction(num, den)
57+
58+
Transfer functions can be manipulated using standard arithmetic operations
59+
as well as the :func:`feedback`, :func:`parallel`, and :func:`series`
60+
function. A full list of functions can be found in :ref:`function-ref`.
61+
62+
FRD (frequency response data) systems
63+
-------------------------------------
64+
The :class:`FRD` class is used to represent systems in frequency response
65+
data form.
66+
67+
The main data members are `omega` and `fresp`, where `omega` is a 1D array
68+
with the frequency points of the response, and `fresp` is a 3D array, with
69+
the first dimension corresponding to the output index of the FRD, the second
70+
dimension corresponding to the input index, and the 3rd dimension
71+
corresponding to the frequency points in omega.
72+
73+
FRD systems have a somewhat more limited set of functions that are
74+
available, although all of the standard algebraic manipulations can be
75+
performed.
76+
77+
Discrete time systems
78+
---------------------
79+
By default, all systems are considered to be continuous time systems. A
80+
discrete time system is created by specifying the 'time base' dt. The time
81+
base argument can be given when a system is constructed:
82+
83+
* dt = None: continuous time
84+
* dt = number: discrete time system with sampling period 'dt'
85+
* dt = True: discrete time with unspecified sampling period
86+
87+
Only the :class:`StateSpace` and :class:`TransferFunction` classes allow
88+
explicit representation of discrete time systems.
89+
90+
Systems must have the same time base in order to be combined. For
91+
continuous time systems, the :func:`sample_system` function or the
92+
:meth:`StateSpace.sample` and :meth:`TransferFunction.sample` methods can be
93+
used to create a discrete time system from a continuous time system. See
94+
:ref:`utility-and-conversions`.
95+
96+
Conversion between representations
97+
----------------------------------
98+
LTI systems can be converted between representations either by calling the
99+
constructor for the desired data type using the original system as the sole
100+
argument or using the explict conversion functions :func:`ss2tf` and
101+
:func:`tf2ss`.
102+
12103
.. _time-series-convention:
13104

14105
Time series data

0 commit comments

Comments
 (0)