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:
- SciPy - Open source library of scientific tools: http://www.scipy.org
- Matplotlib - Plotting library for python: matplotlib.sourceforge.net
- ipython (optional) - interactive python shell: http://ipython.scipy.org
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) a[:100]=1 b = fft(a) plot(abs(b)) show() # Not needed if you use ipython -pylab
- 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 control-N.mx.tar.gz cd control-N.mx python setup.py install
where N-mx is the latest release (eg, 0.3c).
To see if things are working, you can run the script secord-matlab.py (using either python or ipython -pylab). It should generate a step response, Bode plot and Nyquist plot for a simple second order linear system.
- To compile for 64 bit architecture on OS X, edit setup.py to include the lines
- and then run setup.py as
python setup.py config_fc --arch="-arch x86_64" build