Hello everyone,
first about the background: I have problems inverting a matrix using casadi.solve, since the matrix appears to be singular according to casadi.sprank. But from what I know, this matrix shouldn't be singular in principle, so I think I have a bug somewhere in my code which I wasn't yet able to resolve.
I got to know that for determination of the matrix rank with casadi.sprank, you use casadi.dulmageMendelsohn which is described to be an implementation of the Dulmage-Mendelsohn matrix decomposition algorithm, as I got to know e. g. from
https://github.com/casadi/casadi/issues/601. So in principle, one should be able to - in addition to the matrix rank - get also information about the problematic (i. e. over- and under-determined) matrix parts from this function, which is something that I think would be of great use for debugging purposes (not only for this application, probably).
Within the issue mentioned above, the documentation for the Matlab dmperm function is referenced which shows i. a. the structure of the decomposed matrix and the several blocks contained. But from what I see, the depiction in the Matlab documentation shows a upper block diagonal matrix, while the CasADi implementation generates a lower block triangular matrix. So my questions would be:
- If I use this method for examination of matrices constructed from MX symbolics (which is what I would do), the output of slicing these matrices would probably be rather cryptic. What I thought of was using the casadi.Sparsity.spy function, which would probably yield already good information about the structure. In addition this this method, are there other possibilities or tricks to improve the clearness of the returned values of MX slicings?
Thank all of you really much for your help! And also, if there are other (and better) ways to address this problems, any hints are of course highly appreciated!
Best, Adrian