# How to find the inverse a symbolic matrix that Mathematica thinks might be singular

I have a square matrix depending on a parameter "a". When "a" has a numeric value (eg 2.1 * 10 ^ 8) through the inverse function Inverse[] I can invert the matrix. If I write the matrix as a function of "a" do not declare its value when the invert Mathematica tells me that it is singular (suspect singular) then not allow me to Invert it. The determinant of the matrix in symbolic form turns out to be a very small value in the order of 6*10 ^ -25000. Do you think I can get the inverse of this matrix in symbolic form? the matrix is generated by:

K0 = Ct.E0.Transpose[Ct];


where Ct is a matrix indipendent from "a" , while "E" is a diagonal matrix which depends on "a" in the following way :

http://i.stack.imgur.com/VXX2A.png

The matrix Ct and E are written manually.

I attach the file containing the matrix mathematica https://drive.google.com/file/d/0B7In1ClJQ-FVZVRuNHMycGotUTg/edit?usp=sharing

I was not able to include them here as a code. Thanks in advance

• Can you provide the matrix/the code to generate it ? – Sektor Mar 15 '14 at 13:16
• thanks Sektor This is the det of simbolyc matrix : i.imgur.com/OYJjxET.png This is the part of simbolyc matrix (is a large matrix): i.imgur.com/72Sdqrr.png This is the errore reported by mathematica:i.imgur.com/lDqzBrQ.png I don't understand becouse assigning a numerical value to "a" the matrix to be inverted, if I leave everything in a symbolic way, I can't reverse it. – plus91 Mar 15 '14 at 13:42
• No, you should edit your Q and add any relevant code :) BTW Not images, code, because it is tedious to reproduce the problem :) – Sektor Mar 15 '14 at 14:00
• Sektor I edited the Q thx :) – plus91 Mar 15 '14 at 14:30
• Don't post images. Post code instead, please. – Dr. belisarius Mar 15 '14 at 14:46

## 1 Answer

I think it's just a matter of handling the numerics; you have very small matrix elements which give rows/columns of all zeros when chopped.

You can avoid that by transforming the elements of your matrices to be rationals :

c = Rationalize[Cttt, 10^(-50)];
e = Rationalize[E0, 10^(-50)];
k = Inverse[c.e.Transpose[c]];


Check :

Block[{a = 2.1 10^8}, Det[Cttt.E0.Transpose[Cttt]]]
(* 7.41902*10^100 *)

1/Det[k] /. a -> 2.1 10^8
(* 7.41902084900741*10^100 *)

• Thank you very much. The procedure that you have shown me, seems to solve the problem. However, I will do some tests on the results obtained from the solution of the system using the inverse matrix of K. I'll let you know soon. – plus91 Mar 16 '14 at 0:19
• @ b.gatessucks thank you, if the matrix "k" depends on a single parameter the procedure works. If the matrix depends on several parameters (a, b, c ...) the calculation of the inverse matrix requires a high computational time. Do you think there is another way to overcome the problem? The option ZeroTest associated with the Inverse function [] might be useful? – plus91 Mar 16 '14 at 11:14
• I'd rather spend some time thinking about another way of setting up the problem, so that you don't end up with matrix elements differing by 30+ orders of magnitude. – b.gates.you.know.what Mar 16 '14 at 16:15
• @ b.gatessucks thanks for your time.The problem concerns the solution of the system to find the nodal displacements of the trusses. The matrices are related to physical parameters that can not vary. At the moment I have no other ideas on how to set up the problem. – plus91 Mar 16 '14 at 18:46