nengolib icon indicating copy to clipboard operation
nengolib copied to clipboard

Force positive definite Gramiam matrices when balancing

Open arvoelke opened this issue 7 years ago • 5 comments

Needs unit test.

For whatever reason switching my BLAS had the side-effect of introducing rounding errors into the observability Gramiam which makes the Cholesky decomposition raise LinAlgError: *-th leading minor not positive definite. Specifically this occurred when balancing a 27-dimensional PadeDelay system.

The approach taken here is to perturb the eigenvalues by the smallest possible value such that they all become positive. I've arbitrarily chosen 1e-19 - eig as the largest possible regularization, where eig is the smallest eigenvalue that is assumed to be no smaller than -1e-9. The logic is that if the smallest eigenvalue is any smaller than this, then something must be very wrong (and is then made to fail here). The 1e-19 is an epsilon needed to make the eigenvalues positive (rather than non-negative). These constants may need to be tweaked or exposed. Tested manually.

arvoelke avatar Jul 26 '17 23:07 arvoelke