Function care computes the solution X of the continuous-time algebraic Riccati equation
Q + A'*X + X*A - X*G*X = 0
with
G = B*R-1*B'
using the Schur vector approach proposed by Laub [1].
It is assumed that Q is symmetric and positive semidefinite and R is symmetric, nonsingular and positive definite, (A,B) is stabilizable and (A,Q) is detectable. The assumptions are not checked in this function!
The assumptions guarantee that Hamiltonian matrix
H = [A, -G; -Q, -A']
has no pure imaginary eigenvalue and can be put to an ordered real Schur form
U'*H*U = S = [S11, S12; 0, S22]
with orthogonal similarity transformation U. S is ordered in such a way, that S11 contains the n stable eigenvalues of the closed loop system with system matrix
A - B*R-1*B'*X
If U is partitioned to
U = [U11, U12; U21, U22]
with dimensions according to S, the solution X can be calculated by
X*U11 = U21.
The algorithm uses LAPACK routines dgehrd (to compute the upper Hessenberg matrix of H), dorghr (to calculate the orthogonal matrix from the elementary reflectors as returned from dgehrd), dhseqr (to put transformed H to Schur form and to calculate the eigenvalues of the closed loop system) and dtrsen (to compute the ordered real Schur form and matrix U).
function care extends Modelica.Icons.Function; import Modelica_LinearSystems2.Math.Matrices; input Real A[:, size(A, 1)]; input Real B[size(A, 1), :]; input Real R[size(B, 2), size(B, 2)] = identity(size(B, 2)); input Real Q[size(A, 1), size(A, 1)] = identity(size(A, 1)); input Boolean refine = false; output Real X[size(A, 1), size(A, 2)] "Stabilizing solution of CARE"; output Complex ev[size(A, 1)] "Eigenvalues of the closed loop system"; end care;
Date | Author | Comment |
---|---|---|
2010-05-31 | Marcus Baur, DLR-RM | Realization |