Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Small documentation updates#123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
slivingston merged 10 commits intopython-control:masterfrommurrayrm:doc-update
Dec 31, 2016
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
10 commits
Select commitHold shift + click to select a range
dbf0a9d
DOC: updated Slycot URL to github.com/python-control
murrayrmDec 27, 2016
4cbd4cb
DOC: default method for sample_system was incorrect
murrayrmDec 27, 2016
06b5fe4
DOC: created conventions section in manual + moved doc for time serie…
murrayrmDec 27, 2016
c253d33
DOC: added documentation for return_x
murrayrmDec 27, 2016
2111117
DOC: removed redundant entries for frequency domain plots
murrayrmDec 27, 2016
1f15678
add robust module to list of included files
murrayrmDec 27, 2016
92570bc
TRV: use double quotes for multi-line comment
murrayrmDec 27, 2016
303480f
DOC: add missing functions to documentation list
murrayrmDec 27, 2016
93b50b1
Add documentation for custom configurations
murrayrmDec 27, 2016
349025b
DOC: updated installation instructions (including conda as an option)
murrayrmDec 29, 2016
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
2 changes: 1 addition & 1 deletionREADME.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,7 +41,7 @@ functionality is limited or absent, and installation of slycot is recommended
(see below). Note that in order to install slycot, you will need a FORTRAN
compiler on your machine. The Slycot wrapper can be found at:

https://github.com/jgoppert/Slycot
https://github.com/python-control/Slycot

Installation
============
Expand Down
2 changes: 2 additions & 0 deletionscontrol/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,6 +65,8 @@
from .ctrlutil import *
from .frdata import *
from .canonical import *
from .robust import *
from .config import *

# Exceptions
from .exception import *
Expand Down
9 changes: 9 additions & 0 deletionscontrol/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,13 +16,22 @@

# Set defaults to match MATLAB
def use_matlab_defaults():
"""
Use MATLAB compatible configuration settings
* Bode plots plot gain in dB, phase in degrees, frequency in Hertz
"""
# Bode plot defaults
global bode_dB; bode_dB = True
global bode_deg; bode_deg = True
global bode_Hz; bode_Hz = True

# Set defaults to match FBS (Astrom and Murray)
def use_fbs_defaults():
"""
Use `Astrom and Murray <http://fbsbook.org>`_ compatible settings
* Bode plots plot gain in powers of ten, phase in degrees,
frequency in Hertz
"""
# Bode plot defaults
global bode_dB; bode_dB = False
global bode_deg; bode_deg = True
Expand Down
2 changes: 1 addition & 1 deletioncontrol/dtime.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,7 +65,7 @@ def sample_system(sysc, Ts, method='zoh', alpha=None):
Ts : real
Sampling period
method : string
Method to use for conversion: 'matched' (default), 'tustin', 'zoh'
Method to use for conversion: 'matched', 'tustin', 'zoh' (default)

Returns
-------
Expand Down
4 changes: 2 additions & 2 deletionscontrol/frdata.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -469,7 +469,7 @@ def _convertToFRD(sys, omega, inputs=1, outputs=1):
sys.__class__)

def frd(*args):
'''
"""
Construct a Frequency Response Data model, or convert a system

frd models store the (measured) frequency response of a system.
Expand DownExpand Up@@ -501,5 +501,5 @@ def frd(*args):
See Also
--------
ss, tf
'''
"""
return FRD(*args)
85 changes: 14 additions & 71 deletionscontrol/timeresp.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,12 @@
# timeresp.py - time-domain simulation routes
"""
Time domain simulation.

This file contains a collection of functions that calculate
time responses for linear systems.

.. _time-series-convention:

Convention for Time Series
--------------------------

This is a convention for function arguments and return values that
represent time series: sequences of values that change over time. It
is used throughout the library, for example in the functions
:func:`forced_response`, :func:`step_response`, :func:`impulse_response`,
and :func:`initial_response`.

.. note::
This convention is different from the convention used in the library
:mod:`scipy.signal`. In Scipy's convention the meaning of rows and columns
is interchanged. Thus, all 2D values must be transposed when they are
used with functions from :mod:`scipy.signal`.

Types:

* **Arguments** can be **arrays**, **matrices**, or **nested lists**.
* **Return values** are **arrays** (not matrices).

The time vector is either 1D, or 2D with shape (1, n)::

T = [[t1, t2, t3, ..., tn ]]

Input, state, and output all follow the same convention. Columns are different
points in time, rows are different components. When there is only one row, a
1D object is accepted or returned, which adds convenience for SISO systems::

U = [[u1(t1), u1(t2), u1(t3), ..., u1(tn)]
[u2(t1), u2(t2), u2(t3), ..., u2(tn)]
...
...
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]
"""Time domain simulation.

Same for X, Y
This file contains a collection of functions that calculate time
responses for linear systems.

So, U[:,2] is the system's input at the third point intime; and U[1] or U[1,:]
is the sequence of values for the system's second input.
See doc/conventions.rst#time-series-conventions_ for more information
on how time series data are represented.

The initial conditions are either 1D, or 2D with shape (j, 1)::

X0 = [[x1]
[x2]
...
...
[xj]]

As all simulation functions return *arrays*, plotting is convenient::

t, y = step(sys)
plot(t, y)

The output of a MIMO system can be plotted like this::

t, y, x = lsim(sys, u, t)
plot(t, y[0], label='y_0')
plot(t, y[1], label='y_1')

The convention also works well with the state space form of linear systems. If
``D`` is the feedthrough *matrix* of a linear system, and ``U`` is its input
(*matrix* or *array*), then the feedthrough part of the system's response,
can be computed like this::

ft = D * U

----------------------------------------------------------------
"""

"""Copyright (c) 2011 by California Institute of Technology
Expand DownExpand Up@@ -453,6 +387,9 @@ def step_response(sys, T=None, X0=0., input=None, output=None,
If True, transpose all input and output arrays (for backward
compatibility with MATLAB and scipy.signal.lsim)

return_x: bool
If True, return the state vector (default = False).

Returns
-------
T: array
Expand DownExpand Up@@ -529,6 +466,9 @@ def initial_response(sys, T=None, X0=0., input=0, output=None,
If True, transpose all input and output arrays (for backward
compatibility with MATLAB and scipy.signal.lsim)

return_x: bool
If True, return the state vector (default = False).

Returns
-------
T: array
Expand DownExpand Up@@ -599,6 +539,9 @@ def impulse_response(sys, T=None, X0=0., input=0, output=None,
If True, transpose all input and output arrays (for backward
compatibility with MATLAB and scipy.signal.lsim)

return_x: bool
If True, return the state vector (default = False).

Returns
-------
T: array
Expand Down
90 changes: 18 additions & 72 deletionsdoc/control.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,22 +17,31 @@ System creation

ss
tf
frd
rss
drss

System interconnections
=======================
.. autosummary::
:toctree: generated/

append
connect
feedback
negate
parallel
series

Frequency domain plotting
=========================

.. autosummary::
:toctree: generated/

bode
bode_plot
nyquist
nyquist_plot
gangof4
gangof4_plot
nichols
nichols_plot

Time domain simulation
Expand All@@ -47,74 +56,6 @@ Time domain simulation
step_response
phase_plot

.. _time-series-convention:

Convention for Time Series
--------------------------

This is a convention for function arguments and return values that
represent time series: sequences of values that change over time. It
is used throughout the library, for example in the functions
:func:`forced_response`, :func:`step_response`, :func:`impulse_response`,
and :func:`initial_response`.

.. note::
This convention is different from the convention used in the library
:mod:`scipy.signal`. In Scipy's convention the meaning of rows and columns
is interchanged. Thus, all 2D values must be transposed when they are
used with functions from :mod:`scipy.signal`.

Types:

* **Arguments** can be **arrays**, **matrices**, or **nested lists**.
* **Return values** are **arrays** (not matrices).

The time vector is either 1D, or 2D with shape (1, n)::

T = [[t1, t2, t3, ..., tn ]]

Input, state, and output all follow the same convention. Columns are different
points in time, rows are different components. When there is only one row, a
1D object is accepted or returned, which adds convenience for SISO systems::

U = [[u1(t1), u1(t2), u1(t3), ..., u1(tn)]
[u2(t1), u2(t2), u2(t3), ..., u2(tn)]
...
...
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]

Same for X, Y

So, U[:,2] is the system's input at the third point in time; and U[1] or U[1,:]
is the sequence of values for the system's second input.

The initial conditions are either 1D, or 2D with shape (j, 1)::

X0 = [[x1]
[x2]
...
...
[xj]]

As all simulation functions return *arrays*, plotting is convenient::

t, y = step(sys)
plot(t, y)

The output of a MIMO system can be plotted like this::

t, y, x = lsim(sys, u, t)
plot(t, y[0], label='y_0')
plot(t, y[1], label='y_1')

The convention also works well with the state space form of linear systems. If
``D`` is the feedthrough *matrix* of a linear system, and ``U`` is its input
(*matrix* or *array*), then the feedthrough part of the system's response,
can be computed like this::

ft = D * U


Block diagram algebra
=====================
.. autosummary::
Expand DownExpand Up@@ -160,6 +101,8 @@ Control system synthesis
:toctree: generated/

acker
h2syn
hinfsyn
lqr
place

Expand All@@ -183,12 +126,15 @@ Utility functions and conversions
unwrap
db2mag
mag2db
damp
isctime
isdtime
issiso
issys
pade
sample_system
canonical_form
observable_form
reachable_form
ss2tf
ssdata
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp