Main Content

care

(Not recommended) Solve continuous-time algebraic Riccati equation

care is not recommended. Use icare instead. For more information, see Version History.

Description

[X,L,G] = care(A,B,Q,R,S,E) solves the general Riccati equation:

ATXE+ETXA(ETXB+S)R1(BTXE+ST)+Q=0

Along with the solution X, care returns the gain matrix G and a vector L of closed-loop eigenvalues.

example

[X,L,G] = care(A,B,Q) computes the unique solution X of the continuous-time algebraic Riccati equation:

ATX+XAXBBTX+Q=0

[X,L,G,report] = care(___) also returns a diagnosis report.

This syntax does not issue any error message when X fails to exist.

[X1,X2,D,L] = care(___,'factor') returns a factorized solution of the Riccati equation.

Examples

collapse all

This example show how to solve the following Riccati equation:

ATX+XAXBR1BTX+CTC=0

Given

A=[3211]B=[01]C=[11]R=3

Define the matrices and solve the equation.

a = [-3 2;1 1]
b = [0 ; 1]
c = [1 -1]
r = 3
[x,l,g] = care(a,b,c'*c,r)
x =

    0.5895    1.8216
    1.8216    8.8188


l =

   -1.4370
   -3.5026


g =

    0.6072    2.9396

You can verify that this solution is indeed stabilizing by comparing the eigenvalues of a and a-b*g.

[eig(a)   eig(a-b*g)]
ans =
   -3.4495   -3.5026
    1.4495   -1.4370

Finally, note that the variable l contains the closed-loop eigenvalues eig(a-b*g).

This example show how to solve the H-like Riccati equation

ATX+XA+X(γ2B1B1TB2B2T)X+CTC=0

You can rewrite the equation in the format supported by care as follows:

ATX+XAX[B1,B2]B[γ2I00I]R1[B1TB2T]X+CTC=0

For any given input matrices, you can now compute the stabilizing solution X by

B = [B1 , B2]
m1 = size(B1,2)
m2 = size(B2,2)
R = [-g^2*eye(m1) zeros(m1,m2) ; zeros(m2,m1) eye(m2)]

X = care(A,B,C'*C,R)

Input Arguments

collapse all

Input matrices, specified as matrices. When you omit R, S, and E, the function uses the default values R = I, S = 0, and E = I.

Output Arguments

collapse all

Solution to the continuous-time algebraic Riccati equation, returned as a matrix.

care returns [] for X when the associated Hamiltonian matrix has eigenvalues on the imaginary axis.

Closed-loop eigenvalues, returned as a matrix.

The closed-loop eigenvalues L is computed as:

L=eig(A-B*G,E)

State-feedback gain, returned as a matrix.

The state-feedback gain G is computed as:

G=R1(BTXE+ST)

care returns [] for G when the associated Hamiltonian matrix has eigenvalues on the imaginary axis.

Diagnosis report, returned as a scalar with one of these values:

  • -1 when the associated Hamiltonian pencil has eigenvalues on or very near the imaginary axis (failure).

  • -2 when there is no finite stabilizing solution X.

  • The Frobenius norm of the relative residual if X exists and is finite.

Factorized solution matrices, returned as matrices. The function returns X1, X2, and a diagonal scaling matrix D such that X = D(X1/X2)D.

care returns X1, X2, and D as empty when the associated Hamiltonian matrix has eigenvalues on the imaginary axis.

Limitations

The (A,B) pair must be stabilizable (that is, all unstable modes are controllable). In addition, the associated Hamiltonian matrix or pencil must have no eigenvalue on the imaginary axis. Sufficient conditions for this to hold are (Q,A) detectable when S=0 and R>0, or

[QSSTR]>0

Algorithms

care implements the algorithms described in [1]. It works with the Hamiltonian matrix when R is well-conditioned and E=I; otherwise it uses the extended Hamiltonian pencil and QZ algorithm.

References

[1] Arnold, W.F., and A.J. Laub. “Generalized Eigenproblem Algorithms and Software for Algebraic Riccati Equations.” Proceedings of the IEEE 72, no. 12 (1984): 1746–54. https://doi.org/10.1109/PROC.1984.13083.

Version History

Introduced before R2006a

collapse all

See Also