Python code for computing balanced realizations of continuous- and discrete-time systems
The Lyapunov equations for computing the gramians are naively solved by setting up a n²-by-n² system of equations. This approach is only usable for small systems.
Given a LTI system defined by matrices A, B, C and D, compute a new balanced realization via Markov parameters