Skip to content

Commit 01ff7ac

Browse files
committed
Move documentation into doc/
The tables of functions/classes were previously defined in control/__init__.py. This commit moves those to doc/control.rst. This is consistent with what is done in scikit-learn, for example, and seems cleaner to me, as most of the .rst is kept in the doc/ directory, rather than the docstrings in __init__.py. It also shortens a too-lengthy docstring for the main `control` module.
1 parent 56939a5 commit 01ff7ac

3 files changed

Lines changed: 196 additions & 205 deletions

File tree

control/__init__.py

Lines changed: 1 addition & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -40,199 +40,8 @@
4040
# $Id$
4141

4242
"""
43-
==============================
44-
Python Control Systems Library
45-
==============================
46-
47-
The Python Control Systems Library (`control`) provides common functions
43+
The Python Control Systems Library :mod:`control` provides common functions
4844
for analyzing and designing feedback control systems.
49-
50-
System creation
51-
===============
52-
.. autosummary::
53-
:toctree: generated/
54-
55-
ss
56-
tf
57-
58-
Frequency domain plotting
59-
=========================
60-
61-
.. autosummary::
62-
:toctree: generated/
63-
64-
bode
65-
bode_plot
66-
nyquist
67-
nyquist_plot
68-
gangof4
69-
gangof4_plot
70-
nichols
71-
nichols_plot
72-
73-
Time domain simulation
74-
======================
75-
76-
.. autosummary::
77-
:toctree: generated/
78-
79-
forced_response
80-
impulse_response
81-
initial_response
82-
step_response
83-
phase_plot
84-
85-
.. _time-series-convention:
86-
87-
Convention for Time Series
88-
--------------------------
89-
90-
This is a convention for function arguments and return values that
91-
represent time series: sequences of values that change over time. It
92-
is used throughout the library, for example in the functions
93-
:func:`forced_response`, :func:`step_response`, :func:`impulse_response`,
94-
and :func:`initial_response`.
95-
96-
.. note::
97-
This convention is different from the convention used in the library
98-
:mod:`scipy.signal`. In Scipy's convention the meaning of rows and columns
99-
is interchanged. Thus, all 2D values must be transposed when they are
100-
used with functions from :mod:`scipy.signal`.
101-
102-
Types:
103-
104-
* **Arguments** can be **arrays**, **matrices**, or **nested lists**.
105-
* **Return values** are **arrays** (not matrices).
106-
107-
The time vector is either 1D, or 2D with shape (1, n)::
108-
109-
T = [[t1, t2, t3, ..., tn ]]
110-
111-
Input, state, and output all follow the same convention. Columns are different
112-
points in time, rows are different components. When there is only one row, a
113-
1D object is accepted or returned, which adds convenience for SISO systems::
114-
115-
U = [[u1(t1), u1(t2), u1(t3), ..., u1(tn)]
116-
[u2(t1), u2(t2), u2(t3), ..., u2(tn)]
117-
...
118-
...
119-
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]
120-
121-
Same for X, Y
122-
123-
So, U[:,2] is the system's input at the third point in time; and U[1] or U[1,:]
124-
is the sequence of values for the system's second input.
125-
126-
The initial conditions are either 1D, or 2D with shape (j, 1)::
127-
128-
X0 = [[x1]
129-
[x2]
130-
...
131-
...
132-
[xj]]
133-
134-
As all simulation functions return *arrays*, plotting is convenient::
135-
136-
t, y = step(sys)
137-
plot(t, y)
138-
139-
The output of a MIMO system can be plotted like this::
140-
141-
t, y, x = lsim(sys, u, t)
142-
plot(t, y[0], label='y_0')
143-
plot(t, y[1], label='y_1')
144-
145-
The convention also works well with the state space form of linear systems. If
146-
``D`` is the feedthrough *matrix* of a linear system, and ``U`` is its input
147-
(*matrix* or *array*), then the feedthrough part of the system's response,
148-
can be computed like this::
149-
150-
ft = D * U
151-
152-
153-
Block diagram algebra
154-
=====================
155-
.. autosummary::
156-
:toctree: generated/
157-
158-
series
159-
parallel
160-
feedback
161-
negate
162-
163-
Control system analysis
164-
=======================
165-
.. autosummary::
166-
:toctree: generated/
167-
168-
dcgain
169-
evalfr
170-
freqresp
171-
margin
172-
stability_margins
173-
phase_crossover_frequencies
174-
pole
175-
zero
176-
pzmap
177-
root_locus
178-
179-
Matrix computations
180-
===================
181-
.. autosummary::
182-
:toctree: generated/
183-
184-
care
185-
dare
186-
lyap
187-
dlyap
188-
ctrb
189-
obsv
190-
gram
191-
192-
Control system synthesis
193-
========================
194-
.. autosummary::
195-
:toctree: generated/
196-
197-
acker
198-
lqr
199-
place
200-
201-
Model simplification tools
202-
==========================
203-
.. autosummary::
204-
:toctree: generated/
205-
206-
minreal
207-
balred
208-
hsvd
209-
modred
210-
era
211-
markov
212-
213-
Utility functions and conversions
214-
=================================
215-
.. autosummary::
216-
:toctree: generated/
217-
218-
unwrap
219-
db2mag
220-
mag2db
221-
drss
222-
isctime
223-
isdtime
224-
issys
225-
pade
226-
sample_system
227-
canonical_form
228-
reachable_form
229-
ss2tf
230-
ssdata
231-
tf2ss
232-
tfdata
233-
timebase
234-
timebaseEqual
235-
23645
"""
23746

23847
# Import functions from within the control system library

control/matlab.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
===========================
4-
MATLAB compatibility module
5-
===========================
6-
7-
This module contains a number of functions that emulate some of the
8-
functionality of MATLAB. The intent of these functions is to
3+
The :mod:`control.matlab` module contains a number of functions that emulate
4+
some of the functionality of MATLAB. The intent of these functions is to
95
provide a simple interface to the python control systems library
10-
(python-control) for people who are familiar with the MATLAB Control
11-
Systems Toolbox (tm). Most of the functions are just calls to
12-
python-control functions defined elsewhere. To include all of the functions
13-
described here, use::
14-
15-
from control.matlab import *
16-
6+
(python-control) for people who are familiar with the MATLAB Control Systems
7+
Toolbox (tm).
178
"""
189

1910
"""Copyright (c) 2009 by California Institute of Technology

0 commit comments

Comments
 (0)