Algebraic Lyapunov equation A*X+X*t(A)+Q=0
lyap(A, Q)
X A symmetric matrix of same dimension as A
If A is asymptotically stable, Q is positive semidefinite and the pair (A,Q) is controllable, then X will be positive definite. Several similar results exist. The implementation uses vectorization and kronecker products and does not employ sparsity, so is only suitable for small systems.