solveAlgebraicRiccati_eig.m 350 Bytes
Newer Older
1
function X = solveAlgebraicRiccati_eig(A, G, Q)
2
%Solves the algebraic Riccati equation of the form A'X+XA'-XGX+Q=0, where X is symmetric with eigendecomposition.
3
%Danilo Bruno, 2014
4 5 6 7 8 9 10 11 12 13 14 15 16 17

n = size(A,1);
Z = [A -G; -Q -A'];

[V,D] = eig(Z);
U = [];
for j=1:2*n
	if real(D(j,j)) < 0 
		U = [U V(:,j)];
	end
end

X = U(n+1:end,1:n) / U(1:n,1:n);
X = real(X);