The command GRAM calculates the Cholesky factorization of the gramian directly from a Cholesky Lyapunov solver. If there is no specified factorization, GRAM explicitly forms the product Wo = R' * R. In other words,
is equivalent to:
r = gram(SYS, 'of');
q = r' * r;
To calculate the Cholesky factorization of the gramian,
should be used. Using:
q = gram(SYS, 'o');
rq = chol(q);
may cause round-off errors and scaling issues. This is so because it performs the product q = r' * r first in the call to GRAM and then refactorizes the product q using CHOL.
Best Answer