Working with matrices and eigensystems

Sometimes, the solution that DSolve gives to a system isn't really what you were looking for (it may look much more complicated than you expected).  This is because Mathematica has to be able to solve some very complicated systems.  Sometimes, if your system is relatively simple (an autonomous homogeneous system, for example), you might be able to get a simpler solution by finding the eigenvalues and eigenvectors.  For example, if you are trying to solve the following system:

[Graphics:../Images/index_gr_155.gif]
[Graphics:../Images/index_gr_156.gif]
[Graphics:../Images/index_gr_157.gif]
[Graphics:../Images/index_gr_158.gif]
[Graphics:../Images/index_gr_159.gif]

Let's find the eigenvalues and eigenvectors of this system (I stuck the N[...] in there to get a numeric result because the exact values are pretty insane...):

[Graphics:../Images/index_gr_160.gif]
[Graphics:../Images/index_gr_161.gif]
[Graphics:../Images/index_gr_162.gif]
[Graphics:../Images/index_gr_163.gif]

Notice that, since all the coefficients of the original system are real, the complex ones occur in complex conjugate pairs.  Now, you can just cut and paste the appropriate eigenvalues/eigenvectors to construct the solution, or with a little more finesse (I'll take them from last to first; eigVectors[[4]] means the 4th vector in the list):

[Graphics:../Images/index_gr_164.gif]
[Graphics:../Images/index_gr_165.gif]
[Graphics:../Images/index_gr_166.gif]
[Graphics:../Images/index_gr_167.gif]

Now, the other two eigenvalues are complex, so recall that we handle those a bit differently:

[Graphics:../Images/index_gr_168.gif]
[Graphics:../Images/index_gr_169.gif]
[Graphics:../Images/index_gr_170.gif]
[Graphics:../Images/index_gr_171.gif]

(Wasn't that fun?  Make sure you understand where all of these came from before you continue.)  

Now, we can find the general solution by combining these:

[Graphics:../Images/index_gr_172.gif]
[Graphics:../Images/index_gr_173.gif]
[Graphics:../Images/index_gr_174.gif]
[Graphics:../Images/index_gr_175.gif]

If the initial conditions are given by:

[Graphics:../Images/index_gr_176.gif]
[Graphics:../Images/index_gr_177.gif]

We can solve for the constants:

[Graphics:../Images/index_gr_178.gif]
[Graphics:../Images/index_gr_179.gif]
[Graphics:../Images/index_gr_180.gif]

The error here is a warning that we probably need to increase our numeric precision for all of our calculations (especially finding the eigenvalues and eigenvectors); round-off errors could easily screw things up for this complicated a situation.  However, we finally get:

[Graphics:../Images/index_gr_181.gif]
[Graphics:../Images/index_gr_182.gif]

Of course, if you have eigenvalues with multiplicity greater than 1, then you have a lot more pain and suffering to deal with.  Unfortunately, Mathematica doesn't automatically give you all the eigenvalues ("generalized eigenvalues") you need for this, though you can certainly use Mathematica to find them.  However, there is a much better way to deal with systems of equations (with constant coefficients, anyway), which I cover in the next section, so let's just skip that, shall we?


Converted by Mathematica      July 20, 2003