Matrix Functions with NDSolveOne of the important features of many of Mathematica's numerical solvers is that they work for vector and matrix input. Typically this is used to solve coupled systems of equations, but it can be used to solve matrix specific problems. One example will be given here that uses the numerical differential equation solver, NDSolve, to find parametrized solutions to matrix functions. Here is a 3 3 matrix. In[1]:=  |
Out[2]//MatrixForm=
|
The exponential function is the solution of the differential equation. This can be demonstrated by solving the equation symbolically. In[3]:=  |
Out[3]=
|
The matrix exponential Exp[A t] can be found by forming a matrix equation and solving with NDSolve. The solution here is valid for 0≤t≤5. In[4]:=  |
Out[5]=
|
The solution is a function that will return the matrix function Exp[A t] for a range of t. If t is 0.0, the identity matrix is returned. In[6]:=  |
Out[6]//MatrixForm=
|
This demonstrates that Exp[A].Exp[A] Exp[2A]. In[7]:=  |
Out[8]//MatrixForm=
|
Mathematica already has a function for computing the exponential of a function, MatrixExp. This can be compared with the solution that was computed. In[9]:=  |
Here is a differential equation for the Sin function. In[12]:=  |
Out[12]=
|
This computes the Sin of the matrix A. In[13]:=  |
Out[14]=
|
The Sin of the matrix has the correct behavior at the origin. In[15]:=  |
Out[15]//MatrixForm=
|
This computes the Cos of the matrix A. In[16]:=  |
Out[17]=
|
The Cos of the matrix has the correct behavior at the origin. In[18]:=  |
Out[18]//MatrixForm=
|
This demonstrates the identity , for t 3. In[19]:=  |
Out[19]//MatrixForm=
|
|