Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions control/lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def isdtime(self, strict=False):

Parameters
----------
strict: bool (default = False)
If strict is True, make sure that timebase is not None
strict: bool, optional
If strict is True, make sure that timebase is not None. Default
is False.
"""

# If no timebase is given, answer depends on strict flag
Expand All @@ -73,8 +74,9 @@ def isctime(self, strict=False):
----------
sys : LTI system
System to be checked
strict: bool (default = False)
If strict is True, make sure that timebase is not None
strict: bool, optional
If strict is True, make sure that timebase is not None. Default
is False.
"""
# If no timebase is given, answer depends on strict flag
if self.dt is None:
Expand Down
9 changes: 6 additions & 3 deletions control/modelsimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ def modred(sys, ELIM, method='matchdc'):
Raises
------
ValueError
- if `method` is not either ``'matchdc'`` or ``'truncate'``
- if eigenvalues of `sys.A` are not all in left half plane
(`sys` must be stable)
Raised under the following conditions:

* if `method` is not either ``'matchdc'`` or ``'truncate'``

* if eigenvalues of `sys.A` are not all in left half plane
(`sys` must be stable)

Examples
--------
Expand Down
2 changes: 1 addition & 1 deletion control/phaseplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def phase_plot(odefun, X=None, Y=None, scale=1, X0=None, T=None,

See also
--------
box_grid(X, Y): construct box-shaped grid of initial conditions
box_grid : construct box-shaped grid of initial conditions

Examples
--------
Expand Down
80 changes: 42 additions & 38 deletions control/statesp.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ def horner(self, s):

# Method for generating the frequency response of the system
def freqresp(self, omega):
"""
Evaluate the system's transfer func. at a list of freqs, omega.
"""Evaluate the system's transfer func. at a list of freqs, omega.

mag, phase, omega = self.freqresp(omega)

Expand All @@ -424,22 +423,25 @@ def freqresp(self, omega):

G(exp(j*omega*dt)) = mag*exp(j*phase).

Inputs
------
omega: A list of frequencies in radians/sec at which the system
should be evaluated. The list can be either a python list
or a numpy array and will be sorted before evaluation.
Parameters
----------
omega : array
A list of frequencies in radians/sec at which the system should be
evaluated. The list can be either a python list or a numpy array
and will be sorted before evaluation.

Returns
-------
mag: The magnitude (absolute value, not dB or log10) of the system
mag : float
The magnitude (absolute value, not dB or log10) of the system
frequency response.

phase: The wrapped phase in radians of the system frequency
response.
phase : float
The wrapped phase in radians of the system frequency response.

omega: The list of sorted frequencies at which the response
was evaluated.
omega : array
The list of sorted frequencies at which the response was
evaluated.

"""

Expand Down Expand Up @@ -614,11 +616,11 @@ def lft(self, other, nu=-1, ny=-1):

Parameters
----------
other: LTI
other : LTI
The lower LTI system
ny: int, optional
ny : int, optional
Dimension of (plant) measurement output.
nu: int, optional
nu : int, optional
Dimension of (plant) control input.

"""
Expand Down Expand Up @@ -793,19 +795,21 @@ def sample(self, Ts, method='zoh', alpha=None):
method : {"gbt", "bilinear", "euler", "backward_diff", "zoh"}
Which method to use:

* gbt: generalized bilinear transformation
* bilinear: Tustin's approximation ("gbt" with alpha=0.5)
* euler: Euler (or forward differencing) method ("gbt" with alpha=0)
* backward_diff: Backwards differencing ("gbt" with alpha=1.0)
* zoh: zero-order hold (default)
* gbt: generalized bilinear transformation
* bilinear: Tustin's approximation ("gbt" with alpha=0.5)
* euler: Euler (or forward differencing) method ("gbt" with
alpha=0)
* backward_diff: Backwards differencing ("gbt" with alpha=1.0)
* zoh: zero-order hold (default)

alpha : float within [0, 1]
The generalized bilinear transformation weighting parameter, which
should only be specified with method="gbt", and is ignored otherwise
should only be specified with method="gbt", and is ignored
otherwise

Returns
-------
sysd : StateSpace system
sysd : StateSpace
Discrete time system, with sampling rate Ts

Notes
Expand Down Expand Up @@ -1079,18 +1083,18 @@ def _mimo2siso(sys, input, output, warn_conversion=False):

Parameters
----------
sys: StateSpace
sys : StateSpace
Linear (MIMO) system that should be converted.
input: int
input : int
Index of the input that will become the SISO system's only input.
output: int
output : int
Index of the output that will become the SISO system's only output.
warn_conversion: bool
If True: print a warning message when sys is a MIMO system.
Warn that a conversion will take place.
warn_conversion : bool, optional
If `True`, print a message when sys is a MIMO system,
warning that a conversion will take place. Default is False.

Returns
sys: StateSpace
sys : StateSpace
The converted (SISO) system.
"""
if not (isinstance(input, int) and isinstance(output, int)):
Expand Down Expand Up @@ -1341,16 +1345,16 @@ def rss(states=1, outputs=1, inputs=1):

Parameters
----------
states: integer
states : integer
Number of state variables
inputs: integer
inputs : integer
Number of system inputs
outputs: integer
outputs : integer
Number of system outputs

Returns
-------
sys: StateSpace
sys : StateSpace
The randomly created linear system

Raises
Expand Down Expand Up @@ -1379,16 +1383,16 @@ def drss(states=1, outputs=1, inputs=1):

Parameters
----------
states: integer
states : integer
Number of state variables
inputs: integer
inputs : integer
Number of system inputs
outputs: integer
outputs : integer
Number of system outputs

Returns
-------
sys: StateSpace
sys : StateSpace
The randomly created linear system

Raises
Expand Down Expand Up @@ -1417,7 +1421,7 @@ def ssdata(sys):

Parameters
----------
sys: LTI (StateSpace, or TransferFunction)
sys : LTI (StateSpace, or TransferFunction)
LTI system whose data will be returned

Returns
Expand Down
1 change: 1 addition & 0 deletions doc-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
numpy
scipy
matplotlib
sphinx_rtd_theme
numpydoc
10 changes: 5 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
# -- Project information -----------------------------------------------------

project = u'Python Control Systems Library'
copyright = u'2018, python-control.org'
copyright = u'2019, python-control.org'
author = u'Python Control Developers'

# Version information - read from the source code
import re
import control

# The short X.Y version
version = re.sub(r'(\d+\.\d+)\.(.*)', r'\1', control.__version__)
# The short X.Y.Z version
version = re.sub(r'(\d+\.\d+\.\d+)(.*)', r'\1', control.__version__)

# The full version, including alpha/beta/rc tags
release = control.__version__
Expand Down Expand Up @@ -109,7 +109,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -120,7 +120,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
2 changes: 1 addition & 1 deletion doc/control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ System creation

ss
tf
FRD
frd
rss
drss

Expand Down
2 changes: 1 addition & 1 deletion doc/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Some differences from MATLAB
The python-control package makes use of `NumPy <http://www.numpy.org>`_ and
`SciPy <https://www.scipy.org>`_. A list of general differences between
NumPy and MATLAB can be found `here
<http://www.scipy.org/NumPy_for_Matlab_Users>`_.
<https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html>`_.

In terms of the python-control package more specifically, here are
some thing to keep in mind:
Expand Down