Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions control/stochsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,17 @@ def lqe(*args, symmetric_kwargs=None, **kwargs):
* ``L, P, E = lqe(A, G, C, QN, RN)``
* ``L, P, E = lqe(A, G, C, QN, RN, NN)``

where `sys` is an `LTI` object, and `A`, `G`, `C`, `QN`, `RN`, and `NN`
are 2D arrays or matrices of appropriate dimension.
where `sys` is a `StateSpace` object, and `A`, `G`, `C`, `QN`, `RN`, and
`NN` are 2D arrays or matrices of appropriate dimension.

Parameters
----------
A, G, C : 2D array_like
Dynamics, process noise (disturbance), and output matrices.
sys : `StateSpace` or `TransferFunction`
sys : `StateSpace`
Linear I/O system, with the process noise input taken as the system
input.
input (`G = sys.B`). Thus `QN` must be square with dimension
`sys.ninputs`, not necessarily `sys.nstates`.
QN, RN : 2D array_like
Process and sensor noise covariance matrices.
NN : 2D array, optional
Expand Down Expand Up @@ -219,6 +220,10 @@ def dlqe(*args, symmetric_kwargs=None, **kwargs):
Process and sensor noise covariance matrices.
NN : 2D array, optional
Cross covariance matrix (not yet supported).
sys : `StateSpace`
If a state-space system is passed instead of `A`, `G`, and `C`,
its input matrix `sys.B` is used as `G`. Consequently `QN`
must have shape (`sys.ninputs`, `sys.ninputs`).
method : str, optional
Set the method used for computing the result. Current methods are
'slycot' and 'scipy'. If set to None (default), try 'slycot'
Expand Down
23 changes: 17 additions & 6 deletions doc/stochastic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,23 @@ called in several forms:
* ``L, P, E = lqe(A, G, C, QN, RN)``
* ``L, P, E = lqe(A, G, C, QN, RN, NN)``

where :code:`sys` is an :class:`LTI` object, and `A`, `G`, `C`, `QN`, `RN`,
and `NN` are 2D arrays of appropriate dimension. If :code:`sys` is a
discrete-time system, the first two forms will compute the discrete
time optimal controller. For the second two forms, the :func:`dlqr`
function can be used. Additional arguments and details are given on
the :func:`lqr` and :func:`dlqr` documentation pages.
where :code:`sys` is a :class:`StateSpace` object, and `A`, `G`, `C`,
`QN`, `RN`, and `NN` are 2D arrays of appropriate dimension.

For the state-space system form ``lqe(sys, QN, RN)``, the process noise
matrix :math:`G` is taken to be :code:`sys.B`. This models disturbances
entering through the system's input channels: ``QN`` must have shape
``(sys.ninputs, sys.ninputs)``, which may differ from the number of states.
The same convention applies to ``dlqe(sys, QN, RN)`` for discrete-time
systems. To model noise entering through a different matrix, specify
:math:`G` explicitly using the ``lqe(A, G, C, QN, RN)`` form (or ``dlqe``).
For example, use ``G = np.eye(sys.nstates)`` if independent disturbances
are modelled as entering every state derivative.

If :code:`sys` is a discrete-time system, the first two forms call
:func:`dlqe` to compute the discrete-time estimator. For the matrix
forms, call :func:`dlqe` directly. Additional arguments and details
are given on the :func:`lqe` and :func:`dlqe` documentation pages.

.. testsetup:: kalman

Expand Down
Loading