Matrix function

378 Views Asked by At

If we have $n$ by $n$ A matrix I want to ask about the general method to compute the matrix function. For example how I can compute:

$cos(A)$ or $sin(A)$ or $e^{A}$ or $log(A)$

or any other functions?

3

There are 3 best solutions below

0
On BEST ANSWER

A consequence of the Cayley-Hamilton theorem is that any analytic function $f$ of an $n\times n$ matrix $A$ can be expressed as a polynomial $p(A)$ of degree at most $n-1$. It’s also the case that if $\lambda$ is an eigenvalue of $A$, then $f(\lambda)=p(\lambda)$. If you know $A$’s eigenvalues, you can therefore generate a system of linear equations in the unknown coefficients of $p$. If there are repeated eigenvalues, this system will be underdetermined, but you can generate additional independent equations by repeatedly differentiating $f$ and $p$.

0
On

We can define functions $F: \mathcal{M}_{n\times n}(\mathbb{R})\rightarrow \mathcal{M}_{n\times n}(\mathbb{R})$ analogous to analytic functions $f: \mathbb{R}\rightarrow\mathbb{R}$ in the following way:

Let $A\in\mathcal{M}_{n\times n}(\mathbb{R})$. Define $A^0 = I$. Then, define $A^k = A\cdot A^{k-1}$ recursively, via the usual matrix product. For any polynomial $p(x) = \sum\limits_{i=1}^k c_ix^i$, we can now define the matrix polynomial $P(A) = \sum\limits_{i=1}^k c_iA^i$.

For functions which are not polynomials, but are analytic, we can use their power series expansion. Let $f(x)$ be an analytic function with power series $\sum\limits_{i=1}^\infty c_ix^i$. Then, we can define the matrix function $F(A)$ by its power series $ \sum\limits_{i=1}^\infty c_iA^i$, given that such a series converges to a unique matrix value for each $A$. Here is an example of proving convergence for the matrix exponential, $\exp(A) := \sum\limits_{i=1}^\infty \frac{1}{i!}A^i$. A similar method can be used to show convergence of other matrix power series corresponding to real analytic functions.

0
On

Calculate the eigenvalue decomposition of the matrix $$A=QDQ^{-1}$$ where $D$ is a diagonal matrix whose entries are the eigenvalues of $A$, and the columns of $Q$ are the corresponding eigenvectors.

With this decomposition in hand, any function can be evaluated as $$f(A)=Q\,f(D)\,Q^{-1}$$ which is very convenient; just evaluate the function at each diagonal element.

If $A$ cannot be diagonalized or $Q$ is ill-conditioned, add a small random perturbation to the matrix and try again. $$\eqalign{ A' &= A+E \cr \|E\| &\approx \|A\|\cdot 10^{-14} \cr }$$