{ } Raw JSON

bundles / scipy latest / scipy / linalg / _solvers / solve_continuous_are

function

scipy.linalg._solvers:solve_continuous_are

source: /scipy/linalg/_solvers.py :342

Signature

def   solve_continuous_are ( a b q r e = None s = None balanced = True )

Summary

Solves the continuous-time algebraic Riccati equation (CARE).

Extended Summary

The CARE is defined as

The limitations for a solution to exist are :

  • All eigenvalues of 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 documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details.

Parameters

a : (M, M) array_like

Square matrix

b : (M, N) array_like

Input

q : (M, M) array_like

Input

r : (N, N) array_like

Nonsingular square matrix

e : (M, M) array_like, optional

Nonsingular square matrix

s : (M, N) array_like, optional

Input

balanced : bool, optional

The boolean that indicates whether a balancing step is performed on the data. The default is set to True.

Returns

x : (M, M) ndarray

Solution to the continuous-time algebraic Riccati equation.

Raises

: LinAlgError

For cases where the stable subspace of the pencil could not be isolated. See Notes section and the references for details.

Notes

The equation is solved by forming the extended hamiltonian matrix pencil, as described in [1], 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 and condition number of . Here, 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 [1] and [2] 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 and entries (after removing the diagonal entries of the sum) is balanced following the recipe given in [3].

Examples

Given `a`, `b`, `q`, and `r` solve for `x`:
import numpy as np
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
np.allclose(a.T.dot(x) + x.dot(a)-x.dot(b).dot(b.T).dot(x), -q)

See also

solve_discrete_are

Solves the discrete-time algebraic Riccati equation

Aliases

  • scipy.linalg.solve_continuous_are

Referenced by

This package