solve_continuous_are(a, b, q, r, e=None, s=None, balanced=True)
The CARE is defined as
$$X A + A^H X - X B R^{-1} B^H X + Q = 0$$The limitations for a solution to exist are :
All eigenvalues of $A$ on the right half plane, should be controllable.
The associated hamiltonian pencil (See Notes), should have eigenvalues sufficiently away from the imaginary axis.
Moreover, if e
or s
is not precisely None
, then the generalized version of CARE
is solved. When omitted, e
is assumed to be the identity and s
is assumed to be the zero matrix with sizes compatible with a
and b
, respectively.
The equation is solved by forming the extended hamiltonian matrix pencil, as described in , $H - \lambda J$ given by the block matrices :
[ A 0 B ] [ E 0 0 ] [-Q -A^H -S ] - \lambda * [ 0 E^H 0 ] [ S^H B^H R ] [ 0 0 0 ]
and using a QZ decomposition method.
In this algorithm, the fail conditions are linked to the symmetry of the product $U_2 U_1^{-1}$ and condition number of $U_1$ . Here, $U$ is the 2m-by-m matrix that holds the eigenvectors spanning the stable subspace with 2-m rows and partitioned into two m-row matrices. See and for more details.
In order to improve the QZ decomposition accuracy, the pencil goes through a balancing step where the sum of absolute values of $H$ and $J$ entries (after removing the diagonal entries of the sum) is balanced following the recipe given in .
Square matrix
Input
Input
Nonsingular square matrix
Nonsingular square matrix
Input
The boolean that indicates whether a balancing step is performed on the data. The default is set to True.
For cases where the stable subspace of the pencil could not be isolated. See Notes section and the references for details.
Solution to the continuous-time algebraic Riccati equation.
Solves the continuous-time algebraic Riccati equation (CARE).
solve_discrete_are
Solves the discrete-time algebraic Riccati equation
Given a
, b
, q
, and r
solve for x
:
>>> from scipy import linalg
... a = np.array([[4, 3], [-4.5, -3.5]])
... b = np.array([[1], [-1]])
... q = np.array([[9, 6], [6, 4.]])
... r = 1
... x = linalg.solve_continuous_are(a, b, q, r)
... x array([[ 21.72792206, 14.48528137], [ 14.48528137, 9.65685425]])
>>> np.allclose(a.T.dot(x) + x.dot(a)-x.dot(b).dot(b.T).dot(x), -q) TrueSee :
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.linalg._solvers.solve_continuous_are
scipy.linalg._solvers.solve_discrete_are
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them