8000 update installation instructions per issue #850 · ControlCorp/python-control@6a18702 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a18702

Browse files
committed
update installation instructions per issue python-control#850
1 parent 981104b commit 6a18702

File tree

3 files changed

+76
-60
lines changed

3 files changed

+76
-60
lines changed

README.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ Python Control Systems Library
2222
The Python Control Systems Library is a Python module that implements basic
2323
operations for analysis and design of feedback control systems.
2424

25-
2625
Have a go now!
27-
==============
26+
--------------
2827
Try out the examples in the examples folder using the binder service.
2928

3029
.. image:: https://mybinder.org/badge_logo.svg
3130
:target: https://mybinder.org/v2/gh/python-control/python-control/HEAD
3231

32+
The package can also be installed on Google Colab using the commands::
33+
34+
!pip install control
35+
import control as ct
3336

3437
Features
3538
--------
@@ -44,17 +47,16 @@ Features
4447
- Nonlinear systems: optimization-based control, describing functions, differential flatness
4548

4649
Links
47-
=====
50+
-----
4851

4952
- Project home page: http://python-control.org
5053
- Source code repository: https://github.com/python-control/python-control
5154
- Documentation: http://python-control.readthedocs.org/
5255
- Issue tracker: https://github.com/python-control/python-control/issues
5356
- Mailing list: http://sourceforge.net/p/python-control/mailman/
5457

55-
5658
Dependencies
57-
============
59+
------------
5860

5961
The package requires numpy, scipy, and matplotlib. In addition, some routines
6062
use a module called slycot, that 10000 is a Python wrapper around some FORTRAN
@@ -64,6 +66,7 @@ functionality is limited or absent, and installation of slycot is recommended
6466

6567
https://github.com/python-control/Slycot
6668

69+
6770
Installation
6871
============
6972

@@ -73,7 +76,7 @@ Conda and conda-forge
7376
The easiest way to get started with the Control Systems library is
7477
using `Conda <https://conda.io>`_.
7578

76-
The Control Systems library has been packages for the `conda-forge
79+
The Control Systems library has packages available using the `conda-forge
7780
<https://conda-forge.org>`_ Conda channel, and as of Slycot version
7881
0.3.4, binaries for that package are available for 64-bit Windows,
7982
OSX, and Linux.
@@ -83,6 +86,10 @@ conda environment, run::
8386

8487
conda install -c conda-forge control slycot
8588

89+
Mixing packages from conda-forge and the default conda channel can
90+
sometimes cause problems with dependencies, so it is usually best to
91+
instally NumPy, SciPy, and Matplotlib from conda-forge as well.
92+
8693
Pip
8794
---
8895

@@ -92,7 +99,8 @@ To install using pip::
9299
pip install control
93100

94101
If you install Slycot using pip you'll need a development environment
95-
(e.g., Python development files, C and Fortran compilers).
102+
(e.g., Python development files, C and Fortran compilers). Pip
103+
installation can be particularly complicated for Windows.
96104

97105
Installing from source
98106
----------------------
@@ -106,11 +114,13 @@ toplevel `python-control` directory::
106114
Article and Citation Information
107115
================================
108116

109-
An `article <https://ieeexplore.ieee.org/abstract/document/9683368>`_ about the library is available on IEEE Explore. If the Python Control Systems Library helped you in your research, please cite::
117+
An `article <https://ieeexplore.ieee.org/abstract/document/9683368>`_ about
118+
the library is available on IEEE Explore. If the Python Control Systems Library helped you in your research, please cite::
110119

111120
@inproceedings{python-control2021,
112121
title={The Python Control Systems Library (python-control)},
113-
author={Fuller, Sawyer and Greiner, Ben and Moore, Jason and Murray, Richard and van Paassen, Ren{\'e} and Yorke, Rory},
122+
author={Fuller, Sawyer and Greiner, Ben and Moore, Jason and
123+
Murray, Richard and van Paassen, Ren{\'e} and Yorke, Rory},
114124
booktitle={60th IEEE Conference on Decision and Control (CDC)},
115125
pages={4875--4881},
116126
year={2021},

doc/conventions.rst

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
Library conventions
77
*******************
88

9-
The python-control library uses a set of standard conventions for the way
10-
that different types of standard information used by the library.
9+
The python-control library uses a set of standard conventions for the
10+
way that different types of standard information used by the library.
11+
Throughout this manual, we assume the `control` package has been
12+
imported as `ct`.
13+
1114

1215
LTI system representation
1316
=========================
@@ -29,7 +32,7 @@ of linear time-invariant (LTI) systems:
2932
3033
where u is the input, y is the output, and x is the state.
3134

32-
To create a state space system, use the :func:`ss` function:
35+
To create a state space system, use the :func:`ss` function::
3336

3437
sys = ct.ss(A, B, C, D)
3538

@@ -51,7 +54,7 @@ transfer functions
5154
where n is generally greater than or equal to m (for a proper transfer
5255
function).
5356

54-
To create a transfer function, use the :func:`tf` function:
57+
To create a transfer function, use the :func:`tf` function::
5558

5659
sys = ct.tf(num, den)
5760

@@ -77,7 +80,7 @@ performed.
7780
The FRD class is also used as the return type for the
7881
:func:`frequency_response` function (and the equivalent method for the
7982
:class:`StateSpace` and :class:`TransferFunction` classes). This
80-
object can be assigned to a tuple using
83+
object can be assigned to a tuple using::
8184

8285
mag, phase, omega = response
8386

@@ -91,7 +94,7 @@ is not SISO or `squeeze` is False, the array is 3D, indexed by the
9194
output, input, and frequency. If `squeeze` is True then
9295
single-dimensional axes are removed. The processing of the `squeeze`
9396
keyword can be changed by calling the response function with a new
94-
argument:
97+
argument::
9598

9699
mag, phase, omega = response(squeeze=False)
97100

@@ -101,10 +104,10 @@ Discrete time systems
101104
A discrete time system is created by specifying a nonzero 'timebase', dt.
102105
The timebase argument can be given when a system is constructed:
103106

104-
* dt = 0: continuous time system (default)
105-
* dt > 0: discrete time system with sampling period 'dt'
106-
* dt = True: discrete time with unspecified sampling period
107-
* dt = None: no timebase specified
107+
* `dt = 0`: continuous time system (default)
108+
* `dt > 0`: discrete time system with sampling period 'dt'
109+
* `dt = True`: discrete time with unspecified sampling period
110+
* `dt = None`: no timebase specified
108111

109112
Only the :class:`StateSpace`, :class:`TransferFunction`, and
110113
:class:`InputOutputSystem` classes allow explicit representation of
@@ -119,8 +122,8 @@ result will have the timebase of the latter system. For continuous time
119122
systems, the :func:`sample_system` function or the :meth:`StateSpace.sample`
120123
and :meth:`TransferFunction.sample` methods can be used to create a discrete
121124
time system from a continuous time system. See
122-
:ref:`utility-and-conversions`. The default value of 'dt' can be changed by
123-
changing the value of ``control.config.defaults['control.default_dt']``.
125+
:ref:`utility-and-conversions`. The default value of `dt` can be changed by
126+
changing the value of `control.config.defaults['control.default_dt']`.
124127

125128
Conversion between representations
126129
----------------------------------
@@ -165,10 +168,9 @@ points in time, rows are different components::
165168
...
166169
[ui(t1), ui(t2), ui(t3), ..., ui(tn)]]
167170

168-
Same for X, Y
169-
170-
So, U[:,2] is the system's input at the third point in time; and U[1] or U[1,:]
171-
is the sequence of values for the system's second input.
171+
(and similarly for `X`, `Y`). So, `U[:, 2]` is the system's input at the
172+
third point in time; and `U[1]` or `U[1, :]` is the sequence of values for
173+
the system's second input.
172174

173175
When there is only one row, a 1D object is accepted or returned, which adds
174176
convenience for SISO systems:
@@ -185,8 +187,10 @@ Functions that return time responses (e.g., :func:`forced_response`,
185187
:func:`impulse_response`, :func:`input_output_response`,
186188
:func:`initial_response`, and :func:`step_response`) return a
187189
:class:`TimeResponseData` object that contains the data for the time
188-
response. These data can be accessed via the ``time``, ``outputs``,
189-
``states`` and ``inputs`` properties::
190+
response. These data can be accessed via the
191+
:attr:`~TimeResponseData.time`, :attr:`~TimeResponseData.outputs`,
192+
:attr:`~TimeResponseData.states` and :attr:`~TimeResponseData.inputs`
193+
properties::
190194

191195
sys = ct.rss(4, 1, 1)
192196
response = ct.step_response(sys)
@@ -213,13 +217,13 @@ The output of a MIMO LTI system can be plotted like this::
213217
plot(t, y[1], label='y_1')
214218

215219
The convention also works well with the state space form of linear
216-
systems. If ``D`` is the feedthrough matrix (2D array) of a linear system,
217-
and ``U`` is its input (array), then the feedthrough part of the system's
220+
systems. If `D` is the feedthrough matrix (2D array) of a linear system,
221+
and `U` is its input (array), then the feedthrough part of the system's
218222
response, can be computed like this::
219223

220224
ft = D @ U
221225

222-
Finally, the `to_pandas()` function can be used to create a pandas dataframe:
226+
Finally, the `to_pandas()` function can be used to create a pandas dataframe::
223227

224228
df = response.to_pandas()
225229

@@ -242,16 +246,12 @@ for various types of plots and establishing the underlying representation for
242246
state space matrices.
243247

244248
To set the default value of a configuration variable, set the appropriate
245-
element of the `control.config.defaults` dictionary:
246-
247-
.. code-block:: python
249+
element of the `control.config.defaults` dictionary::
248250

249251
ct.config.defaults['module.parameter'] = value
250252

251253
The `~control.config.set_defaults` function can also be used to set multiple
252-
configuration parameters at the same time:
253-
254-
.. code-block:: python
254+
configuration parameters at the same time::
255255

256256
ct.config.set_defaults('module', param1=val1, param2=val2, ...]
257257

doc/intro.rst

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,43 @@ some thing to keep in mind:
3131
* You must include commas in vectors. So [1 2 3] must be [1, 2, 3].
3232
* Functions that return multiple arguments use tuples.
3333
* You cannot use braces for collections; use tuples instead.
34+
* Time series data have time as the final index (see
35+
:ref:`time-series-convention`).
3436

3537
Installation
3638
============
3739

38-
The `python-control` package can be installed using pip, conda or the
39-
standard setuptools mechanisms. The package requires `numpy`_ and
40-
`scipy`_, and the plotting routines require `matplotlib
41-
<https://matplotlib.org>`_. In addition, some routines require the `slycot
42-
<https://github.com/python-control/Slycot>`_ library in order to implement
43-
more advanced features (including some MIMO functionality).
40+
The `python-control` package can be installed using conda or pip. The
41+
package requires `NumPy`_ and `SciPy`_, and the plotting routines
42+
require `Matplotlib <https://matplotlib.org>`_. In addition, some
43+
routines require the `Slycot
44+
<https://github.com/python-control/Slycot>`_ library in order to
45+
implement more advanced features (including some MIMO functionality).
4446

47+
For users with the Anaconda distribution of Python, the following
48+
command can be used::
49+
50+
conda install -c conda-forge control slycot
51+
52+
This installs `slycot` and `python-control` from conda-forge, including the
53+
`openblas` package. NumPy, SciPy, and Matplotlib will also be installed if
54+
they are not already present.
55+
56+
.. note::
57+
Mixing packages from conda-forge and the default conda channel
58+
can sometimes cause problems with dependencies, so it is usually best to
59+
instally NumPy, SciPy, and Matplotlib from conda-forge as well.)
4560

4661
To install using pip::
4762

4863
pip install slycot # optional
4964
pip install control
5065

66+
.. note::
67+
If you install Slycot using pip you'll need a development
68+
environment (e.g., Python development files, C and Fortran compilers).
69+
Pip installation can be particularly complicated for Windows.
70+
5171
Many parts of `python-control` will work without `slycot`, but some
5272
functionality is limited or absent, and installation of `slycot` is
5373
recommended. Users can check to insure that slycot is installed
@@ -56,36 +76,22 @@ correctly by running the command::
5676
python -c "import slycot"
5777

5878
and verifying that no error message appears. More information on the
59-
slycot package can be obtained from the `slycot project page
79+
Slycot package can be obtained from the `Slycot project page
6080
<https://github.com/python-control/Slycot>`_.
6181

62-
For users with the Anaconda distribution of Python, the following
63-
commands can be used::
64-
65-
conda install numpy scipy matplotlib # if not yet installed
66-
conda install -c conda-forge control slycot
67-
68-
This installs `slycot` and `python-control` from conda-forge, including the
69-
`openblas` package.
70-
71-
Alternatively, to use setuptools, first `download the source
82+
Alternatively, to install from source, first `download the source
7283
<https://github.com/python-control/python-control/releases>`_ and unpack it.
7384
To install in your home directory, use::
7485

75-
python setup.py install --user
76-
77-
or to install for all users (on Linux or Mac OS)::
78-
79-
python setup.py build
80-
sudo python setup.py install
86+
pip install .
8187

8288
Getting started
8389
===============
8490

8591
There are two different ways to use the package. For the default interface
8692
described in :ref:`function-ref`, simply import the control package as follows::
8793

88-
>>> import control
94+
>>> import control as ct
8995

9096
If you want to have a MATLAB-like environment, use the :ref:`matlab-module`::
9197

0 commit comments

Comments
 (0)
0