(Not recommended) Continuous-time algebraic Riccati equation solution
[X,L,G] = care(A,B,Q)
[X,L,G] = care(A,B,Q,R,S,E)
[X,L,G,report] = care(A,B,Q,...)
[X1,X2,D,L] = care(A,B,Q,...,'factor')
[X,L,G] = care(A,B,Q) computes the unique solution
X of the continuous-time algebraic Riccati equation
care function also returns the gain matrix, .
[X,L,G] = care(A,B,Q,R,S,E) solves the more general Riccati
set to the default values
E=I. Along with the solution
care returns the gain matrix and a vector
L of closed-loop eigenvalues, where
[X,L,G,report] = care(A,B,Q,...) returns a diagnosis
This syntax does not issue any error message when X fails to exist.
[X1,X2,D,L] = care(A,B,Q,...,'factor') returns two matrices
X2 and a diagonal scaling matrix
D such that
X = D*(X2/X1)*D.
The vector L contains the closed-loop eigenvalues. All outputs are empty when the associated Hamiltonian matrix has eigenvalues on the imaginary axis.
Solve Algebraic Riccati Equation
you can solve the Riccati equation
a = [-3 2;1 1] b = [0 ; 1] c = [1 -1] r = 3 [x,l,g] = care(a,b,c'*c,r)
This yields the solution
x x = 0.5895 1.8216 1.8216 8.8188
You can verify that this solution is indeed stabilizing by comparing the
[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
l l = -3.5026 -1.4370
Solve H-infinity ()-like Riccati Equation
rewrite it in the
care format as
You can now compute the stabilizing solution 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)
The 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 detectable when and , or
care implements the algorithms described in . It works with the Hamiltonian matrix when R is well-conditioned and ; otherwise it uses the extended Hamiltonian pencil and QZ
Not recommended starting in R2019a
Starting in R2019a, use the
icare command to solve continuous-time Riccati equations. This
approach has improved accuracy through better scaling and the computation of
K is more accurate when
ill-conditioned relative to
icare includes an optional
info structure to
gather the implicit solution data of the Riccati equation.
There are no plans to remove
care at this time.
 Arnold, W.F., III and A.J. Laub, "Generalized Eigenproblem Algorithms and Software for Algebraic Riccati Equations," Proc. IEEE®, 72 (1984), pp. 1746-1754