Difference between revisions of "Control Systems Library for Python"

From Murray Wiki
Jump to navigationJump to search
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{righttoc}}
{{warning|The information on this page is out of date.  The most up-to-date information about python-control is available in the documentation that is distributed with the package.
This page collects some notes on a control systems library for Python.  The plan is to create an alternative to the MATLAB Control System Toolbox™ that can be used in courses and for research.  This page collects information about the toolbox, in preparation for actually writing some code.  If you stumble across this page and know of a similar package or would like to contribute, let me know.


Status updates:
'''[http://sourceforge.net/p/python-control/wiki/Home/ python-control home on SourceForge]'''
* 23 May 09: really basic functionality working (Bode and Nyquist plots of transfer functions)
* 24 May 09: looking around for open source control computations - [http://www.slicot.org/ slicot] looks like a candidate


== Architecture notes ==
}}


I'm trying to sort out the best object structure to use for control system objects.  There is already an LTI class in the signal processing module of SciPY, so I might be able to build on that (and hence get those systems for free).  Ideally, I'd like to allow for time delay in the linear systems representation, since these come up a lot in my group's research.
<table width="100%">
<tr><td align=center>
<font color='blue' size='+2'>Python Control Systems Library (python-control)</font></td></tr>
</table> __NOTOC__


Here's some rough thoughts on a possible object structure:
<br>
* '''InputOutputSystem''' - dynamical system with inputs and outputs. Could be linear or nonlinear, discrete or continuous time (?), include infinite dimensional systems (time-delays, perhaps some classes of PDEs?).  Should be compatible, if possible, with the ODE integrators that are part of SciPy (so that I can use that for simulating systems).
{| style="float: right" width=30% border=1
** '''StateSpaceSystem''' - state space representation of an input/output system
|-
*** '''LinearStateSpaceSystem''' - linear system in state space form (ideally with time-delays)
|
** '''TransferFunction''' - frequency domain representation of an input/output system
==== Announcements ====
* The python-control user documentation has been shifted from SourceForge to MurrayWiki at Caltech.  Developer documentation remains on [http://python-control.sf.net SourceForge].
* Version 0.5a has been released: [http://sourceforge.net/mailarchive/message.php?msg_id=27912588 release notes], [http://sourceforge.net/projects/python-control/files/ file download]
|}
The Python Control Systems Library, python-control, is a python package that implements basic operations for analysis and design of feedback control systems.
* [http://python-control.sourceforge.net/manual User manual] - Sphinx documentation for the python-control package
* [[http:sourceforge.net/p/python-control/wiki/Download/|Download]] - download and install the latest release of the package
* [[python-control/Example: Vertical takeoff and landing aircraft|Example: Vertical takeoff and landing aircraft]] - demonstration of package capabilities
* [https://lists.sourceforge.net/lists/listinfo/python-control-announce Announcements mailing list] - sign up to receive announcements about python-control
<!-- * [[http:sourceforge.net/p/python-control/wiki/Developer%20information/|Developer information]] -  project information for active python-control developers -->
* [https://sourceforge.net/projects/python-control/ Project description page] - summary of all project information (SourceForge)


== Installation instructions ==
=== Project Overview ===


I'm using the [http://ipython.scipy.org/moin/ IPython] environment, with [http://scipy.org SciPy] extensions for scientific computing plus the [http://matplotlib.sourceforge.net/ matplotlib] extensions (which enables MATLAB-like plotting).  I am doing all of my playing on OS X, using fink.
The python-control package is a set of python classes and functions that implement common operations for the analysis and design of feedback control systems.  The initial goal is to implement all of the functionality required to work through the examples in the textbook ''[http://www.cds.caltech.edu/~murray/amwiki Feedback Systems]'' by &Aring;str&ouml;m and Murray.  A MATLAB compatibility package (control.matlab) is available that provides functions corresponding to the commands available in the MATLAB Control Systems Toolbox.


Here's what I had to do to get the basic setup that I am using.
Here are some of the basic functions that are (or will be) available in the package:
# Install SciPy - I did this using fink.  Have to use the main/unstable tree.
* Linear input/output systems in state space and frequency domain (transfer functions)
# Install matplotlib - Need this for plotting
* Block diagram algebra: serial, parallel and feedback interconnections
# Install ipython - interactive python interface
* Time response: initial, step, impulse (using the scipy.signal package)
 
* Frequency response: Bode and Nyquist plots
Small snipped of code for testing if everything is installed
* Control analysis: stability, reachability, observability, stability margins
import from scipy *
* Control design: eigenvalue placement, linear quadratic regulator
import from matlibplot *
* Estimator design: linear quadratic estimator (Kalman filter)
a = zeros(1000)
a[:100]=1
b = fft(a)
plot(abs(b))
show()
 
== Related documentation ==
 
=== Python documentation ===
* [http://www.scipy.org/ SciPy.org] - main web site for SciPy
** [http://ipython.scipy.org/moin/ IPython] - enhanced shell for python
**  [http://matplotlib.sourceforge.net/ matplotlib] - 2D plotting for python
* [http://www.pyrorobotics.org PyRo] - Python Robotics library (might be nice to be compatible with this
 
=== Related packages ===
* [http://www.slicot.org/ SLICOT] - Fortran 77 implementations of numerical algorithms for computations in systems and control theory
** [http://github.com/henjo/slicot/tree/master python wrapper] - Numpy wrapper of the control and systems library SLICOT
* [http://www.gnu.org/software/octave/doc/interpreter/Control-Theory.html Octave Control Systems Toolbox] - documentation for the Octave implementation (not sure what code is used for computing results)
* [http://www.siue.edu/~rkrauss/python_intro.html control.py] - Python Module for System Dynamics and Controls by Ryan Krauss

Latest revision as of 21:11, 31 May 2015

WARNING: The information on this page is out of date. The most up-to-date information about python-control is available in the documentation that is distributed with the package.

python-control home on SourceForge

Python Control Systems Library (python-control)


Announcements

  • The python-control user documentation has been shifted from SourceForge to MurrayWiki at Caltech. Developer documentation remains on SourceForge.
  • Version 0.5a has been released: release notes, file download

The Python Control Systems Library, python-control, is a python package that implements basic operations for analysis and design of feedback control systems.

Project Overview

The python-control package is a set of python classes and functions that implement common operations for the analysis and design of feedback control systems. The initial goal is to implement all of the functionality required to work through the examples in the textbook Feedback Systems by Åström and Murray. A MATLAB compatibility package (control.matlab) is available that provides functions corresponding to the commands available in the MATLAB Control Systems Toolbox.

Here are some of the basic functions that are (or will be) available in the package:

  • Linear input/output systems in state space and frequency domain (transfer functions)
  • Block diagram algebra: serial, parallel and feedback interconnections
  • Time response: initial, step, impulse (using the scipy.signal package)
  • Frequency response: Bode and Nyquist plots
  • Control analysis: stability, reachability, observability, stability margins
  • Control design: eigenvalue placement, linear quadratic regulator
  • Estimator design: linear quadratic estimator (Kalman filter)