Oct-03-2020, 02:07 PM
Hi there ,
I have a problem with calculating the inverse of a Matrix A. I use the numpy library.
Inverse = numpy.linalg(A)
This worked fine so far. However, there was a problem when I tried to compute the Inverse of the following Matrix:
A [[1778.224561 1123.972526 ]
[1123.972526 710.43571601]]
(this is the output of print('A', A))
The output window stated the error: numpy.linalg.LinAlgError: singular matrix.
If the determinant of a matrix A is zero, the matrix is called a Singular Matrix and the Inverse of A does not exist. But when I calculate the determinant of A with Wolfram Alpha I get the value
det(A) = 0.00001778224561.
If I use the command linalg.det(A) in Python, I get the following output:
Det A 0.0
I assume that the linalg.inv function checks, wether the Inverse of a Matrix exists by calculating the determinant first. But the value seems to be rounded. I tried the scipy library as well but is gives the same error output.
If I am correct with my assumption is there a way to avoid the rounding of the determinate or to use a different function to calculate the Inverse of a matrix?
(I hope this the right thread for this kind of question)
I have a problem with calculating the inverse of a Matrix A. I use the numpy library.
Inverse = numpy.linalg(A)
This worked fine so far. However, there was a problem when I tried to compute the Inverse of the following Matrix:
A [[1778.224561 1123.972526 ]
[1123.972526 710.43571601]]
(this is the output of print('A', A))
The output window stated the error: numpy.linalg.LinAlgError: singular matrix.
If the determinant of a matrix A is zero, the matrix is called a Singular Matrix and the Inverse of A does not exist. But when I calculate the determinant of A with Wolfram Alpha I get the value
det(A) = 0.00001778224561.
If I use the command linalg.det(A) in Python, I get the following output:
Det A 0.0
I assume that the linalg.inv function checks, wether the Inverse of a Matrix exists by calculating the determinant first. But the value seems to be rounded. I tried the scipy library as well but is gives the same error output.
If I am correct with my assumption is there a way to avoid the rounding of the determinate or to use a different function to calculate the Inverse of a matrix?
(I hope this the right thread for this kind of question)