Let's say that I have a discrete state space model:
$x(k+1) = Ax(k) + Bu(k) \\ y(k) = Cx(k) + Du(k)$
If I want to have this state space model as a balanced model realization. I need to exchange the state vector $x$ to $x = T\xi $. My model will then become.
$x(k+1) = TAT^{-1}x(k) + TBu(k) \\ y(k) = CT^{-1}x(k) + Du(k)$
According to my book. Then I need to find the matrix $T$. One good way to find the matrix $T$ is to solve controllability/reachability gramian matrix $P$ and obserability gramian $Q$ from the lyapunov equations:
$ A^TQA - Q + C^TC = 0$
$ APA^T - P + BB^T = 0 $
Once I have found $P, Q$, I need to find $T$ from the Cholesky factors $Q_1, U, \Sigma_1$.
$ Q = Q_1^TQ_1 \\ Q_1 P Q_1^T = U \Sigma^2 U^T \\ U^T U = I \\ \Sigma = \Sigma_1^T \Sigma_1 \\ T = \Sigma_1^{-1}U^TQ_1$
So my question is how I can find the Cholesky factors $\Sigma_1^{-1}U^TQ_1$ if I know $Q, P$? Here I not asking for deep theory. I would be very glad if I got a hint that I can use built in functions from Octave/Matlab.
Edit:
I can use matlab command
Q1 = chol(Q)
To find $Q_1$ or if I use
U = chol(I) % I is the identify matrix of same dimension as P and Q - I assume.
I found $U$. Now it's $\Sigma$ left. If I know $U,Q_1,P $
Can I transform this
$Q_1 P Q_1^T = U \Sigma^2 U^T$
Into:
$ [Q_1 P Q_1^TU^{-1}U^{-T}]^{1/2} = \Sigma $
?