Skip to content

Commit 99cc2e9

Browse files
authored
Merge pull request #123 from murrayrm/doc-update
Small documentation updates
2 parents c71222a + 349025b commit 99cc2e9

File tree

10 files changed

+179
-154
lines changed

10 files changed

+179
-154
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ functionality is limited or absent, and installation of slycot is recommended
4141
(see below). Note that in order to install slycot, you will need a FORTRAN
4242
compiler on your machine. The Slycot wrapper can be found at:
4343

44-
https://github.com/jgoppert/Slycot
44+
https://github.com/python-control/Slycot
4545

4646
Installation
4747
============

control/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
from .ctrlutil import *
6666
from .frdata import *
6767
from .canonical import *
68+
from .robust import *
69+
from .config import *
6870

6971
# Exceptions
7072
from .exception import *

control/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@
1616

1717
# Set defaults to match MATLAB
1818
def use_matlab_defaults():
19+
"""
20+
Use MATLAB compatible configuration settings
21+
* Bode plots plot gain in dB, phase in degrees, frequency in Hertz
22+
"""
1923
# Bode plot defaults
2024
global bode_dB; bode_dB = True
2125
global bode_deg; bode_deg = True
2226
global bode_Hz; bode_Hz = True
2327

2428
# Set defaults to match FBS (Astrom and Murray)
2529
def use_fbs_defaults():
30+
"""
31+
Use `Astrom and Murray <http://fbsbook.org>`_ compatible settings
32+
* Bode plots plot gain in powers of ten, phase in degrees,
33+
frequency in Hertz
34+
"""
2635
# Bode plot defaults
2736
global bode_dB; bode_dB = False
2837
global bode_deg; bode_deg = True

control/dtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def sample_system(sysc, Ts, method='zoh', alpha=None):
6565
Ts : real
6666
Sampling period
6767
method : string
68-
Method to use for conversion: 'matched' (default), 'tustin', 'zoh'
68+
Method to use for conversion: 'matched', 'tustin', 'zoh' (default)
6969
7070
Returns
7171
-------

control/frdata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def _convertToFRD(sys, omega, inputs=1, outputs=1):
469469
sys.__class__)
470470

471471
def frd(*args):
472-
'''
472+
"""
473473
Construct a Frequency Response Data model, or convert a system
474474
475475
frd models store the (measured) frequency response of a system.
@@ -501,5 +501,5 @@ def frd(*args):
501501
See Also
502502
--------
503503
ss, tf
504-
'''
504+
"""
505505
return FRD(*args)

control/timeresp.py

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,12 @@
11
# timeresp.py - time-domain simulation routes
2-
"""
3-
Time domain simulation.
4-
5-
This file contains a collection of functions that calculate
6-
time responses for linear systems.
7-
8-
.. _time-series-convention:
9-
10-
Convention for Time Series
11-
--------------------------
12-
13-
This is a convention for function arguments and return values that
14-
represent time series: sequences of values that change over time. It
15-
is used throughout the library, for example in the functions
16-
:func:`forced_response`, :func:`step_response`, :func:`impulse_response`,
17-
and :func:`initial_response`.
18-
19-
.. note::
20-
This convention is different from the convention used in the library
21-
:mod:`scipy.signal`. In Scipy's convention the meaning of rows and columns
22-
is interchanged. Thus, all 2D values must be transposed when they are
23-
used with functions from :mod:`scipy.signal`.
24-
25-
Types:
26-
27-
* **Arguments** can be **arrays**, **matrices**, or **nested lists**.
28-
* **Return values** are **arrays** (not matrices).
29-
30-
The time vector is either 1D, or 2D with shape (1, n)::
31-
32-
T = [[t1, t2, t3, ..., tn ]]
33-
34-
Input, state, and output all follow the same convention. Columns are different
35-
points in time, rows are different components. When there is only one row, a
36-
1D object is accepted or returned, which adds convenience for SISO systems::
37-
38-
U = [[u1(t1), u1(t2), u1(t3), ..., u1(tn)]
39-
[u2(t1), u2(t2), u2(t3), ..., u2(tn)]
40-
...
41-
...
42-
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]
2+
"""Time domain simulation.
433
44-
Same for X, Y
4+
This file contains a collection of functions that calculate time
5+
responses for linear systems.
456
46-
So, U[:,2] is the system's input at the third point in time; and U[1] or U[1,:]
47-
is the sequence of values for the system's second input.
7+
See doc/conventions.rst#time-series-conventions_ for more information
8+
on how time series data are represented.
489
49-
The initial conditions are either 1D, or 2D with shape (j, 1)::
50-
51-
X0 = [[x1]
52-
[x2]
53-
...
54-
...
55-
[xj]]
56-
57-
As all simulation functions return *arrays*, plotting is convenient::
58-
59-
t, y = step(sys)
60-
plot(t, y)
61-
62-
The output of a MIMO system can be plotted like this::
63-
64-
t, y, x = lsim(sys, u, t)
65-
plot(t, y[0], label='y_0')
66-
plot(t, y[1], label='y_1')
67-
68-
The convention also works well with the state space form of linear systems. If
69-
``D`` is the feedthrough *matrix* of a linear system, and ``U`` is its input
70-
(*matrix* or *array*), then the feedthrough part of the system's response,
71-
can be computed like this::
72-
73-
ft = D * U
74-
75-
----------------------------------------------------------------
7610
"""
7711

7812
"""Copyright (c) 2011 by California Institute of Technology
@@ -453,6 +387,9 @@ def step_response(sys, T=None, X0=0., input=None, output=None,
453387
If True, transpose all input and output arrays (for backward
454388
compatibility with MATLAB and scipy.signal.lsim)
455389
390+
return_x: bool
391+
If True, return the state vector (default = False).
392+
456393
Returns
457394
-------
458395
T: array
@@ -529,6 +466,9 @@ def initial_response(sys, T=None, X0=0., input=0, output=None,
529466
If True, transpose all input and output arrays (for backward
530467
compatibility with MATLAB and scipy.signal.lsim)
531468
469+
return_x: bool
470+
If True, return the state vector (default = False).
471+
532472
Returns
533473
-------
534474
T: array
@@ -599,6 +539,9 @@ def impulse_response(sys, T=None, X0=0., input=0, output=None,
599539
If True, transpose all input and output arrays (for backward
600540
compatibility with MATLAB and scipy.signal.lsim)
601541
542+
return_x: bool
543+
If True, return the state vector (default = False).
544+
602545
Returns
603546
-------
604547
T: array

doc/control.rst

Lines changed: 18 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,31 @@ System creation
1717

1818
ss
1919
tf
20+
frd
2021
rss
2122
drss
2223

24+
System interconnections
25+
=======================
26+
.. autosummary::
27+
:toctree: generated/
28+
29+
append
30+
connect
31+
feedback
32+
negate
33+
parallel
34+
series
35+
2336
Frequency domain plotting
2437
=========================
2538

2639
.. autosummary::
2740
:toctree: generated/
2841

29-
bode
3042
bode_plot
31-
nyquist
3243
nyquist_plot
33-
gangof4
3444
gangof4_plot
35-
nichols
3645
nichols_plot
3746

3847
Time domain simulation
@@ -47,74 +56,6 @@ Time domain simulation
4756
step_response
4857
phase_plot
4958

50-
.. _time-series-convention:
51-
52-
Convention for Time Series
53-
--------------------------
54-
55-
This is a convention for function arguments and return values that
56-
represent time series: sequences of values that change over time. It
57-
is used throughout the library, for example in the functions
58-
:func:`forced_response`, :func:`step_response`, :func:`impulse_response`,
59-
and :func:`initial_response`.
60-
61-
.. note::
62-
This convention is different from the convention used in the library
63-
:mod:`scipy.signal`. In Scipy's convention the meaning of rows and columns
64-
is interchanged. Thus, all 2D values must be transposed when they are
65-
used with functions from :mod:`scipy.signal`.
66-
67-
Types:
68-
69-
* **Arguments** can be **arrays**, **matrices**, or **nested lists**.
70-
* **Return values** are **arrays** (not matrices).
71-
72-
The time vector is either 1D, or 2D with shape (1, n)::
73-
74-
T = [[t1, t2, t3, ..., tn ]]
75-
76-
Input, state, and output all follow the same convention. Columns are different
77-
points in time, rows are different components. When there is only one row, a
78-
1D object is accepted or returned, which adds convenience for SISO systems::
79-
80-
U = [[u1(t1), u1(t2), u1(t3), ..., u1(tn)]
81-
[u2(t1), u2(t2), u2(t3), ..., u2(tn)]
82-
...
83-
...
84-
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]
85-
86-
Same for X, Y
87-
88-
So, U[:,2] is the system's input at the third point in time; and U[1] or U[1,:]
89-
is the sequence of values for the system's second input.
90-
91-
The initial conditions are either 1D, or 2D with shape (j, 1)::
92-
93-
X0 = [[x1]
94-
[x2]
95-
...
96-
...
97-
[xj]]
98-
99-
As all simulation functions return *arrays*, plotting is convenient::
100-
101-
t, y = step(sys)
102-
plot(t, y)
103-
104-
The output of a MIMO system can be plotted like this::
105-
106-
t, y, x = lsim(sys, u, t)
107-
plot(t, y[0], label='y_0')
108-
plot(t, y[1], label='y_1')
109-
110-
The convention also works well with the state space form of linear systems. If
111-
``D`` is the feedthrough *matrix* of a linear system, and ``U`` is its input
112-
(*matrix* or *array*), then the feedthrough part of the system's response,
113-
can be computed like this::
114-
115-
ft = D * U
116-
117-
11859
Block diagram algebra
11960
=====================
12061
.. autosummary::
@@ -160,6 +101,8 @@ Control system synthesis
160101
:toctree: generated/
161102

162103
acker
104+
h2syn
105+
hinfsyn
163106
lqr
164107
place
165108

@@ -183,12 +126,15 @@ Utility functions and conversions
183126
unwrap
184127
db2mag
185128
mag2db
129+
damp
186130
isctime
187131
isdtime
132+
issiso
188133
issys
189134
pade
190135
sample_system
191136
canonical_form
137+
observable_form
192138
reachable_form
193139
ss2tf
194140
ssdata

0 commit comments

Comments
 (0)