Using the same solver for real and imaginary matrix equations

61 Views Asked by At

If I want to solve a matrix equation like $Ax =b$, where $A$ is $n \times n$ matrix and real, and $b$ is a real vector which has a length $n$, $x$ is the solution for the linear equation. I solved the above equation by using that solver $Ax =b$.

What if $A$ is $n \times n$ matrix and complex, and $b$ is a complex vector which has a length $n$. Can I use the same strategy?

EDIT:

We can find the solution of x by finding the inverse of A.

B= inv(A)

And therefore

x =A^{-1}b.

x= B*b

Can i apply the same solver if A and b are complex?

2

There are 2 best solutions below

3
On

What if A is $n×n$ matrix and complex, and $b$ is a complex vector which has a length $n$. Can I use the same strategy?

Yes, if your method is Gaussian elimination.

0
On

Matlab has a help page in case you need some help. The following link contains the help page to 'system of linear equations' solvers. Matlab help page for system of linear equations. More specifically, it shows you what algorithm is used depending on the matrix $A$ (since $Ax = b$ also works for over determined systems, in which case you will get a least squares approximation). Note that this method is more reliable then manually inverting the matrix $A$, since this takes much more computational time!

$\textbf{EDIT:}$ I assumed you want to solve equations using matlab, since you tagged this question with 'matlab'.