From MurrayWiki
Jump to: navigation, search

This page contains information for downloading and installing python-control. This package is designed for use in the IPython environment, with SciPy extensions for scientific computing plus the matplotlib extensions (which enables MATLAB-like plotting).

  • Source code - download the latest version of the python control library here


Standard python libraries

In order to run control-python, you must first install some standard python packages:

  1. SciPy - Open source library of scientific tools:
  2. Matplotlib - Plotting library for python:
  3. ipython (optional) - interactive python shell:

If you have everything installed correctly, you should be able to run the following code

from scipy import *
from pylab import *    # Not needed if you use ipython -pylab
a = zeros(1000)
b = fft(a)
show()                 # Not needed if you use ipython -pylab


Some of the underlying functions in python-control are carried out using the SLICOT software library. The python-control library uses the slycot python wrapper developed by Enrico Avventi at KTH.

  • Slycot is only required for functions that make use of SLICOT routines (eg, linear quadratic regulators, Kalman filtering, H_{\infty } control)
  • The slycot library is currently under development and the API is not yet fixed. Some errors may occur if the version of slycot and python-control are incompatible


The python-control package can be downloaded from SourceForge:

The files are distributed as compressed tar files. To unpack and installed, run the following from the command line

tar xzf
python install

where N-mx is the latest release (eg, 0.3c).

To see if things are working, you can run the script (using either python or ipython -pylab). It should generate a step response, Bode plot and Nyquist plot for a simple second order linear system.

Installation notes


  • To compile for 64 bit architecture on OS X, edit to include the lines
extra_link_args=['-arch x86_64']
and then run as
python config_fc --arch="-arch x86_64" build